diff --git a/.editorconfig b/.editorconfig index b77d4417..dcc4443e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,8 +3,9 @@ root = true [*] charset = utf-8 indent_style = space -indent_size = 2 end_of_line = lf trim_trailing_whitespace = true insert_final_newline = true -max_line_length = 120 \ No newline at end of file + +[*.rb] +indent_size = 2 diff --git a/.gem_rbs_collection/bigdecimal/3.1/.rbs_meta.yaml b/.gem_rbs_collection/bigdecimal/3.1/.rbs_meta.yaml new file mode 100644 index 00000000..243ff3ef --- /dev/null +++ b/.gem_rbs_collection/bigdecimal/3.1/.rbs_meta.yaml @@ -0,0 +1,9 @@ +--- +name: bigdecimal +version: '3.1' +source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems diff --git a/.gem_rbs_collection/bigdecimal/3.1/bigdecimal-math.rbs b/.gem_rbs_collection/bigdecimal/3.1/bigdecimal-math.rbs new file mode 100644 index 00000000..3c61d8f1 --- /dev/null +++ b/.gem_rbs_collection/bigdecimal/3.1/bigdecimal-math.rbs @@ -0,0 +1,119 @@ +# +# Provides mathematical functions. +# +# Example: +# +# require "bigdecimal/math" +# +# include BigMath +# +# a = BigDecimal((PI(100)/2).to_s) +# puts sin(a,100) # => 0.99999999999999999999......e0 +# +module BigMath + # + # Computes e (the base of natural logarithms) to the specified number of digits + # of precision, `numeric`. + # + # BigMath.E(10).to_s + # #=> "0.271828182845904523536028752390026306410273e1" + # + def self?.E: (Numeric prec) -> BigDecimal + + # + # Computes the value of pi to the specified number of digits of precision, + # `numeric`. + # + # BigMath.PI(10).to_s + # #=> "0.3141592653589793238462643388813853786957412e1" + # + def self?.PI: (Numeric prec) -> BigDecimal + + # + # Computes the arctangent of `decimal` to the specified number of digits of + # precision, `numeric`. + # + # If `decimal` is NaN, returns NaN. + # + # BigMath.atan(BigDecimal('-1'), 16).to_s + # #=> "-0.785398163397448309615660845819878471907514682065e0" + # + def self?.atan: (BigDecimal x, Numeric prec) -> BigDecimal + + # + # Computes the cosine of `decimal` to the specified number of digits of + # precision, `numeric`. + # + # If `decimal` is Infinity or NaN, returns NaN. + # + # BigMath.cos(BigMath.PI(4), 16).to_s + # #=> "-0.999999999999999999999999999999856613163740061349e0" + # + def self?.cos: (BigDecimal x, Numeric prec) -> BigDecimal + + # + # Computes the value of e (the base of natural logarithms) raised to the power + # of `decimal`, to the specified number of digits of precision. + # + # If `decimal` is infinity, returns Infinity. + # + # If `decimal` is NaN, returns NaN. + # + def self?.exp: (BigDecimal, Numeric prec) -> BigDecimal + + # + # Computes the natural logarithm of `decimal` to the specified number of digits + # of precision, `numeric`. + # + # If `decimal` is zero or negative, raises Math::DomainError. + # + # If `decimal` is positive infinity, returns Infinity. + # + # If `decimal` is NaN, returns NaN. + # + def self?.log: (BigDecimal, Numeric prec) -> BigDecimal + + # + # Computes the sine of `decimal` to the specified number of digits of precision, + # `numeric`. + # + # If `decimal` is Infinity or NaN, returns NaN. + # + # BigMath.sin(BigMath.PI(5)/4, 5).to_s + # #=> "0.70710678118654752440082036563292800375e0" + # + def self?.sin: (BigDecimal x, Numeric prec) -> BigDecimal + + # + # Computes the square root of `decimal` to the specified number of digits of + # precision, `numeric`. + # + # BigMath.sqrt(BigDecimal('2'), 16).to_s + # #=> "0.1414213562373095048801688724e1" + # + def self?.sqrt: (BigDecimal x, Numeric prec) -> BigDecimal +end diff --git a/.gem_rbs_collection/bigdecimal/3.1/bigdecimal.rbs b/.gem_rbs_collection/bigdecimal/3.1/bigdecimal.rbs new file mode 100644 index 00000000..dfddc723 --- /dev/null +++ b/.gem_rbs_collection/bigdecimal/3.1/bigdecimal.rbs @@ -0,0 +1,1630 @@ +class BigDecimal < Numeric + # + # Internal method used to provide marshalling support. See the Marshal module. + # + def self._load: (String) -> BigDecimal + + # + # Returns the number of digits a Float object is allowed to have; the result is + # system-dependent: + # + # BigDecimal.double_fig # => 16 + # + def self.double_fig: () -> Integer + + # + # + def self.interpret_loosely: (string) -> BigDecimal + + # + # Limit the number of significant digits in newly created BigDecimal numbers to + # the specified value. Rounding is performed as necessary, as specified by + # BigDecimal.mode. + # + # A limit of 0, the default, means no upper limit. + # + # The limit specified by this method takes less priority over any limit + # specified to instance methods such as ceil, floor, truncate, or round. + # + def self.limit: (?Integer? digits) -> Integer + + # + # Returns an integer representing the mode settings for exception handling and + # rounding. + # + # These modes control exception handling: + # + # * BigDecimal::EXCEPTION_NaN. + # * BigDecimal::EXCEPTION_INFINITY. + # * BigDecimal::EXCEPTION_UNDERFLOW. + # * BigDecimal::EXCEPTION_OVERFLOW. + # * BigDecimal::EXCEPTION_ZERODIVIDE. + # * BigDecimal::EXCEPTION_ALL. + # + # Values for `setting` for exception handling: + # + # * `true`: sets the given `mode` to `true`. + # * `false`: sets the given `mode` to `false`. + # * `nil`: does not modify the mode settings. + # + # You can use method BigDecimal.save_exception_mode to temporarily change, and + # then automatically restore, exception modes. + # + # For clarity, some examples below begin by setting all exception modes to + # `false`. + # + # This mode controls the way rounding is to be performed: + # + # * BigDecimal::ROUND_MODE + # + # You can use method BigDecimal.save_rounding_mode to temporarily change, and + # then automatically restore, the rounding mode. + # + # **NaNs** + # + # Mode BigDecimal::EXCEPTION_NaN controls behavior when a BigDecimal NaN is + # created. + # + # Settings: + # + # * `false` (default): Returns `BigDecimal('NaN')`. + # * `true`: Raises FloatDomainError. + # + # Examples: + # + # BigDecimal.mode(BigDecimal::EXCEPTION_ALL, false) # => 0 + # BigDecimal('NaN') # => NaN + # BigDecimal.mode(BigDecimal::EXCEPTION_NaN, true) # => 2 + # BigDecimal('NaN') # Raises FloatDomainError + # + # **Infinities** + # + # Mode BigDecimal::EXCEPTION_INFINITY controls behavior when a BigDecimal + # Infinity or -Infinity is created. Settings: + # + # * `false` (default): Returns `BigDecimal('Infinity')` or + # `BigDecimal('-Infinity')`. + # * `true`: Raises FloatDomainError. + # + # Examples: + # + # BigDecimal.mode(BigDecimal::EXCEPTION_ALL, false) # => 0 + # BigDecimal('Infinity') # => Infinity + # BigDecimal('-Infinity') # => -Infinity + # BigDecimal.mode(BigDecimal::EXCEPTION_INFINITY, true) # => 1 + # BigDecimal('Infinity') # Raises FloatDomainError + # BigDecimal('-Infinity') # Raises FloatDomainError + # + # **Underflow** + # + # Mode BigDecimal::EXCEPTION_UNDERFLOW controls behavior when a BigDecimal + # underflow occurs. Settings: + # + # * `false` (default): Returns `BigDecimal('0')` or `BigDecimal('-Infinity')`. + # * `true`: Raises FloatDomainError. + # + # Examples: + # + # BigDecimal.mode(BigDecimal::EXCEPTION_ALL, false) # => 0 + # def flow_under + # x = BigDecimal('0.1') + # 100.times { x *= x } + # end + # flow_under # => 100 + # BigDecimal.mode(BigDecimal::EXCEPTION_UNDERFLOW, true) # => 4 + # flow_under # Raises FloatDomainError + # + # **Overflow** + # + # Mode BigDecimal::EXCEPTION_OVERFLOW controls behavior when a BigDecimal + # overflow occurs. Settings: + # + # * `false` (default): Returns `BigDecimal('Infinity')` or + # `BigDecimal('-Infinity')`. + # * `true`: Raises FloatDomainError. + # + # Examples: + # + # BigDecimal.mode(BigDecimal::EXCEPTION_ALL, false) # => 0 + # def flow_over + # x = BigDecimal('10') + # 100.times { x *= x } + # end + # flow_over # => 100 + # BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, true) # => 1 + # flow_over # Raises FloatDomainError + # + # **Zero Division** + # + # Mode BigDecimal::EXCEPTION_ZERODIVIDE controls behavior when a zero-division + # occurs. Settings: + # + # * `false` (default): Returns `BigDecimal('Infinity')` or + # `BigDecimal('-Infinity')`. + # * `true`: Raises FloatDomainError. + # + # Examples: + # + # BigDecimal.mode(BigDecimal::EXCEPTION_ALL, false) # => 0 + # one = BigDecimal('1') + # zero = BigDecimal('0') + # one / zero # => Infinity + # BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, true) # => 16 + # one / zero # Raises FloatDomainError + # + # **All Exceptions** + # + # Mode BigDecimal::EXCEPTION_ALL controls all of the above: + # + # BigDecimal.mode(BigDecimal::EXCEPTION_ALL, false) # => 0 + # BigDecimal.mode(BigDecimal::EXCEPTION_ALL, true) # => 23 + # + # **Rounding** + # + # Mode BigDecimal::ROUND_MODE controls the way rounding is to be performed; its + # `setting` values are: + # + # * `ROUND_UP`: Round away from zero. Aliased as `:up`. + # * `ROUND_DOWN`: Round toward zero. Aliased as `:down` and `:truncate`. + # * `ROUND_HALF_UP`: Round toward the nearest neighbor; if the neighbors are + # equidistant, round away from zero. Aliased as `:half_up` and `:default`. + # * `ROUND_HALF_DOWN`: Round toward the nearest neighbor; if the neighbors are + # equidistant, round toward zero. Aliased as `:half_down`. + # * `ROUND_HALF_EVEN` (Banker's rounding): Round toward the nearest neighbor; + # if the neighbors are equidistant, round toward the even neighbor. Aliased + # as `:half_even` and `:banker`. + # * `ROUND_CEILING`: Round toward positive infinity. Aliased as `:ceiling` and + # `:ceil`. + # * `ROUND_FLOOR`: Round toward negative infinity. Aliased as `:floor:`. + # + def self.mode: (Integer mode, ?(Integer | Symbol | nil) value) -> Integer? + + # + # Execute the provided block, but preserve the exception mode + # + # BigDecimal.save_exception_mode do + # BigDecimal.mode(BigDecimal::EXCEPTION_OVERFLOW, false) + # BigDecimal.mode(BigDecimal::EXCEPTION_NaN, false) + # + # BigDecimal(BigDecimal('Infinity')) + # BigDecimal(BigDecimal('-Infinity')) + # BigDecimal(BigDecimal('NaN')) + # end + # + # For use with the BigDecimal::EXCEPTION_* + # + # See BigDecimal.mode + # + def self.save_exception_mode: () { (?nil) -> void } -> void + + # + # Execute the provided block, but preserve the precision limit + # + # BigDecimal.limit(100) + # puts BigDecimal.limit + # BigDecimal.save_limit do + # BigDecimal.limit(200) + # puts BigDecimal.limit + # end + # puts BigDecimal.limit + # + def self.save_limit: () { (?nil) -> void } -> void + + # + # Execute the provided block, but preserve the rounding mode + # + # BigDecimal.save_rounding_mode do + # BigDecimal.mode(BigDecimal::ROUND_MODE, :up) + # puts BigDecimal.mode(BigDecimal::ROUND_MODE) + # end + # + # For use with the BigDecimal::ROUND_* + # + # See BigDecimal.mode + # + def self.save_rounding_mode: () { (?nil) -> void } -> void + + # + # Returns the modulus from dividing by b. + # + # See BigDecimal#divmod. + # + def %: (Numeric) -> BigDecimal + + # + # + def *: (Numeric) -> BigDecimal + + # + # Returns the BigDecimal value of `self` raised to power `other`: + # + # b = BigDecimal('3.14') + # b ** 2 # => 0.98596e1 + # b ** 2.0 # => 0.98596e1 + # b ** Rational(2, 1) # => 0.98596e1 + # + # Related: BigDecimal#power. + # + def **: (Numeric) -> BigDecimal + + # + # Returns the BigDecimal sum of `self` and `value`: + # + # b = BigDecimal('111111.111') # => 0.111111111e6 + # b + 2 # => 0.111113111e6 + # b + 2.0 # => 0.111113111e6 + # b + Rational(2, 1) # => 0.111113111e6 + # b + Complex(2, 0) # => (0.111113111e6+0i) + # + # See the [Note About + # Precision](BigDecimal.html#class-BigDecimal-label-A+Note+About+Precision). + # + def +: (Numeric) -> BigDecimal + + # + # Returns `self`: + # + # +BigDecimal(5) # => 0.5e1 + # +BigDecimal(-5) # => -0.5e1 + # + def +@: () -> BigDecimal + + # + # Returns the BigDecimal difference of `self` and `value`: + # + # b = BigDecimal('333333.333') # => 0.333333333e6 + # b - 2 # => 0.333331333e6 + # b - 2.0 # => 0.333331333e6 + # b - Rational(2, 1) # => 0.333331333e6 + # b - Complex(2, 0) # => (0.333331333e6+0i) + # + # See the [Note About + # Precision](BigDecimal.html#class-BigDecimal-label-A+Note+About+Precision). + # + def -: (Numeric) -> BigDecimal + + # + # Returns the BigDecimal negation of self: + # + # b0 = BigDecimal('1.5') + # b1 = -b0 # => -0.15e1 + # b2 = -b1 # => 0.15e1 + # + def -@: () -> BigDecimal + + # + # Divide by the specified value. + # + # The result precision will be the precision of the larger operand, but its + # minimum is 2*Float::DIG. + # + # See BigDecimal#div. See BigDecimal#quo. + # + def /: (Numeric) -> BigDecimal + + # + # Returns `true` if `self` is less than `other`, `false` otherwise: + # + # b = BigDecimal('1.5') # => 0.15e1 + # b < 2 # => true + # b < 2.0 # => true + # b < Rational(2, 1) # => true + # b < 1.5 # => false + # + # Raises an exception if the comparison cannot be made. + # + def <: (Numeric) -> bool + + # + # Returns `true` if `self` is less or equal to than `other`, `false` otherwise: + # + # b = BigDecimal('1.5') # => 0.15e1 + # b <= 2 # => true + # b <= 2.0 # => true + # b <= Rational(2, 1) # => true + # b <= 1.5 # => true + # b < 1 # => false + # + # Raises an exception if the comparison cannot be made. + # + def <=: (Numeric) -> bool + + # + # The comparison operator. a <=> b is 0 if a == b, 1 if a > b, -1 if a < b. + # + def <=>: (untyped) -> Integer? + + # + # Tests for value equality; returns true if the values are equal. + # + # The == and === operators and the eql? method have the same implementation for + # BigDecimal. + # + # Values may be coerced to perform the comparison: + # + # BigDecimal('1.0') == 1.0 #=> true + # + def ==: (untyped) -> bool + + # + # Tests for value equality; returns true if the values are equal. + # + # The == and === operators and the eql? method have the same implementation for + # BigDecimal. + # + # Values may be coerced to perform the comparison: + # + # BigDecimal('1.0') == 1.0 #=> true + # + def ===: (untyped) -> bool + + # + # Returns `true` if `self` is greater than `other`, `false` otherwise: + # + # b = BigDecimal('1.5') + # b > 1 # => true + # b > 1.0 # => true + # b > Rational(1, 1) # => true + # b > 2 # => false + # + # Raises an exception if the comparison cannot be made. + # + def >: (Numeric) -> bool + + # + # Returns `true` if `self` is greater than or equal to `other`, `false` + # otherwise: + # + # b = BigDecimal('1.5') + # b >= 1 # => true + # b >= 1.0 # => true + # b >= Rational(1, 1) # => true + # b >= 1.5 # => true + # b > 2 # => false + # + # Raises an exception if the comparison cannot be made. + # + def >=: (Numeric) -> bool + + # + # Returns a string representing the marshalling of `self`. See module Marshal. + # + # inf = BigDecimal('Infinity') # => Infinity + # dumped = inf._dump # => "9:Infinity" + # BigDecimal._load(dumped) # => Infinity + # + def _dump: (?untyped) -> String + + # + # Returns the BigDecimal absolute value of `self`: + # + # BigDecimal('5').abs # => 0.5e1 + # BigDecimal('-3').abs # => 0.3e1 + # + def abs: () -> BigDecimal + + # + # Returns the BigDecimal sum of `self` and `value` with a precision of `ndigits` + # decimal digits. + # + # When `ndigits` is less than the number of significant digits in the sum, the + # sum is rounded to that number of digits, according to the current rounding + # mode; see BigDecimal.mode. + # + # Examples: + # + # # Set the rounding mode. + # BigDecimal.mode(BigDecimal::ROUND_MODE, :half_up) + # b = BigDecimal('111111.111') + # b.add(1, 0) # => 0.111112111e6 + # b.add(1, 3) # => 0.111e6 + # b.add(1, 6) # => 0.111112e6 + # b.add(1, 15) # => 0.111112111e6 + # b.add(1.0, 15) # => 0.111112111e6 + # b.add(Rational(1, 1), 15) # => 0.111112111e6 + # + def add: (Numeric value, Integer digits) -> BigDecimal + + # + # Return the smallest integer greater than or equal to the value, as a + # BigDecimal. + # + # BigDecimal('3.14159').ceil #=> 4 + # BigDecimal('-9.1').ceil #=> -9 + # + # If n is specified and positive, the fractional part of the result has no more + # than that many digits. + # + # If n is specified and negative, at least that many digits to the left of the + # decimal point will be 0 in the result. + # + # BigDecimal('3.14159').ceil(3) #=> 3.142 + # BigDecimal('13345.234').ceil(-2) #=> 13400.0 + # + def ceil: () -> Integer + | (int n) -> BigDecimal + + # + # + def clone: () -> self + + # + # The coerce method provides support for Ruby type coercion. It is not enabled + # by default. + # + # This means that binary operations like + * / or - can often be performed on a + # BigDecimal and an object of another type, if the other object can be coerced + # into a BigDecimal value. + # + # e.g. + # a = BigDecimal("1.0") + # b = a / 2.0 #=> 0.5 + # + # Note that coercing a String to a BigDecimal is not supported by default; it + # requires a special compile-time option when building Ruby. + # + def coerce: (Numeric) -> [ BigDecimal, BigDecimal ] + + # + # Divide by the specified value. + # + # digits + # : If specified and less than the number of significant digits of the result, + # the result is rounded to that number of digits, according to + # BigDecimal.mode. + # + # If digits is 0, the result is the same as for the / operator or #quo. + # + # If digits is not specified, the result is an integer, by analogy with + # Float#div; see also BigDecimal#divmod. + # + # + # See BigDecimal#/. See BigDecimal#quo. + # + # Examples: + # + # a = BigDecimal("4") + # b = BigDecimal("3") + # + # a.div(b, 3) # => 0.133e1 + # + # a.div(b, 0) # => 0.1333333333333333333e1 + # a / b # => 0.1333333333333333333e1 + # a.quo(b) # => 0.1333333333333333333e1 + # + # a.div(b) # => 1 + # + def div: (Numeric value) -> Integer + | (Numeric value, int digits) -> BigDecimal + + # + # Divides by the specified value, and returns the quotient and modulus as + # BigDecimal numbers. The quotient is rounded towards negative infinity. + # + # For example: + # + # require 'bigdecimal' + # + # a = BigDecimal("42") + # b = BigDecimal("9") + # + # q, m = a.divmod(b) + # + # c = q * b + m + # + # a == c #=> true + # + # The quotient q is (a/b).floor, and the modulus is the amount that must be + # added to q * b to get a. + # + def divmod: (Numeric) -> [ BigDecimal, BigDecimal ] + + # + # + def dup: () -> self + + # + # Tests for value equality; returns true if the values are equal. + # + # The == and === operators and the eql? method have the same implementation for + # BigDecimal. + # + # Values may be coerced to perform the comparison: + # + # BigDecimal('1.0') == 1.0 #=> true + # + def eql?: (untyped) -> bool + + # + # Returns the exponent of the BigDecimal number, as an Integer. + # + # If the number can be represented as 0.xxxxxx*10**n where xxxxxx is a string of + # digits with no leading zeros, then n is the exponent. + # + def exponent: () -> Integer + + # + # Returns True if the value is finite (not NaN or infinite). + # + def finite?: () -> bool + + # + # Return the integer part of the number, as a BigDecimal. + # + def fix: () -> BigDecimal + + # + # Return the largest integer less than or equal to the value, as a BigDecimal. + # + # BigDecimal('3.14159').floor #=> 3 + # BigDecimal('-9.1').floor #=> -10 + # + # If n is specified and positive, the fractional part of the result has no more + # than that many digits. + # + # If n is specified and negative, at least that many digits to the left of the + # decimal point will be 0 in the result. + # + # BigDecimal('3.14159').floor(3) #=> 3.141 + # BigDecimal('13345.234').floor(-2) #=> 13300.0 + # + def floor: () -> Integer + | (int n) -> BigDecimal + + # + # Return the fractional part of the number, as a BigDecimal. + # + def frac: () -> BigDecimal + + # + # Returns the integer hash value for `self`. + # + # Two instances of BigDecimal have the same hash value if and only if they have + # equal: + # + # * Sign. + # * Fractional part. + # * Exponent. + # + def hash: () -> Integer + + # + # Returns nil, -1, or +1 depending on whether the value is finite, -Infinity, or + # +Infinity. + # + def infinite?: () -> Integer? + + # + # Returns a string representation of self. + # + # BigDecimal("1234.5678").inspect + # #=> "0.12345678e4" + # + def inspect: () -> String + + # + # Returns the modulus from dividing by b. + # + # See BigDecimal#divmod. + # + def modulo: (Numeric b) -> BigDecimal + + # + # Returns the BigDecimal product of `self` and `value` with a precision of + # `ndigits` decimal digits. + # + # When `ndigits` is less than the number of significant digits in the sum, the + # sum is rounded to that number of digits, according to the current rounding + # mode; see BigDecimal.mode. + # + # Examples: + # + # # Set the rounding mode. + # BigDecimal.mode(BigDecimal::ROUND_MODE, :half_up) + # b = BigDecimal('555555.555') + # b.mult(3, 0) # => 0.1666666665e7 + # b.mult(3, 3) # => 0.167e7 + # b.mult(3, 6) # => 0.166667e7 + # b.mult(3, 15) # => 0.1666666665e7 + # b.mult(3.0, 0) # => 0.1666666665e7 + # b.mult(Rational(3, 1), 0) # => 0.1666666665e7 + # b.mult(Complex(3, 0), 0) # => (0.1666666665e7+0.0i) + # + def mult: (Numeric value, int digits) -> BigDecimal + + # + # Returns True if the value is Not a Number. + # + def nan?: () -> bool + + # + # Returns self if the value is non-zero, nil otherwise. + # + def nonzero?: () -> self? + + # + # Returns the value raised to the power of n. + # + # Note that n must be an Integer. + # + # Also available as the operator **. + # + def power: (Numeric n, int prec) -> BigDecimal + + # + # Returns an Array of two Integer values that represent platform-dependent + # internal storage properties. + # + # This method is deprecated and will be removed in the future. Instead, use + # BigDecimal#n_significant_digits for obtaining the number of significant digits + # in scientific notation, and BigDecimal#precision for obtaining the number of + # digits in decimal notation. + # + %a{deprecated} + def precs: () -> [ Integer, Integer ] + + # + # Divide by the specified value. + # + # digits + # : If specified and less than the number of significant digits of the result, + # the result is rounded to the given number of digits, according to the + # rounding mode indicated by BigDecimal.mode. + # + # If digits is 0 or omitted, the result is the same as for the / operator. + # + # + # See BigDecimal#/. See BigDecimal#div. + # + def quo: (Numeric) -> BigDecimal + + # + # Returns the remainder from dividing by the value. + # + # x.remainder(y) means x-y*(x/y).truncate + # + def remainder: (Numeric) -> BigDecimal + + # + # Round to the nearest integer (by default), returning the result as a + # BigDecimal if n is specified, or as an Integer if it isn't. + # + # BigDecimal('3.14159').round #=> 3 + # BigDecimal('8.7').round #=> 9 + # BigDecimal('-9.9').round #=> -10 + # + # BigDecimal('3.14159').round(2).class.name #=> "BigDecimal" + # BigDecimal('3.14159').round.class.name #=> "Integer" + # + # If n is specified and positive, the fractional part of the result has no more + # than that many digits. + # + # If n is specified and negative, at least that many digits to the left of the + # decimal point will be 0 in the result, and return value will be an Integer. + # + # BigDecimal('3.14159').round(3) #=> 3.142 + # BigDecimal('13345.234').round(-2) #=> 13300 + # + # The value of the optional mode argument can be used to determine how rounding + # is performed; see BigDecimal.mode. + # + def round: () -> Integer + | (Numeric n, ?(Integer | Symbol) mode) -> BigDecimal + + # + # Returns the sign of the value. + # + # Returns a positive value if > 0, a negative value if < 0. It behaves the same + # with zeros - it returns a positive value for a positive zero (BigDecimal('0')) + # and a negative value for a negative zero (BigDecimal('-0')). + # + # The specific value returned indicates the type and sign of the BigDecimal, as + # follows: + # + # BigDecimal::SIGN_NaN + # : value is Not a Number + # + # BigDecimal::SIGN_POSITIVE_ZERO + # : value is +0 + # + # BigDecimal::SIGN_NEGATIVE_ZERO + # : value is -0 + # + # BigDecimal::SIGN_POSITIVE_INFINITE + # : value is +Infinity + # + # BigDecimal::SIGN_NEGATIVE_INFINITE + # : value is -Infinity + # + # BigDecimal::SIGN_POSITIVE_FINITE + # : value is positive + # + # BigDecimal::SIGN_NEGATIVE_FINITE + # : value is negative + # + def sign: () -> Integer + + # + # Splits a BigDecimal number into four parts, returned as an array of values. + # + # The first value represents the sign of the BigDecimal, and is -1 or 1, or 0 if + # the BigDecimal is Not a Number. + # + # The second value is a string representing the significant digits of the + # BigDecimal, with no leading zeros. + # + # The third value is the base used for arithmetic (currently always 10) as an + # Integer. + # + # The fourth value is an Integer exponent. + # + # If the BigDecimal can be represented as 0.xxxxxx*10**n, then xxxxxx is the + # string of significant digits with no leading zeros, and n is the exponent. + # + # From these values, you can translate a BigDecimal to a float as follows: + # + # sign, significant_digits, base, exponent = a.split + # f = sign * "0.#{significant_digits}".to_f * (base ** exponent) + # + # (Note that the to_f method is provided as a more convenient way to translate a + # BigDecimal to a Float.) + # + def split: () -> [ Integer, String, Integer, Integer ] + + # + # Returns the square root of the value. + # + # Result has at least n significant digits. + # + def sqrt: (int n) -> BigDecimal + + # + # Subtract the specified value. + # + # e.g. + # c = a.sub(b,n) + # + # digits + # : If specified and less than the number of significant digits of the result, + # the result is rounded to that number of digits, according to + # BigDecimal.mode. + # + def sub: (Numeric value, int digits) -> BigDecimal + + # + # Returns a new Float object having approximately the same value as the + # BigDecimal number. Normal accuracy limits and built-in errors of binary Float + # arithmetic apply. + # + def to_f: () -> Float + + # + # Returns the value as an Integer. + # + # If the BigDecimal is infinity or NaN, raises FloatDomainError. + # + def to_i: () -> Integer + + # + # Returns the value as an Integer. + # + # If the BigDecimal is infinity or NaN, raises FloatDomainError. + # + def to_int: () -> Integer + + # + # Converts a BigDecimal to a Rational. + # + def to_r: () -> Rational + + # + # Converts the value to a string. + # + # The default format looks like 0.xxxxEnn. + # + # The optional parameter s consists of either an integer; or an optional '+' or + # ' ', followed by an optional number, followed by an optional 'E' or 'F'. + # + # If there is a '+' at the start of s, positive values are returned with a + # leading '+'. + # + # A space at the start of s returns positive values with a leading space. + # + # If s contains a number, a space is inserted after each group of that many + # digits, starting from '.' and counting outwards. + # + # If s ends with an 'E', engineering notation (0.xxxxEnn) is used. + # + # If s ends with an 'F', conventional floating point notation is used. + # + # Examples: + # + # BigDecimal('-1234567890123.45678901234567890').to_s('5F') + # #=> '-123 45678 90123.45678 90123 45678 9' + # + # BigDecimal('1234567890123.45678901234567890').to_s('+8F') + # #=> '+12345 67890123.45678901 23456789' + # + # BigDecimal('1234567890123.45678901234567890').to_s(' F') + # #=> ' 1234567890123.4567890123456789' + # + def to_s: (?String | int s) -> String + + # + # Truncate to the nearest integer (by default), returning the result as a + # BigDecimal. + # + # BigDecimal('3.14159').truncate #=> 3 + # BigDecimal('8.7').truncate #=> 8 + # BigDecimal('-9.9').truncate #=> -9 + # + # If n is specified and positive, the fractional part of the result has no more + # than that many digits. + # + # If n is specified and negative, at least that many digits to the left of the + # decimal point will be 0 in the result. + # + # BigDecimal('3.14159').truncate(3) #=> 3.141 + # BigDecimal('13345.234').truncate(-2) #=> 13300.0 + # + def truncate: () -> Integer + | (int n) -> BigDecimal + + # + # Returns True if the value is zero. + # + def zero?: () -> bool + + # + # Returns self. + # + # require 'bigdecimal/util' + # + # d = BigDecimal("3.14") + # d.to_d # => 0.314e1 + # + def to_d: () -> BigDecimal + + private + + def initialize_copy: (self) -> self +end + +# +# Base value used in internal calculations. On a 32 bit system, BASE is 10000, +# indicating that calculation is done in groups of 4 digits. (If it were larger, +# BASE**2 wouldn't fit in 32 bits, so you couldn't guarantee that two groups +# could always be multiplied together without overflow.) +# +BigDecimal::BASE: Integer + +# +# Determines whether overflow, underflow or zero divide result in an exception +# being thrown. See BigDecimal.mode. +# +BigDecimal::EXCEPTION_ALL: Integer + +# +# Determines what happens when the result of a computation is infinity. See +# BigDecimal.mode. +# +BigDecimal::EXCEPTION_INFINITY: Integer + +# +# Determines what happens when the result of a computation is not a number +# (NaN). See BigDecimal.mode. +# +BigDecimal::EXCEPTION_NaN: Integer + +# +# Determines what happens when the result of a computation is an overflow (a +# result too large to be represented). See BigDecimal.mode. +# +BigDecimal::EXCEPTION_OVERFLOW: Integer + +# +# Determines what happens when the result of a computation is an underflow (a +# result too small to be represented). See BigDecimal.mode. +# +BigDecimal::EXCEPTION_UNDERFLOW: Integer + +# +# Determines what happens when a division by zero is performed. See +# BigDecimal.mode. +# +BigDecimal::EXCEPTION_ZERODIVIDE: Integer + +# +# Special value constants +# +BigDecimal::INFINITY: BigDecimal + +BigDecimal::NAN: BigDecimal + +# +# Round towards +Infinity. See BigDecimal.mode. +# +BigDecimal::ROUND_CEILING: Integer + +# +# Indicates that values should be rounded towards zero. See BigDecimal.mode. +# +BigDecimal::ROUND_DOWN: Integer + +# +# Round towards -Infinity. See BigDecimal.mode. +# +BigDecimal::ROUND_FLOOR: Integer + +# +# Indicates that digits >= 6 should be rounded up, others rounded down. See +# BigDecimal.mode. +# +BigDecimal::ROUND_HALF_DOWN: Integer + +# +# Round towards the even neighbor. See BigDecimal.mode. +# +BigDecimal::ROUND_HALF_EVEN: Integer + +# +# Indicates that digits >= 5 should be rounded up, others rounded down. See +# BigDecimal.mode. +# +BigDecimal::ROUND_HALF_UP: Integer + +# +# Determines what happens when a result must be rounded in order to fit in the +# appropriate number of significant digits. See BigDecimal.mode. +# +BigDecimal::ROUND_MODE: Integer + +# +# Indicates that values should be rounded away from zero. See BigDecimal.mode. +# +BigDecimal::ROUND_UP: Integer + +# +# Indicates that a value is negative and finite. See BigDecimal.sign. +# +BigDecimal::SIGN_NEGATIVE_FINITE: Integer + +# +# Indicates that a value is negative and infinite. See BigDecimal.sign. +# +BigDecimal::SIGN_NEGATIVE_INFINITE: Integer + +# +# Indicates that a value is -0. See BigDecimal.sign. +# +BigDecimal::SIGN_NEGATIVE_ZERO: Integer + +# +# Indicates that a value is not a number. See BigDecimal.sign. +# +BigDecimal::SIGN_NaN: Integer + +# +# Indicates that a value is positive and finite. See BigDecimal.sign. +# +BigDecimal::SIGN_POSITIVE_FINITE: Integer + +# +# Indicates that a value is positive and infinite. See BigDecimal.sign. +# +BigDecimal::SIGN_POSITIVE_INFINITE: Integer + +# +# Indicates that a value is +0. See BigDecimal.sign. +# +BigDecimal::SIGN_POSITIVE_ZERO: Integer + +# +# The version of bigdecimal library +# +BigDecimal::VERSION: String + +%a{annotate:rdoc:skip} +module Kernel + private + + # + # Returns the BigDecimal converted from `value` with a precision of `ndigits` + # decimal digits. + # + # When `ndigits` is less than the number of significant digits in the value, the + # result is rounded to that number of digits, according to the current rounding + # mode; see BigDecimal.mode. + # + # When `ndigits` is 0, the number of digits to correctly represent a float + # number is determined automatically. + # + # Returns `value` converted to a BigDecimal, depending on the type of `value`: + # + # * Integer, Float, Rational, Complex, or BigDecimal: converted directly: + # + # # Integer, Complex, or BigDecimal value does not require ndigits; ignored if given. + # BigDecimal(2) # => 0.2e1 + # BigDecimal(Complex(2, 0)) # => 0.2e1 + # BigDecimal(BigDecimal(2)) # => 0.2e1 + # # Float or Rational value requires ndigits. + # BigDecimal(2.0, 0) # => 0.2e1 + # BigDecimal(Rational(2, 1), 0) # => 0.2e1 + # + # * String: converted by parsing if it contains an integer or floating-point + # literal; leading and trailing whitespace is ignored: + # + # # String does not require ndigits; ignored if given. + # BigDecimal('2') # => 0.2e1 + # BigDecimal('2.0') # => 0.2e1 + # BigDecimal('0.2e1') # => 0.2e1 + # BigDecimal(' 2.0 ') # => 0.2e1 + # + # * Other type that responds to method `:to_str`: first converted to a string, + # then converted to a BigDecimal, as above. + # + # * Other type: + # + # * Raises an exception if keyword argument `exception` is `true`. + # * Returns `nil` if keyword argument `exception` is `false`. + # + # Raises an exception if `value` evaluates to a Float and `digits` is larger + # than Float::DIG + 1. + # + def self?.BigDecimal: (real | string | BigDecimal initial, ?int digits, ?exception: bool) -> BigDecimal +end + +%a{annotate:rdoc:skip} +class Integer + # + # Returns the value of `int` as a BigDecimal. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # 42.to_d # => 0.42e2 + # + # See also Kernel.BigDecimal. + # + def to_d: () -> BigDecimal + + # + # Performs division; for integer `numeric`, truncates the result to an integer: + # + # 4 / 3 # => 1 + # 4 / -3 # => -2 + # -4 / 3 # => -2 + # -4 / -3 # => 1 + # + # For other +numeric+, returns non-integer result: + # + # 4 / 3.0 # => 1.3333333333333333 + # 4 / Rational(3, 1) # => (4/3) + # 4 / Complex(3, 0) # => ((4/3)+0i) + # + def /: (BigDecimal) -> BigDecimal + | ... + + # + # Performs multiplication: + # + # 4 * 2 # => 8 + # 4 * -2 # => -8 + # -4 * 2 # => -8 + # 4 * 2.0 # => 8.0 + # 4 * Rational(1, 3) # => (4/3) + # 4 * Complex(2, 0) # => (8+0i) + # + def *: (BigDecimal) -> BigDecimal + | ... + + # + # Performs addition: + # + # 2 + 2 # => 4 + # -2 + 2 # => 0 + # -2 + -2 # => -4 + # 2 + 2.0 # => 4.0 + # 2 + Rational(2, 1) # => (4/1) + # 2 + Complex(2, 0) # => (4+0i) + # + def +: (BigDecimal) -> BigDecimal + | ... + + # + # Performs subtraction: + # + # 4 - 2 # => 2 + # -4 - 2 # => -6 + # -4 - -2 # => -2 + # 4 - 2.0 # => 2.0 + # 4 - Rational(2, 1) # => (2/1) + # 4 - Complex(2, 0) # => (2+0i) + # + def -: (BigDecimal) -> BigDecimal + | ... +end + +%a{annotate:rdoc:skip} +class Float + # + # Returns the value of `float` as a BigDecimal. The `precision` parameter is + # used to determine the number of significant digits for the result. When + # `precision` is set to `0`, the number of digits to represent the float being + # converted is determined automatically. The default `precision` is `0`. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # 0.5.to_d # => 0.5e0 + # 1.234.to_d # => 0.1234e1 + # 1.234.to_d(2) # => 0.12e1 + # + # See also Kernel.BigDecimal. + # + def to_d: (?Integer precision) -> BigDecimal + + # + # Returns a new Float which is the result of dividing `self` by `other`: + # + # f = 3.14 + # f / 2 # => 1.57 + # f / 2.0 # => 1.57 + # f / Rational(2, 1) # => 1.57 + # f / Complex(2, 0) # => (1.57+0.0i) + # + def /: (BigDecimal) -> BigDecimal + | ... + + # + # Returns a new Float which is the product of `self` and `other`: + # + # f = 3.14 + # f * 2 # => 6.28 + # f * 2.0 # => 6.28 + # f * Rational(1, 2) # => 1.57 + # f * Complex(2, 0) # => (6.28+0.0i) + # + def *: (BigDecimal) -> BigDecimal + | ... + + # + # Returns a new Float which is the sum of `self` and `other`: + # + # f = 3.14 + # f + 1 # => 4.140000000000001 + # f + 1.0 # => 4.140000000000001 + # f + Rational(1, 1) # => 4.140000000000001 + # f + Complex(1, 0) # => (4.140000000000001+0i) + # + def +: (BigDecimal) -> BigDecimal + | ... + + # + # Returns a new Float which is the difference of `self` and `other`: + # + # f = 3.14 + # f - 1 # => 2.14 + # f - 1.0 # => 2.14 + # f - Rational(1, 1) # => 2.14 + # f - Complex(1, 0) # => (2.14+0i) + # + def -: (BigDecimal) -> BigDecimal + | ... +end + +%a{annotate:rdoc:skip} +class String + # + # Returns the result of interpreting leading characters in `str` as a + # BigDecimal. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # "0.5".to_d # => 0.5e0 + # "123.45e1".to_d # => 0.12345e4 + # "45.67 degrees".to_d # => 0.4567e2 + # + # See also Kernel.BigDecimal. + # + def to_d: () -> BigDecimal +end + +%a{annotate:rdoc:skip} +class Rational + # + # Returns the value as a BigDecimal. + # + # The required `precision` parameter is used to determine the number of + # significant digits for the result. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Rational(22, 7).to_d(3) # => 0.314e1 + # + # See also Kernel.BigDecimal. + # + def to_d: (Integer precision) -> BigDecimal + + # + # Performs division. + # + # Rational(2, 3) / Rational(2, 3) #=> (1/1) + # Rational(900) / Rational(1) #=> (900/1) + # Rational(-2, 9) / Rational(-9, 2) #=> (4/81) + # Rational(9, 8) / 4 #=> (9/32) + # Rational(20, 9) / 9.8 #=> 0.22675736961451246 + # + def /: (BigDecimal) -> BigDecimal + | ... + + # + # Performs multiplication. + # + # Rational(2, 3) * Rational(2, 3) #=> (4/9) + # Rational(900) * Rational(1) #=> (900/1) + # Rational(-2, 9) * Rational(-9, 2) #=> (1/1) + # Rational(9, 8) * 4 #=> (9/2) + # Rational(20, 9) * 9.8 #=> 21.77777777777778 + # + def *: (BigDecimal) -> BigDecimal + | ... + + # + # Performs addition. + # + # Rational(2, 3) + Rational(2, 3) #=> (4/3) + # Rational(900) + Rational(1) #=> (901/1) + # Rational(-2, 9) + Rational(-9, 2) #=> (-85/18) + # Rational(9, 8) + 4 #=> (41/8) + # Rational(20, 9) + 9.8 #=> 12.022222222222222 + # + def +: (BigDecimal) -> BigDecimal + | ... + + # + # Performs subtraction. + # + # Rational(2, 3) - Rational(2, 3) #=> (0/1) + # Rational(900) - Rational(1) #=> (899/1) + # Rational(-2, 9) - Rational(-9, 2) #=> (77/18) + # Rational(9, 8) - 4 #=> (-23/8) + # Rational(20, 9) - 9.8 #=> -7.577777777777778 + # + def -: (BigDecimal) -> BigDecimal + | ... +end + +%a{annotate:rdoc:skip} +class Complex + # + # Returns the value as a BigDecimal. + # + # The `precision` parameter is required for a rational complex number. This + # parameter is used to determine the number of significant digits for the + # result. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # Complex(0.1234567, 0).to_d(4) # => 0.1235e0 + # Complex(Rational(22, 7), 0).to_d(3) # => 0.314e1 + # + # See also Kernel.BigDecimal. + # + def to_d: (*untyped args) -> BigDecimal + + # + # Returns the quotient of `self` and `numeric`: + # + # Complex.rect(2, 3) / Complex.rect(2, 3) # => (1+0i) + # Complex.rect(900) / Complex.rect(1) # => (900+0i) + # Complex.rect(-2, 9) / Complex.rect(-9, 2) # => ((36/85)-(77/85)*i) + # Complex.rect(9, 8) / 4 # => ((9/4)+2i) + # Complex.rect(20, 9) / 9.8 # => (2.0408163265306123+0.9183673469387754i) + # + def /: (BigDecimal) -> Complex + | ... + + # + # Returns the product of `self` and `numeric`: + # + # Complex.rect(2, 3) * Complex.rect(2, 3) # => (-5+12i) + # Complex.rect(900) * Complex.rect(1) # => (900+0i) + # Complex.rect(-2, 9) * Complex.rect(-9, 2) # => (0-85i) + # Complex.rect(9, 8) * 4 # => (36+32i) + # Complex.rect(20, 9) * 9.8 # => (196.0+88.2i) + # + def *: (BigDecimal) -> Complex + | ... + + # + # Returns the sum of `self` and `numeric`: + # + # Complex.rect(2, 3) + Complex.rect(2, 3) # => (4+6i) + # Complex.rect(900) + Complex.rect(1) # => (901+0i) + # Complex.rect(-2, 9) + Complex.rect(-9, 2) # => (-11+11i) + # Complex.rect(9, 8) + 4 # => (13+8i) + # Complex.rect(20, 9) + 9.8 # => (29.8+9i) + # + def +: (BigDecimal) -> Complex + | ... + + # + # Returns the difference of `self` and `numeric`: + # + # Complex.rect(2, 3) - Complex.rect(2, 3) # => (0+0i) + # Complex.rect(900) - Complex.rect(1) # => (899+0i) + # Complex.rect(-2, 9) - Complex.rect(-9, 2) # => (7+7i) + # Complex.rect(9, 8) - 4 # => (5+8i) + # Complex.rect(20, 9) - 9.8 # => (10.2+9i) + # + def -: (BigDecimal) -> Complex + | ... +end + +%a{annotate:rdoc:skip} +class NilClass + # + # Returns nil represented as a BigDecimal. + # + # require 'bigdecimal' + # require 'bigdecimal/util' + # + # nil.to_d # => 0.0 + # + def to_d: () -> BigDecimal +end diff --git a/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml b/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml new file mode 100644 index 00000000..e7fe46e8 --- /dev/null +++ b/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml @@ -0,0 +1,9 @@ +--- +name: concurrent-ruby +version: '1.1' +source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems diff --git a/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs b/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs new file mode 100644 index 00000000..56e24adb --- /dev/null +++ b/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs @@ -0,0 +1,4 @@ +module Concurrent + class Array[T] < ::Array[T] + end +end \ No newline at end of file diff --git a/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs b/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs new file mode 100644 index 00000000..6e5af8e5 --- /dev/null +++ b/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs @@ -0,0 +1,26 @@ +module Concurrent + module ExecutorService + interface _Task + def call: () -> void + end + + def post: [A] (*A args) { (*A args) -> void } -> bool + + def <<: (_Task task) -> bool + + def can_overflow?: () -> bool + + def serialized?: () -> bool + end + + type executor = ExecutorService | :io | :fast | :immediate + + def self.executor: (executor executor_identifier) -> ExecutorService + + def self.global_io_executor: () -> ExecutorService + def self.global_fast_executor: () -> ExecutorService + def self.global_immediate_executor: () -> ExecutorService + + def self.new_io_executor: (?Hash[Symbol, untyped] opts) -> ExecutorService + def self.new_fast_executor: (?Hash[Symbol, untyped] opts) -> ExecutorService +end diff --git a/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs b/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs new file mode 100644 index 00000000..e65e556a --- /dev/null +++ b/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs @@ -0,0 +1,4 @@ +module Concurrent + class Hash[K, V] < ::Hash[K, V] + end +end diff --git a/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs b/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs new file mode 100644 index 00000000..ad2e0abc --- /dev/null +++ b/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs @@ -0,0 +1,68 @@ +module Concurrent + class Map[unchecked out K, unchecked out V] + def initialize: (?Hash[Symbol, untyped] options) ?{ (self, untyped) -> V } -> void + + def []: (untyped key) -> V? + def []=: (K key, V value) -> V + + alias get [] + alias put []= + + def compute: (K key) { (V? old_value) -> V } -> V + | (K key) { (V? old_value) -> nil } -> nil + + def compute_if_absent: (K key) { () -> V } -> V + + def compute_if_present: (K key) { (V old_value) -> V? } -> V? + + def fetch: (untyped key) -> V + | [D] (untyped key, D default_value) -> (V | D) + | [T, D] (T key) { (T key) -> D } -> (V | D) + + def fetch_or_store: (untyped key) -> V + | (K key, V default_value) -> V + | (K key) { (K key) -> V } -> V + + def put_if_absent: (K key, V value) -> V? + + def value?: (untyped value) -> bool + + def keys: () -> Array[K] + + def values: () -> Array[V] + + def each_key: () { (K key) -> void } -> self + + def each_value: () { (V value) -> void } -> self + + def each_pair: () { (K key, V value) -> void } -> self + + alias each each_pair + + def key: (untyped value) -> K? + + def empty?: () -> bool + + def size: () -> Integer + + def marshal_dump: () -> Hash[K, V] + def marshal_load: (Hash[K, V] hash) -> self + + def delete: (K key) -> V? + def delete_pair: (K key, V value) -> bool + + # undef :freeze + + def inspect: () -> String + + private + + def raise_fetch_no_key: () -> bot + + def initialize_copy: (instance other) -> void + + def populate_from: (Hash[K, V] hash) -> self + + def validate_options_hash!: (Hash[Symbol, untyped] options) -> void + end +end diff --git a/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs b/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs new file mode 100644 index 00000000..c64b2acd --- /dev/null +++ b/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs @@ -0,0 +1,249 @@ +module Concurrent + module Promises + module FactoryMethods + def any_event: (*(Event | Future[top, top]) futures_and_or_events) -> Event + def any_event_on: (executor default_executor, *(Event | Future[top, top]) futures_and_or_events) -> Event + + def any_fulfilled_future: (*Event events) -> Future[nil, bot] + | [T, E] (*Future[T, E] futures) -> Future[T, E] + | [T, E] (*(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E] + def any_fulfilled_future_on: (executor default_executor, *Event events) -> Future[nil, bot] + | [T, E] (executor default_executor, *Future[T, E] futures) -> Future[T, E] + | [T, E] (executor default_executor, *(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E] + + def any_resolved_future: (*Event events) -> Future[nil, bot] + | [T, E] (*Future[T, E] futures) -> Future[T, E] + | [T, E] (*(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E] + alias any any_resolved_future + def any_resolved_future_on: (executor default_executor, *Event events) -> Future[nil, bot] + | [T, E] (executor default_executor, *Future[T, E] futures) -> Future[T, E] + | [T, E] (executor default_executor, *(Event | Future[T, E]) futures_and_or_events) -> Future[T | nil, E] + + def default_executor: () -> executor + + def delay: () -> Event + | [A, T] (*A args) { (*A args) -> T } -> Future[T, Exception] + def delay_on: (executor default_executor) -> Event + | [A, T] (executor default_executor, *A args) { (*A args) -> T } -> Future[T, Exception] + + def fulfilled_future: [T] (T value, ?executor default_executor) -> Future[T, bot] + + def future: [A, T] (*A args) { (*A args) -> T } -> Future[T, Exception] + def future_on: [A, T] (executor default_executor, *A args) { (*A args) -> T } -> Future[T, Exception] + + def make_future: (nil, ?executor default_executor) -> Event + | [X < AbstractEventFuture] (X event_or_future, ?executor default_executor) -> X + | [E < Exception] (E reason, ?executor default_executor) -> Future[bot, E] + | [T] (T value, ?executor default_executor) -> Future[T, bot] + + def rejected_future: [E] (E reason, ?executor default_executor) -> Future[bot, E] + + def resolvable_event: () -> ResolvableEvent + def resolvable_event_on: (executor default_executor) -> ResolvableEvent + + def resolvable_future: () -> ResolvableFuture[untyped, untyped] + def resolvable_future_on: (executor default_executor) -> ResolvableFuture[untyped, untyped] + + def resolved_event: (?executor default_executor) -> Event + + def resolved_future: [T] (true fulfilled, T value, top reason, ?executor default_executor) -> Future[T, bot] + | [E] (false fulfilled, top value, E reason, ?executor default_executor) -> Future[bot, E] + | [T, E] (boolish fulfilled, T? value, E? reason, ?executor default_executor) -> Future[T, E] + + def schedule: (Numeric | Time intended_time) -> Event + | [A, T] (Numeric | Time intended_time, *A args) { (*A args) -> T } -> Future[T, Exception] + def schedule_on: (executor default_executor, Numeric | Time intended_time) -> Event + | [A, T] (executor default_executor, Numeric | Time intended_time, *A args) { (*A args) -> T } -> Future[T, Exception] + + def zip_events: (*(Event | Future[top, top]) futures_and_or_events) -> Event + def zip_events_on: (executor default_executor, *(Event | Future[top, top]) futures_and_or_events) -> Event + + def zip_futures: (*Event events) -> Future[::Array[nil], bot] + | [T, E] (*Future[T, E] futures) -> Future[::Array[T], ::Array[E]] + | [T, E] (*(Event | Future[T, E]) futures_and_or_events) -> Future[::Array[T | nil], ::Array[E | nil]] + alias zip zip_futures + def zip_futures_on: (executor default_executor, *Event events) -> Future[Array[nil], bot] + | [T, E] (executor default_executor, *Future[T, E] futures) -> Future[Array[T], Array[E]] + | [T, E] (executor default_executor, *(Event | Future[T, E]) futures_and_or_events) -> Future[Array[T | nil], Array[E]] + end + + extend FactoryMethods + + class AbstractEventFuture + def chain: [A, U] (*A args) { (*untyped) -> U } -> Future[U, Exception] + def chain_on: [A, U] (executor executor, *A args) { (*untyped) -> U } -> Future[U, Exception] + + def chain_resolvable: (Resolvable resolvable) -> self + alias tangle chain_resolvable + + def default_executor: () -> executor + + def internal_state: () -> Object + + def on_resolution: [A] (*A args) { (*untyped) -> void } -> self + def on_resolution!: [A] (*A args) { (*untyped) -> void } -> self + def on_resolution_using: [A] (executor executor, *A args) { (*untyped) -> void } -> self + + def resolved?: () -> bool + + def pending?: () -> bool + + def state: () -> Symbol + + def touch: () -> self + + def wait: (?nil) -> self + | (Numeric timeout) -> bool + end + + class Event < AbstractEventFuture + def any: (Event | Future[top, top] event_or_future) -> Event + alias | any + + def delay: () -> Event + + def schedule: (Numeric | Time intended_time) -> Event + + def to_event: () -> self + + def to_future: () -> Future[nil, bot] + + def with_default_executor: (executor executor) -> Event + + def zip: (Event event) -> Event + | [T, E] (Future[T, E] future) -> Future[T, E] + alias & zip + + + ## Following methods are actually defined in the base class and have specific types for Event + + def chain: [A, U] (*A args) { (*A args) -> U } -> Future[U, Exception] + def chain_on: [A, U] (executor executor, *A args) { (*A args) -> U } -> Future[U, Exception] + + def on_resolution: [A] (*A args) { (*A args) -> void } -> self + def on_resolution!: [A] (*A args) { (*A args) -> void } -> self + def on_resolution_using: [A] (executor executor, *A args) { (*A args) -> void } -> self + + def state: () -> (:pending | :resolved) + end + + class Future[out T, out E] < AbstractEventFuture + def any: (Event event) -> Future[T | nil, E] + | [T2, E2] (Future[T2, E2] future) -> Future[T | T2, E | E2] + alias | any + + def delay: () -> Future[T, E] + + def exception: () -> Exception # TODO: Return type can be narrowed to E when E <: Exception + + def flat_event: () -> Event + + def flat_future: (?Integer level) -> untyped # TODO: Valid only if T <: Future[top, top] + alias flat flat_future + + def fulfilled?: () -> bool + + def on_fulfillment: [A] (*A args) { (T value, *A args) -> void } -> self + def on_fulfillment!: [A] (*A args) { (T value, *A args) -> void } -> self + def on_fulfillment_using: [A] (executor executor, *A args) { (T value, A args) -> void } -> self + + def on_rejection: [A] (*A args) { (E reason, *A args) -> void } -> self + def on_rejection!: [A] (*A args) { (E reason, *A args) -> void } -> self + def on_rejection_using: [A] (executor executor, *A args) { (E reason, A args) -> void } -> self + + def reason: (?Numeric timeout) -> (E | nil) + | [R] (Numeric timeout, R timeout_value) -> (E | R | nil) + + def rejected?: () -> bool + + def rescue: [A, U] (*A args) { (E reason, *A args) -> U } -> Future[U, Exception] + def rescue_on: [A, U] (executor executor, *A args) { (E reason, *A args) -> U } -> Future[U, Exception] + + def result: (?nil) -> ([true, T, nil] | [false, nil, E]) + | (Numeric timeout) -> ([true, T, nil] | [false, nil, E] | nil) + + def run: (?^(untyped) -> Future[untyped, untyped]? run_test) -> Future[untyped, untyped] # TODO: Any specific type? + + def schedule: (Numeric | Time intended_time) -> Future[T, E] + + def then: [A, U] (*A args) { (T value, *A args) -> U } -> Future[U, E | Exception] + def then_on: [A, U] (executor executor, *A args) { (T value, *A args) -> U } -> Future[U, E | Exception] + + def to_event: () -> Event + + def to_future: () -> self + + def value: (?Numeric timeout) -> (T | nil) + | [R] (Numeric timeout, R timeout_value) -> (T | R | nil) + def value!: (?nil) -> T + | (Numeric timeout) -> (T | nil) + | [R] (Numeric timeout, R timeout_value) -> (T | R | nil) + + def wait!: (?nil) -> self + | (Numeric timeout) -> bool + + def with_default_executor: (executor executor) -> Future[T, E] + + def zip: (Event event) -> Future[T, E] + | [T2, E2] (Future[T2, E2] future) -> Future[[T, T2], [E, E2]] + alias & zip + + + ## Following methods are actually defined in the base class and have specific types for Future + + def chain: [A, U] (*A args) { (bool fulfilled, T? value, E? reason, *A args) -> U } -> Future[U, Exception] + def chain_on: [A, U] (executor executor, *A args) { (bool fulfilled, T? value, E? reason, *A args) -> U } -> Future[U, Exception] + + def on_resolution: [A] (*A args) { (bool fulfilled, T? value, E? reason, *A args) -> void } -> self + def on_resolution!: [A] (*A args) { (bool fulfilled, T? value, E? reason, *A args) -> void } -> self + def on_resolution_using: [A] (executor executor, *A args) { (bool fulfilled, T? value, E? reason, *A args) -> void } -> self + + def state: () -> (:pending | :fulfilled | :rejected) + end + + module Resolvable + end + + class ResolvableEvent < Event + include Resolvable + + def resolve: (?true raise_on_reassign, ?boolish reserved) -> self + | (boolish raise_on_reassign, ?boolish reserved) -> (self | false) + + def wait: (Numeric timeout, boolish resolve_on_timeout) -> bool + | ... + + def with_hidden_resolvable: () -> Event + end + + class ResolvableFuture[T, E] < Future[T, E] # Note: ResolvableFuture is invariant on T and E + include Resolvable + + def evalute_to: [A] (*A args) { (*A args) -> T } -> self # TODO: Unsound unless E :> Exception + def evalute_to!: [A] (*A args) { (*A args) -> T } -> self # TODO: ditto + + def fulfill: (T value, ?true raise_on_reassign, ?boolish reserved) -> self + | (T value, boolish raise_on_reassign, ?boolish reserved) -> (self | false) + + def reason: [R] (Numeric timeout, R timeout_value, [boolish, T?, E?] resolve_on_timeout) -> (E | R | nil) + | ... + + def reject: (E reason, ?true raise_on_reassign, ?boolish reserved) -> self + | (E reason, boolish raise_on_reassign, ?boolish reserved) -> (self | false) + + def resolve: (?boolish fulfilled, ?T? value, ?E? reason, ?true raise_on_reassign, ?boolish reserved) -> self + | (boolish fulfilled, T? value, E? reason, boolish raise_on_reassign, ?boolish reserved) -> (self | false) + + def result: (Numeric timeout, [boolish, T?, E?] resolve_on_timeout) -> ([true, T, nil] | [false, nil, E] | nil) + | ... + + def value: [R] (Numeric timeout, R timeout_value, [boolish, T?, E?] resolve_on_timeout) -> (T | R | nil) + | ... + + def value!: [R] (Numeric timeout, R timeout_value, [boolish, T?, E?] resolve_on_timeout) -> (T | R | nil) + | ... + + def with_hidden_resolvable: () -> Future[T, E] + end + end +end diff --git a/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs b/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs new file mode 100644 index 00000000..95f8ef20 --- /dev/null +++ b/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs @@ -0,0 +1,4 @@ +module Concurrent + class Set[T] < ::Set[T] + end +end diff --git a/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs b/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs new file mode 100644 index 00000000..334fb925 --- /dev/null +++ b/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs @@ -0,0 +1,47 @@ +module Concurrent + interface _Observer[T] + def update: (Time, T? result, StandardError? exception) -> void + end + + interface _Dereferenceable[T] + def value: -> T + def deref: -> T + end + + interface _Observable[T] + def add_observer: (_Observer[T]) -> _Observer[T] # Typed: observer with standard `update` method + | () { (?Time, ?T?, ?StandardError?) -> void } -> ^(?Time, ?T?, ?StandardError?) -> void # Typed: block form + | (untyped observer, Symbol func) -> untyped # Untyped: custom method name + def count_observers: -> Integer + def delete_observer: (_Observer[T]) -> _Observer[T] + | (^(?Time, ?T?, ?StandardError?) -> void) -> ^(?Time, ?T?, ?StandardError?) -> void + | (untyped observer) -> untyped + def delete_observers: -> self + def with_observer: (_Observer[T]) -> self + | () { (?Time, ?T?, ?StandardError?) -> void } -> self + | (untyped observer, Symbol func) -> self + end + + class TimerTask[T] + include _Observable[T] + include _Dereferenceable[T] + + def initialize: ( + ?execution_interval: Float | Integer, + ?run_now: bool, + ?executor: executor, + ?dup_on_deref: bool, + ?freeze_on_deref: bool, + ?copy_on_deref: (^(T) -> T)?, + ?interval_type: :fixed_rate | :fixed_delay + ) { (instance) -> T } -> void + + def execute: -> self + def execution_interval: -> (Float | Integer) + def execution_interval=: (Float | Integer) -> void + def shutdown: -> bool + def interval_type: -> (:fixed_rate | :fixed_delay) + def timeout_interval: -> Float + def running?: -> bool + end +end diff --git a/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs b/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs new file mode 100644 index 00000000..50e6a5a1 --- /dev/null +++ b/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs @@ -0,0 +1,5 @@ +module Concurrent + def self.physical_processor_count: () -> Integer + + def self.processor_count: () -> Integer +end diff --git a/.gem_rbs_collection/faraday/2.7/.rbs_meta.yaml b/.gem_rbs_collection/faraday/2.7/.rbs_meta.yaml new file mode 100644 index 00000000..7deed200 --- /dev/null +++ b/.gem_rbs_collection/faraday/2.7/.rbs_meta.yaml @@ -0,0 +1,9 @@ +--- +name: faraday +version: '2.7' +source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems diff --git a/.gem_rbs_collection/faraday/2.7/faraday-2.7.rbs b/.gem_rbs_collection/faraday/2.7/faraday-2.7.rbs new file mode 100644 index 00000000..ca994c60 --- /dev/null +++ b/.gem_rbs_collection/faraday/2.7/faraday-2.7.rbs @@ -0,0 +1,22 @@ +module Faraday + class TooManyRequestsError < ClientError + end + + class Response + class Logger + def on_error: (untyped exc) -> void + end + end + + module Logging + class Formatter + def exception: (untyped exc) -> void + + private + + def dump_headers: (nil headers) -> nil + | ... + def log_errors?: () -> boolish + end + end +end diff --git a/.gem_rbs_collection/faraday/2.7/faraday.rbs b/.gem_rbs_collection/faraday/2.7/faraday.rbs new file mode 100644 index 00000000..60871521 --- /dev/null +++ b/.gem_rbs_collection/faraday/2.7/faraday.rbs @@ -0,0 +1,378 @@ +module Faraday + VERSION: ::String + + attr_reader self.default_adapter: Symbol + + def self.new: (?untyped url, ?untyped options) ?{ (?Faraday::Connection) -> void } -> Faraday::Connection + + interface _BuilderDelegatable + def use: (Symbol | Class klass, *untyped args) ?{ (?) -> void } -> void + def request: (Symbol | Class klass, *untyped args) ?{ (?) -> void } -> void + def response: (Symbol | Class klass, *untyped args) ?{ (?) -> void } -> void + def adapter: (Symbol | Class klass, *untyped args) ?{ (?) -> void } -> void + def app: () -> untyped + end + + class Adapter + extend MiddlewareRegistry + + CONTENT_LENGTH: "Content-Length" + + interface _SupportsParallel + def supports_parallel: () -> boolish + def supports_parallel=: (boolish value) -> void + def supports_parallel?: () -> boolish + end + + module Parallelism + include _SupportsParallel + + def inherited: (_SupportsParallel subclass) -> void + end + + extend Parallelism + + def initialize: (?untyped? _app, ?::Hash[untyped, untyped] opts) ?{ () -> untyped } -> void + def connection: (Env | Hash[untyped, untyped] env) ?{ (untyped) -> untyped } -> untyped + def close: () -> void + def call: (Env env) -> Response + + private + + # TODO: The block parameter should be `Utils::Headers`, but it has not yet been defined. + def save_response: (Env env, Integer status, String body, ?Hash[untyped, untyped]? headers, ?String? reason_phrase, ?finished: bool) ?{ (untyped) -> void } -> Response + def request_timeout: (:read | :open | :write `type`, Hash[Symbol, untyped] options) -> Integer? + + TIMEOUT_KEYS: { read: :read_timeout, open: :open_timeout, write: :write_timeout } + + class Test < Adapter + type meta = { match_data: ::MatchData? } + + attr_accessor stubs: untyped + + class Stubs + class NotFound < StandardError + end + + def initialize: (?strict_mode: bool) ?{ (self) -> void } -> void + def empty?: () -> bool + def match: (Env env) -> ((false | nil) | [Stub, meta]) + def get: (String | URI | Regexp path, ?::Hash[Symbol | String, untyped] headers) { (Env env, meta) -> [Integer, ::Hash[String | Symbol, untyped], String] } -> void + def head: (String | URI | Regexp path, ?::Hash[Symbol | String, untyped] headers) { (Env env, meta) -> [Integer, ::Hash[String | Symbol, untyped], String] } -> void + def post: (String | URI | Regexp path, ?(^(String) -> bool | _ToS)? body, ?::Hash[Symbol | String, untyped] headers) { (Env env, meta) -> [Integer, ::Hash[String | Symbol, untyped], String] } -> void + def put: (String | URI | Regexp path, ?(^(String) -> bool | _ToS)? body, ?::Hash[Symbol | String, untyped] headers) { (Env env, meta) -> [Integer, ::Hash[String | Symbol, untyped], String] } -> void + def patch: (String | URI | Regexp path, ?(^(String) -> bool | _ToS)? body, ?::Hash[Symbol | String, untyped] headers) { (Env env, meta) -> [Integer, ::Hash[String | Symbol, untyped], String] } -> void + def delete: (String | URI | Regexp path, ?::Hash[Symbol | String, untyped] headers) { (Env env, meta) -> [Integer, ::Hash[String | Symbol, untyped], String] } -> void + def options: (String | URI | Regexp path, ?::Hash[Symbol | String, untyped] headers) { (Env env, meta) -> [Integer, ::Hash[String | Symbol, untyped], String] } -> void + def verify_stubbed_calls: () -> void + def strict_mode=: (boolish value) -> void + + private # protected is not yet supported. See https://github.com/ruby/rbs/issues/579 + + def new_stub: (:get | :head | :post | :put | :patch | :delete | :options request_method, String | URI | Regexp path, ?::Hash[Symbol | String, untyped] headers, ?(^(String) -> bool | _ToS)? body) { (untyped env, meta) -> [Integer, ::Hash[String | Symbol, untyped], String] } -> void + def matches?: (::Hash[Symbol, untyped] stack, Env env) -> ([Stub, meta] | nil) + end + + class Stub + attr_accessor host: String? + attr_accessor path: String? + attr_accessor query: String? + attr_accessor headers: Utils::Headers? + attr_accessor body: String? + attr_accessor strict_mode: boolish + attr_accessor block: Proc? + + def initialize: (String? host, String? path, String? query, Utils::Headers? headers, String? body, boolish strict_mode, Proc block) -> void + def matches?: (Env env) -> [bool, meta] + def path_match?: (String request_path, meta) -> bool + def params_match?: (Env env) -> bool + def headers_match?: (::Hash[String | Symbol, untyped] request_headers) -> bool + def body_match?: (String request_body) -> bool + def to_s: () -> ::String + end + + def initialize: (untyped app) ?{ (Stubs stubs) -> void } -> void + | (untyped app, untyped? stubs) ?{ (untyped stubs) -> void } -> void + def configure: () { (untyped) -> void } -> void + def call: (Env env) -> untyped + end + end + + class AdapterRegistry + @lock: untyped # TODO: Replace this with `Monitor` + @constants: Hash[String, untyped] + + def initialize: () -> void + def get: (Symbol | String name) -> untyped + def set: (untyped klass, ?_ToS? name) -> void + end + + class Connection + include _BuilderDelegatable + + attr_reader headers: Hash[String, String] + attr_reader ssl: SSLOptions + + def options: () -> RequestOptions + | ((String | URI)? url, ?untyped params, ?untyped headers) -> Response + + + def get: (?String | URI url, ?untyped params, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response + def head: (?String | URI url, ?untyped params, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response + def delete: (?String | URI url, ?untyped params, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response + def trace: (?String | URI url, ?untyped params, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response + + def post: (?String | URI url, ?untyped body, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response + def put: (?String | URI url, ?untyped body, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response + def patch: (?String | URI url, ?untyped body, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response + + def build_url: (?String | URI | nil url, ?Hash[Symbol | String, untyped]? extra_params) -> URI::HTTP + end + + class SSLOptions + attr_accessor verify: untyped + attr_accessor verify_hostname: untyped + attr_accessor ca_file: untyped + attr_accessor ca_path: untyped + attr_accessor verify_mode: untyped + attr_accessor cert_store: untyped + attr_accessor client_cert: untyped + attr_accessor client_key: untyped + attr_accessor certificate: untyped + attr_accessor private_key: untyped + attr_accessor verify_depth: untyped + attr_accessor version: untyped + attr_accessor min_version: untyped + attr_accessor max_version: untyped + end + + class RequestOptions + attr_accessor params_encoder: untyped + attr_accessor proxy: untyped + attr_accessor bind: untyped + attr_accessor timeout: untyped + attr_accessor open_timeout: untyped + attr_accessor read_timeout: untyped + attr_accessor write_timeout: untyped + attr_accessor boundary: untyped + attr_accessor oauth: untyped + attr_accessor context: untyped + attr_accessor on_data: untyped + end + + class Error < StandardError + attr_reader response: Hash[Symbol, untyped]? + attr_reader wrapped_exception: Exception? + + type exc = Exception | Hash[Symbol, untyped] | String + + def initialize: (?exc? exc, ?Hash[Symbol, untyped]? response) -> void + def backtrace: () -> ::Array[String]? + def inspect: () -> ::String + def response_status: () -> untyped + def response_headers: () -> untyped + def response_body: () -> untyped + def exc_msg_and_response!: (?exc? exc, ?Hash[Symbol, untyped]? response) -> String + def exc_msg_and_response: (?exc? exc, ?Hash[Symbol, untyped]? response) -> [Exception?, String, Hash[Symbol, untyped]?] + end + + class ClientError < Error + end + + class BadRequestError < ClientError + end + + class UnauthorizedError < ClientError + end + + class ForbiddenError < ClientError + end + + class ResourceNotFound < ClientError + end + + class ProxyAuthError < ClientError + end + + class ConflictError < ClientError + end + + class UnprocessableEntityError < ClientError + end + + class ServerError < Error + end + + class TimeoutError < ServerError + def initialize: (?(Exception | Hash[Symbol, untyped] | String)? exc, ?Hash[Symbol, untyped]? response) -> void + end + + class NilStatusError < ServerError + def initialize: ((Exception | Hash[Symbol, untyped] | String)? exc, ?Hash[Symbol, untyped]? response) -> void + end + + class ConnectionFailed < Error + end + + class SSLError < Error + end + + class ParsingError < Error + end + + class RackBuilder + include _BuilderDelegatable + end + + class Response + class Logger < Middleware + def initialize: (untyped app, ?untyped logger, ?::Hash[Symbol, untyped] options) ?{ (Logging::Formatter formatter) -> void } -> void + def call: (Env env) -> untyped + def on_complete: (Env env) -> void + end + + def status: () -> Integer + def headers: () -> untyped + def body: () -> String + def success?: () -> bool + end + + class Request + def http_method=: (untyped) -> void + def path=: (String | URI) -> void + def params=: (untyped) -> void + def headers=: (untyped) -> void + def body=: (untyped) -> void + def options=: (untyped) -> void + def headers: () -> Utils::Headers + def url: (String | URI path, ?::Hash[untyped, untyped] params) -> void + def []: (untyped key) -> void + def []=: (untyped key, untyped value) -> void + end + + module FlatParamsEncoder + extend Forwardable + + def self.encode: (Hash[_ToS, _ToS | Array[_ToS]] | nil params) -> (nil | String) + def self.decode: (String | nil query) -> (nil | Hash[String, true | String | Array[String]]) + + attr_accessor self.sort_params: boolish + end + + class Middleware + extend MiddlewareRegistry + + attr_reader app: untyped + attr_reader options: Hash[untyped, untyped] + + def initialize: (?untyped? app, ?::Hash[untyped, untyped] options) -> void + def call: (Env env) -> untyped + def close: () -> void + end + + module Logging + class Formatter + extend Forwardable + + DEFAULT_OPTIONS: ::Hash[Symbol, untyped] + + @logger: untyped + @options: ::Hash[Symbol, untyped] + @filter: ::Array[[untyped, untyped]] + + def initialize: (logger: untyped, options: ::Hash[Symbol, untyped]) -> void + + def debug: (?untyped progname) ?{ () -> untyped } -> untyped + def info: (?untyped progname) ?{ () -> untyped } -> untyped + def warn: (?untyped progname) ?{ () -> untyped } -> untyped + def error: (?untyped progname) ?{ () -> untyped } -> untyped + def fatal: (?untyped progname) ?{ () -> untyped } -> untyped + + def request: (Env env) -> void + def response: (Env env) -> void + def filter: (untyped filter_word, untyped filter_replacement) -> void + + private + + def dump_headers: (untyped headers) -> String + def dump_body: (untyped body) -> String + def pretty_inspect: (untyped body) -> String + def log_headers?: (String | Symbol type) -> boolish + def log_body?: (String | Symbol type) -> boolish + def apply_filters: (untyped output) -> String + def log_level: () -> Symbol + def log_headers: (String type, untyped headers) -> untyped + def log_body: (String type, untyped body) -> untyped + end + end + + module MiddlewareRegistry + def registered_middleware: () -> Hash[Symbol, untyped] + def register_middleware: (**untyped mappings) -> void + def unregister_middleware: (Symbol key) -> void + def lookup_middleware: (Symbol key) -> untyped + + private + + def middleware_mutex: () ?{ () -> untyped } -> void + def load_middleware: (Symbol key) -> untyped + end + + module Utils + class Headers < ::Hash[Symbol | String, untyped] + @names: ::Hash[String, String] + + def self.from: (untyped value) -> Headers + def self.allocate: () -> Headers + def initialize: (?::Hash[Symbol | String, untyped]? hash) -> void + def initialize_names: () -> void + + KeyMap: ::Hash[Symbol, String] + + def []: (String | Symbol key) -> untyped? + def []=: (String | Symbol key, untyped val) -> untyped + def fetch: (String | Symbol key, *untyped args) ?{ () -> untyped } -> untyped + def delete: (String | Symbol key) -> untyped? + def include?: (String | Symbol key) -> bool + + alias has_key? include? + alias member? include? + alias key? include? + + def merge!: (::Hash[Symbol | String, untyped] other) -> self + alias update merge! + + def merge: (::Hash[Symbol | String, untyped] other) -> Headers + def replace: (::Hash[Symbol | String, untyped] other) -> self + def to_hash: () -> Headers + def parse: (String? header_string) -> Array[untyped]? + + attr_reader names: ::Hash[String, String] + + private + + def add_parsed: (Symbol | String key, String value) -> untyped + end + end + + class Env + attr_accessor method: Symbol + attr_accessor request_body: String + attr_accessor url: URI::HTTP | URI::HTTPS + attr_accessor request: Faraday::RequestOptions + attr_accessor request_headers: Hash[String, String] + attr_accessor ssl: Faraday::SSLOptions + attr_accessor parallel_manager: untyped + attr_accessor params: untyped + attr_accessor response: untyped + attr_accessor response_headers: untyped + attr_accessor status: untyped + attr_accessor reason_phrase: untyped + attr_accessor response_body: untyped + + alias body request_body + + def []: (untyped key) -> untyped + def []=: (untyped key, untyped value) -> untyped + end +end diff --git a/.gem_rbs_collection/faraday/2.7/manifest.yaml b/.gem_rbs_collection/faraday/2.7/manifest.yaml new file mode 100644 index 00000000..416a7d5d --- /dev/null +++ b/.gem_rbs_collection/faraday/2.7/manifest.yaml @@ -0,0 +1,3 @@ +dependencies: + - name: uri + - name: forwardable diff --git a/.gem_rbs_collection/jwt/2.5/.rbs_meta.yaml b/.gem_rbs_collection/jwt/2.5/.rbs_meta.yaml new file mode 100644 index 00000000..bb8a018e --- /dev/null +++ b/.gem_rbs_collection/jwt/2.5/.rbs_meta.yaml @@ -0,0 +1,9 @@ +--- +name: jwt +version: '2.5' +source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems diff --git a/.gem_rbs_collection/jwt/2.5/jwt.rbs b/.gem_rbs_collection/jwt/2.5/jwt.rbs new file mode 100644 index 00000000..a635c717 --- /dev/null +++ b/.gem_rbs_collection/jwt/2.5/jwt.rbs @@ -0,0 +1,48 @@ +module JWT + interface _Algo + def alg: () -> ::String + def sign: (data: ::String, signing_key: untyped) -> ::String + def valid_alg?: (String alg_to_validate) -> boolish + def verify: (data: untyped, signature: ::String, verification_key: untyped) -> boolish + end + + def self?.encode: (untyped payload, untyped key, ?::String | _Algo algorithm, ?::Hash[::String | ::Symbol, untyped] header_fields) -> ::String + + def self?.decode: (String jwt, ?untyped? key, ?boolish verify, ?::Hash[Symbol, untyped] options) ?{ (Hash[::String, untyped] header, ?untyped payload) -> untyped } -> [untyped, Hash[::String, untyped]] + + + class EncodeError < StandardError + end + class DecodeError < StandardError + end + class RequiredDependencyError < StandardError + end + + class VerificationError < DecodeError + end + class ExpiredSignature < DecodeError + end + class IncorrectAlgorithm < DecodeError + end + class ImmatureSignature < DecodeError + end + class InvalidIssuerError < DecodeError + end + class UnsupportedEcdsaCurve < IncorrectAlgorithm + end + class InvalidIatError < DecodeError + end + class InvalidAudError < DecodeError + end + class InvalidSubError < DecodeError + end + class InvalidJtiError < DecodeError + end + class InvalidPayload < DecodeError + end + class MissingRequiredClaim < DecodeError + end + + class JWKError < DecodeError + end +end diff --git a/.gem_rbs_collection/logger/1.7/.rbs_meta.yaml b/.gem_rbs_collection/logger/1.7/.rbs_meta.yaml new file mode 100644 index 00000000..818dab0a --- /dev/null +++ b/.gem_rbs_collection/logger/1.7/.rbs_meta.yaml @@ -0,0 +1,9 @@ +--- +name: logger +version: '1.7' +source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems diff --git a/.gem_rbs_collection/logger/1.7/formatter.rbs b/.gem_rbs_collection/logger/1.7/formatter.rbs new file mode 100644 index 00000000..294f4c40 --- /dev/null +++ b/.gem_rbs_collection/logger/1.7/formatter.rbs @@ -0,0 +1,45 @@ +%a{annotate:rdoc:skip} +class Logger + # + # Default formatter for log messages. + # + class Formatter + attr_accessor datetime_format: String? + + # + # + def call: (String severity, Time time, untyped progname, untyped msg) -> String + + private + + # + # + def format_datetime: (Time time) -> untyped + + # + # + def initialize: () -> void + + # + # + def msg2str: (String | Exception | untyped msg) -> String + end + + interface _Formatter + def call: (String severity, Time time, untyped progname, untyped msg) -> _ToS + end +end + +Logger::Formatter::Format: String diff --git a/.gem_rbs_collection/logger/1.7/log_device.rbs b/.gem_rbs_collection/logger/1.7/log_device.rbs new file mode 100644 index 00000000..20e33ca2 --- /dev/null +++ b/.gem_rbs_collection/logger/1.7/log_device.rbs @@ -0,0 +1,100 @@ +%a{annotate:rdoc:skip} +class Logger + # + # Device used for logging messages. + # + class LogDevice + include MonitorMixin + + include Period + + attr_reader dev: _WriteCloser + attr_reader filename: String? + + # + # + def close: () -> nil + + # + # + def reopen: (?logdev log) -> self + + # + # + def write: (untyped message) -> untyped + + private + + # + # + def add_log_header: (IO file) -> untyped + + # + # + def check_shift_log: () -> untyped + + # + # + def create_logfile: (String filename) -> File + + # + # + def initialize: (?untyped logdev, ?binmode: boolish, ?shift_period_suffix: String, ?shift_size: Integer, ?shift_age: Numeric | String) -> void + + # + # + def lock_shift_log: () { () -> untyped } -> untyped + + # + # + def open_logfile: (String filename) -> File + + # + # + def set_dev: (logdev log) -> untyped + + # + # + def shift_log_age: () -> true + + # + # + def shift_log_period: (Time period_end) -> true + end +end diff --git a/.gem_rbs_collection/logger/1.7/logger.rbs b/.gem_rbs_collection/logger/1.7/logger.rbs new file mode 100644 index 00000000..82228660 --- /dev/null +++ b/.gem_rbs_collection/logger/1.7/logger.rbs @@ -0,0 +1,796 @@ +# +# Class Logger provides a simple but sophisticated logging utility that you can +# use to create one or more [event +# logs](https://en.wikipedia.org/wiki/Logging_(software)#Event_logs) for your +# program. Each such log contains a chronological sequence of entries that +# provides a record of the program's activities. +# +# ## About the Examples +# +# All examples on this page assume that Logger has been required: +# +# require 'logger' +# +# ## Synopsis +# +# Create a log with Logger.new: +# +# # Single log file. +# logger = Logger.new('t.log') +# # Size-based rotated logging: 3 10-megabyte files. +# logger = Logger.new('t.log', 3, 10485760) +# # Period-based rotated logging: daily (also allowed: 'weekly', 'monthly'). +# logger = Logger.new('t.log', 'daily') +# # Log to an IO stream. +# logger = Logger.new($stdout) +# +# Add entries (level, message) with Logger#add: +# +# logger.add(Logger::DEBUG, 'Maximal debugging info') +# logger.add(Logger::INFO, 'Non-error information') +# logger.add(Logger::WARN, 'Non-error warning') +# logger.add(Logger::ERROR, 'Non-fatal error') +# logger.add(Logger::FATAL, 'Fatal error') +# logger.add(Logger::UNKNOWN, 'Most severe') +# +# Close the log with Logger#close: +# +# logger.close +# +# ## Entries +# +# You can add entries with method Logger#add: +# +# logger.add(Logger::DEBUG, 'Maximal debugging info') +# logger.add(Logger::INFO, 'Non-error information') +# logger.add(Logger::WARN, 'Non-error warning') +# logger.add(Logger::ERROR, 'Non-fatal error') +# logger.add(Logger::FATAL, 'Fatal error') +# logger.add(Logger::UNKNOWN, 'Most severe') +# +# These shorthand methods also add entries: +# +# logger.debug('Maximal debugging info') +# logger.info('Non-error information') +# logger.warn('Non-error warning') +# logger.error('Non-fatal error') +# logger.fatal('Fatal error') +# logger.unknown('Most severe') +# +# When you call any of these methods, the entry may or may not be written to the +# log, depending on the entry's severity and on the log level; see [Log +# Level](rdoc-ref:Logger@Log+Level) +# +# An entry always has: +# +# * A severity (the required argument to #add). +# * An automatically created timestamp. +# +# And may also have: +# +# * A message. +# * A program name. +# +# Example: +# +# logger = Logger.new($stdout) +# logger.add(Logger::INFO, 'My message.', 'mung') +# # => I, [2022-05-07T17:21:46.536234 #20536] INFO -- mung: My message. +# +# The default format for an entry is: +# +# "%s, [%s #%d] %5s -- %s: %s\n" +# +# where the values to be formatted are: +# +# * Severity (one letter). +# * Timestamp. +# * Process id. +# * Severity (word). +# * Program name. +# * Message. +# +# You can use a different entry format by: +# +# * Setting a custom format proc (affects following entries); see +# [formatter=](Logger.html#attribute-i-formatter). +# * Calling any of the methods above with a block (affects only the one +# entry). Doing so can have two benefits: +# +# * Context: the block can evaluate the entire program context and create +# a context-dependent message. +# * Performance: the block is not evaluated unless the log level permits +# the entry actually to be written: +# +# logger.error { my_slow_message_generator } +# +# Contrast this with the string form, where the string is always +# evaluated, regardless of the log level: +# +# logger.error("#{my_slow_message_generator}") +# +# ### Severity +# +# The severity of a log entry has two effects: +# +# * Determines whether the entry is selected for inclusion in the log; see +# [Log Level](rdoc-ref:Logger@Log+Level). +# * Indicates to any log reader (whether a person or a program) the relative +# importance of the entry. +# +# ### Timestamp +# +# The timestamp for a log entry is generated automatically when the entry is +# created. +# +# The logged timestamp is formatted by method +# [Time#strftime](rdoc-ref:Time#strftime) using this format string: +# +# '%Y-%m-%dT%H:%M:%S.%6N' +# +# Example: +# +# logger = Logger.new($stdout) +# logger.add(Logger::INFO) +# # => I, [2022-05-07T17:04:32.318331 #20536] INFO -- : nil +# +# You can set a different format using method #datetime_format=. +# +# ### Message +# +# The message is an optional argument to an entry method: +# +# logger = Logger.new($stdout) +# logger.add(Logger::INFO, 'My message') +# # => I, [2022-05-07T18:15:37.647581 #20536] INFO -- : My message +# +# For the default entry formatter, `Logger::Formatter`, the message object may +# be: +# +# * A string: used as-is. +# * An Exception: `message.message` is used. +# * Anything else: `message.inspect` is used. +# +# **Note**: Logger::Formatter does not escape or sanitize the message passed to +# it. Developers should be aware that malicious data (user input) may be in the +# message, and should explicitly escape untrusted data. +# +# You can use a custom formatter to escape message data; see the example at +# [formatter=](Logger.html#attribute-i-formatter). +# +# ### Program Name +# +# The program name is an optional argument to an entry method: +# +# logger = Logger.new($stdout) +# logger.add(Logger::INFO, 'My message', 'mung') +# # => I, [2022-05-07T18:17:38.084716 #20536] INFO -- mung: My message +# +# The default program name for a new logger may be set in the call to Logger.new +# via optional keyword argument `progname`: +# +# logger = Logger.new('t.log', progname: 'mung') +# +# The default program name for an existing logger may be set by a call to method +# #progname=: +# +# logger.progname = 'mung' +# +# The current program name may be retrieved with method +# [progname](Logger.html#attribute-i-progname): +# +# logger.progname # => "mung" +# +# ## Log Level +# +# The log level setting determines whether an entry is actually written to the +# log, based on the entry's severity. +# +# These are the defined severities (least severe to most severe): +# +# logger = Logger.new($stdout) +# logger.add(Logger::DEBUG, 'Maximal debugging info') +# # => D, [2022-05-07T17:57:41.776220 #20536] DEBUG -- : Maximal debugging info +# logger.add(Logger::INFO, 'Non-error information') +# # => I, [2022-05-07T17:59:14.349167 #20536] INFO -- : Non-error information +# logger.add(Logger::WARN, 'Non-error warning') +# # => W, [2022-05-07T18:00:45.337538 #20536] WARN -- : Non-error warning +# logger.add(Logger::ERROR, 'Non-fatal error') +# # => E, [2022-05-07T18:02:41.592912 #20536] ERROR -- : Non-fatal error +# logger.add(Logger::FATAL, 'Fatal error') +# # => F, [2022-05-07T18:05:24.703931 #20536] FATAL -- : Fatal error +# logger.add(Logger::UNKNOWN, 'Most severe') +# # => A, [2022-05-07T18:07:54.657491 #20536] ANY -- : Most severe +# +# The default initial level setting is Logger::DEBUG, the lowest level, which +# means that all entries are to be written, regardless of severity: +# +# logger = Logger.new($stdout) +# logger.level # => 0 +# logger.add(0, "My message") +# # => D, [2022-05-11T15:10:59.773668 #20536] DEBUG -- : My message +# +# You can specify a different setting in a new logger using keyword argument +# `level` with an appropriate value: +# +# logger = Logger.new($stdout, level: Logger::ERROR) +# logger = Logger.new($stdout, level: 'error') +# logger = Logger.new($stdout, level: :error) +# logger.level # => 3 +# +# With this level, entries with severity Logger::ERROR and higher are written, +# while those with lower severities are not written: +# +# logger = Logger.new($stdout, level: Logger::ERROR) +# logger.add(3) +# # => E, [2022-05-11T15:17:20.933362 #20536] ERROR -- : nil +# logger.add(2) # Silent. +# +# You can set the log level for an existing logger with method #level=: +# +# logger.level = Logger::ERROR +# +# These shorthand methods also set the level: +# +# logger.debug! # => 0 +# logger.info! # => 1 +# logger.warn! # => 2 +# logger.error! # => 3 +# logger.fatal! # => 4 +# +# You can retrieve the log level with method #level. +# +# logger.level = Logger::ERROR +# logger.level # => 3 +# +# These methods return whether a given level is to be written: +# +# logger.level = Logger::ERROR +# logger.debug? # => false +# logger.info? # => false +# logger.warn? # => false +# logger.error? # => true +# logger.fatal? # => true +# +# ## Log File Rotation +# +# By default, a log file is a single file that grows indefinitely (until +# explicitly closed); there is no file rotation. +# +# To keep log files to a manageable size, you can use *log* *file* *rotation*, +# which uses multiple log files: +# +# * Each log file has entries for a non-overlapping time interval. +# * Only the most recent log file is open and active; the others are closed +# and inactive. +# +# ### Size-Based Rotation +# +# For size-based log file rotation, call Logger.new with: +# +# * Argument `logdev` as a file path. +# * Argument `shift_age` with a positive integer: the number of log files to +# be in the rotation. +# * Argument `shift_size` as a positive integer: the maximum size (in bytes) +# of each log file; defaults to 1048576 (1 megabyte). +# +# Examples: +# +# logger = Logger.new('t.log', 3) # Three 1-megabyte files. +# logger = Logger.new('t.log', 5, 10485760) # Five 10-megabyte files. +# +# For these examples, suppose: +# +# logger = Logger.new('t.log', 3) +# +# Logging begins in the new log file, `t.log`; the log file is "full" and ready +# for rotation when a new entry would cause its size to exceed `shift_size`. +# +# The first time `t.log` is full: +# +# * `t.log` is closed and renamed to `t.log.0`. +# * A new file `t.log` is opened. +# +# The second time `t.log` is full: +# +# * +t.log.0 is renamed as `t.log.1`. +# * `t.log` is closed and renamed to `t.log.0`. +# * A new file `t.log` is opened. +# +# Each subsequent time that `t.log` is full, the log files are rotated: +# +# * `t.log.1` is removed. +# * +t.log.0 is renamed as `t.log.1`. +# * `t.log` is closed and renamed to `t.log.0`. +# * A new file `t.log` is opened. +# +# ### Periodic Rotation +# +# For periodic rotation, call Logger.new with: +# +# * Argument `logdev` as a file path. +# * Argument `shift_age` as a string period indicator. +# +# Examples: +# +# logger = Logger.new('t.log', 'daily') # Rotate log files daily. +# logger = Logger.new('t.log', 'weekly') # Rotate log files weekly. +# logger = Logger.new('t.log', 'monthly') # Rotate log files monthly. +# +# Example: +# +# logger = Logger.new('t.log', 'daily') +# +# When the given period expires: +# +# * The base log file, `t.log` is closed and renamed with a date-based suffix +# such as `t.log.20220509`. +# * A new log file `t.log` is opened. +# * Nothing is removed. +# +# The default format for the suffix is `'%Y%m%d'`, which produces a suffix +# similar to the one above. You can set a different format using create-time +# option `shift_period_suffix`; see details and suggestions at +# [Time#strftime](rdoc-ref:Time#strftime). +# +class Logger + interface _WriteCloser + def write: (_ToS) -> untyped + + def close: () -> untyped + end + type logdev = _WriteCloser | String + + include Logger::Severity + + # + # Writes the given `msg` to the log with no formatting; returns the number of + # characters written, or `nil` if no log device exists: + # + # logger = Logger.new($stdout) + # logger << 'My message.' # => 10 + # + # Output: + # + # My message. + # + def <<: (untyped msg) -> (untyped | nil) + + # + # Creates a log entry, which may or may not be written to the log, depending on + # the entry's severity and on the log level. See [Log + # Level](rdoc-ref:Logger@Log+Level) and [Entries](rdoc-ref:Logger@Entries) for + # details. + # + # Examples: + # + # logger = Logger.new($stdout, progname: 'mung') + # logger.add(Logger::INFO) + # logger.add(Logger::ERROR, 'No good') + # logger.add(Logger::ERROR, 'No good', 'gnum') + # + # Output: + # + # I, [2022-05-12T16:25:31.469726 #36328] INFO -- mung: mung + # E, [2022-05-12T16:25:55.349414 #36328] ERROR -- mung: No good + # E, [2022-05-12T16:26:35.841134 #36328] ERROR -- gnum: No good + # + # These convenience methods have implicit severity: + # + # * #debug. + # * #info. + # * #warn. + # * #error. + # * #fatal. + # * #unknown. + # + def add: (Integer severity, ?untyped message, ?untyped progname) ?{ () -> untyped } -> true + + # + # Closes the logger; returns `nil`: + # + # logger = Logger.new('t.log') + # logger.close # => nil + # logger.info('foo') # Prints "log writing failed. closed stream" + # + # Related: Logger#reopen. + # + def close: () -> untyped + + # + # Returns the date-time format; see #datetime_format=. + # + def datetime_format: () -> String? + + # + # Sets the date-time format. + # + # Argument `datetime_format` should be either of these: + # + # * A string suitable for use as a format for method + # [Time#strftime](rdoc-ref:Time#strftime). + # * `nil`: the logger uses `'%Y-%m-%dT%H:%M:%S.%6N'`. + # + def datetime_format=: (String datetime_format) -> String + | (nil datetime_format) -> nil + + # + # Equivalent to calling #add with severity `Logger::DEBUG`. + # + def debug: (?untyped progname) ?{ () -> untyped } -> true + + # + # Sets the log level to Logger::DEBUG. See [Log + # Level](rdoc-ref:Logger@Log+Level). + # + def debug!: () -> Integer + + # + # Returns `true` if the log level allows entries with severity Logger::DEBUG to + # be written, `false` otherwise. See [Log Level](rdoc-ref:Logger@Log+Level). + # + def debug?: () -> bool + + # + # Equivalent to calling #add with severity `Logger::ERROR`. + # + def error: (?untyped progname) ?{ () -> untyped } -> true + + # + # Sets the log level to Logger::ERROR. See [Log + # Level](rdoc-ref:Logger@Log+Level). + # + def error!: () -> Integer + + # + # Returns `true` if the log level allows entries with severity Logger::ERROR to + # be written, `false` otherwise. See [Log Level](rdoc-ref:Logger@Log+Level). + # + def error?: () -> bool + + # + # Equivalent to calling #add with severity `Logger::FATAL`. + # + def fatal: (?untyped progname) ?{ () -> untyped } -> true + + # + # Sets the log level to Logger::FATAL. See [Log + # Level](rdoc-ref:Logger@Log+Level). + # + def fatal!: () -> Integer + + # + # Returns `true` if the log level allows entries with severity Logger::FATAL to + # be written, `false` otherwise. See [Log Level](rdoc-ref:Logger@Log+Level). + # + def fatal?: () -> bool + + # + # Sets or retrieves the logger entry formatter proc. + # + # When `formatter` is `nil`, the logger uses Logger::Formatter. + # + # When `formatter` is a proc, a new entry is formatted by the proc, which is + # called with four arguments: + # + # * `severity`: The severity of the entry. + # * `time`: A Time object representing the entry's timestamp. + # * `progname`: The program name for the entry. + # * `msg`: The message for the entry (string or string-convertible object). + # + # The proc should return a string containing the formatted entry. + # + # This custom formatter uses [String#dump](rdoc-ref:String#dump) to escape the + # message string: + # + # logger = Logger.new($stdout, progname: 'mung') + # original_formatter = logger.formatter || Logger::Formatter.new + # logger.formatter = proc { |severity, time, progname, msg| + # original_formatter.call(severity, time, progname, msg.dump) + # } + # logger.add(Logger::INFO, "hello \n ''") + # logger.add(Logger::INFO, "\f\x00\xff\\\"") + # + # Output: + # + # I, [2022-05-13T13:16:29.637488 #8492] INFO -- mung: "hello \n ''" + # I, [2022-05-13T13:16:29.637610 #8492] INFO -- mung: "\f\x00\xFF\\\"" + # + def formatter: () -> (_Formatter | nil) + + # + # Sets or retrieves the logger entry formatter proc. + # + # When `formatter` is `nil`, the logger uses Logger::Formatter. + # + # When `formatter` is a proc, a new entry is formatted by the proc, which is + # called with four arguments: + # + # * `severity`: The severity of the entry. + # * `time`: A Time object representing the entry's timestamp. + # * `progname`: The program name for the entry. + # * `msg`: The message for the entry (string or string-convertible object). + # + # The proc should return a string containing the formatted entry. + # + # This custom formatter uses [String#dump](rdoc-ref:String#dump) to escape the + # message string: + # + # logger = Logger.new($stdout, progname: 'mung') + # original_formatter = logger.formatter || Logger::Formatter.new + # logger.formatter = proc { |severity, time, progname, msg| + # original_formatter.call(severity, time, progname, msg.dump) + # } + # logger.add(Logger::INFO, "hello \n ''") + # logger.add(Logger::INFO, "\f\x00\xff\\\"") + # + # Output: + # + # I, [2022-05-13T13:16:29.637488 #8492] INFO -- mung: "hello \n ''" + # I, [2022-05-13T13:16:29.637610 #8492] INFO -- mung: "\f\x00\xFF\\\"" + # + def formatter=: (_Formatter) -> _Formatter + | (nil) -> nil + + # + # Equivalent to calling #add with severity `Logger::INFO`. + # + def info: (?untyped progname) ?{ () -> untyped } -> true + + # + # Sets the log level to Logger::INFO. See [Log + # Level](rdoc-ref:Logger@Log+Level). + # + def info!: () -> Integer + + # + # Returns `true` if the log level allows entries with severity Logger::INFO to + # be written, `false` otherwise. See [Log Level](rdoc-ref:Logger@Log+Level). + # + def info?: () -> bool + + # + # Logging severity threshold (e.g. `Logger::INFO`). + # + def level: () -> Integer + + # + # Sets the log level; returns `severity`. See [Log + # Level](rdoc-ref:Logger@Log+Level). + # + # Argument `severity` may be an integer, a string, or a symbol: + # + # logger.level = Logger::ERROR # => 3 + # logger.level = 3 # => 3 + # logger.level = 'error' # => "error" + # logger.level = :error # => :error + # + # Logger#sev_threshold= is an alias for Logger#level=. + # + def level=: (Integer | interned severity) -> Integer + + # + # + alias log add + + # + # Program name to include in log messages. + # + def progname: () -> untyped + + # + # Program name to include in log messages. + # + def progname=: (untyped) -> untyped + + # + # Sets the logger's output stream: + # + # * If `logdev` is `nil`, reopens the current output stream. + # * If `logdev` is a filepath, opens the indicated file for append. + # * If `logdev` is an IO stream (usually `$stdout`, `$stderr`, or an open File + # object), opens the stream for append. + # + # Example: + # + # logger = Logger.new('t.log') + # logger.add(Logger::ERROR, 'one') + # logger.close + # logger.add(Logger::ERROR, 'two') # Prints 'log writing failed. closed stream' + # logger.reopen + # logger.add(Logger::ERROR, 'three') + # logger.close + # File.readlines('t.log') + # # => + # # ["# Logfile created on 2022-05-12 14:21:19 -0500 by logger.rb/v1.5.0\n", + # # "E, [2022-05-12T14:21:27.596726 #22428] ERROR -- : one\n", + # # "E, [2022-05-12T14:23:05.847241 #22428] ERROR -- : three\n"] + # + def reopen: () -> self + | (logdev?) -> self + + # + # + alias sev_threshold level + + # + # + alias sev_threshold= level= + + # + # Equivalent to calling #add with severity `Logger::UNKNOWN`. + # + def unknown: (?untyped progname) ?{ () -> untyped } -> true + + # + # Equivalent to calling #add with severity `Logger::WARN`. + # + def warn: (?untyped progname) ?{ () -> untyped } -> true + + # + # Sets the log level to Logger::WARN. See [Log + # Level](rdoc-ref:Logger@Log+Level). + # + def warn!: () -> Integer + + # + # Returns `true` if the log level allows entries with severity Logger::WARN to + # be written, `false` otherwise. See [Log Level](rdoc-ref:Logger@Log+Level). + # + def warn?: () -> bool + + private + + # + # + def format_message: (String severity, Time datetime, untyped progname, untyped msg) -> _ToS + + # + # + def format_severity: (Integer severity) -> String + + # + # With the single argument `logdev`, returns a new logger with all default + # options: + # + # Logger.new('t.log') # => # + # + # Argument `logdev` must be one of: + # + # * A string filepath: entries are to be written to the file at that path; if + # the file at that path exists, new entries are appended. + # * An IO stream (typically +$stdout+, +$stderr+. or an open file): entries + # are to be written to the given stream. + # * `nil` or `File::NULL`: no entries are to be written. + # + # Examples: + # + # Logger.new('t.log') + # Logger.new($stdout) + # + # The keyword options are: + # + # * `level`: sets the log level; default value is Logger::DEBUG. See [Log + # Level](rdoc-ref:Logger@Log+Level): + # + # Logger.new('t.log', level: Logger::ERROR) + # + # * `progname`: sets the default program name; default is `nil`. See [Program + # Name](rdoc-ref:Logger@Program+Name): + # + # Logger.new('t.log', progname: 'mung') + # + # * `formatter`: sets the entry formatter; default is `nil`. See + # [formatter=](Logger.html#attribute-i-formatter). + # * `datetime_format`: sets the format for entry timestamp; default is `nil`. + # See #datetime_format=. + # * `binmode`: sets whether the logger writes in binary mode; default is + # `false`. + # * `shift_period_suffix`: sets the format for the filename suffix for + # periodic log file rotation; default is `'%Y%m%d'`. See [Periodic + # Rotation](rdoc-ref:Logger@Periodic+Rotation). + # * `reraise_write_errors`: An array of exception classes, which will be + # reraised if there is an error when writing to the log device. The default + # is to swallow all exceptions raised. + # + def initialize: (logdev? logdev, ?Numeric | String shift_age, ?Integer shift_size, ?shift_period_suffix: String, ?binmode: boolish, ?datetime_format: String, ?formatter: _Formatter, ?progname: String, ?level: Integer | interned) -> void +end + +Logger::ProgName: String + +# +# Severity label for logging (max 5 chars). +# +Logger::SEV_LABEL: Array[String] + +Logger::VERSION: String diff --git a/.gem_rbs_collection/logger/1.7/manifest.yaml b/.gem_rbs_collection/logger/1.7/manifest.yaml new file mode 100644 index 00000000..9a570c44 --- /dev/null +++ b/.gem_rbs_collection/logger/1.7/manifest.yaml @@ -0,0 +1,2 @@ +dependencies: + - name: monitor diff --git a/.gem_rbs_collection/logger/1.7/period.rbs b/.gem_rbs_collection/logger/1.7/period.rbs new file mode 100644 index 00000000..bb06eed6 --- /dev/null +++ b/.gem_rbs_collection/logger/1.7/period.rbs @@ -0,0 +1,17 @@ +module Logger::Period + # + # + def self?.next_rotate_time: (Time now, String shift_age) -> untyped + + # + # + def self?.previous_period_end: (Time now, String shift_age) -> untyped + + SiD: Integer +end diff --git a/.gem_rbs_collection/logger/1.7/severity.rbs b/.gem_rbs_collection/logger/1.7/severity.rbs new file mode 100644 index 00000000..200a4768 --- /dev/null +++ b/.gem_rbs_collection/logger/1.7/severity.rbs @@ -0,0 +1,34 @@ +# +# Logging severity. +# +module Logger::Severity + # + # Low-level information, mostly for developers. + # + DEBUG: 0 + + # + # Generic (useful) information about system operation. + # + INFO: 1 + + # + # A warning. + # + WARN: 2 + + # + # A handleable error condition. + # + ERROR: 3 + + # + # An unhandleable error that results in a program crash. + # + FATAL: 4 + + # + # An unknown message that should always be logged. + # + UNKNOWN: 5 +end diff --git a/.gem_rbs_collection/minitest/5.25/.rbs_meta.yaml b/.gem_rbs_collection/minitest/5.25/.rbs_meta.yaml new file mode 100644 index 00000000..190389f3 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/.rbs_meta.yaml @@ -0,0 +1,9 @@ +--- +name: minitest +version: '5.25' +source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems diff --git a/.gem_rbs_collection/minitest/5.25/minitest.rbs b/.gem_rbs_collection/minitest/5.25/minitest.rbs new file mode 100644 index 00000000..e0997a0a --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest.rbs @@ -0,0 +1,115 @@ +# +# The top-level namespace for Minitest. Also the location of the main runtime. +# See `Minitest.run` for more information. +# +module Minitest + @@installed_at_exit: untyped + + @@after_run: untyped + + self.@extensions: untyped + + def self.cattr_accessor: (untyped name) -> untyped + + # + # Registers Minitest to run at process exit + # + def self.autorun: () -> untyped + + # + # A simple hook allowing you to run a block of code after everything is done + # running. Eg: + # + # Minitest.after_run { p $debugging_info } + # + def self.after_run: () { (?) -> untyped } -> untyped + + # + # Register a plugin to be used. Does NOT require / load it. + # + def self.register_plugin: (untyped name_or_mod) -> nil + + def self.load_plugins: () -> (nil | untyped) + + def self.init_plugins: (untyped options) -> untyped + + def self.process_args: (?untyped args) -> untyped + + # + # This is the top-level run method. Everything starts from here. It tells each + # Runnable sub-class to run, and each of those are responsible for doing + # whatever they do. + # + # The overall structure of a run looks like this: + # + # Minitest.autorun + # Minitest.run(args) + # Minitest.load_plugins + # Minitest.process_args + # Minitest.init_plugins + # Minitest.__run(reporter, options) + # Runnable.runnables.each + # runnable_klass.run(reporter, options) + # self.runnable_methods.each + # self.run_one_method(self, runnable_method, reporter) + # Minitest.run_one_method(klass, runnable_method) + # klass.new(runnable_method).run + # + def self.run: (?untyped args) -> untyped + + def self.empty_run!: (untyped options) -> untyped + + # + # Internal run method. Responsible for telling all Runnable sub-classes to run. + # + def self.__run: (untyped reporter, untyped options) -> untyped + + def self.filter_backtrace: (untyped bt) -> untyped + + def self.run_one_method: (untyped klass, untyped method_name) -> untyped + + def self.clock_time: () -> untyped + + # + # Manually load plugins by name. + # + def self.load: (*untyped names) -> untyped + + def self.plugin_pride_options: (untyped opts, untyped _options) -> untyped + + def self.plugin_pride_init: (untyped options) -> (nil | untyped) + + attr_accessor self.seed: untyped + + attr_accessor self.parallel_executor: untyped + + attr_accessor self.backtrace_filter: untyped + + attr_accessor self.reporter: untyped + + attr_accessor self.extensions: untyped + + attr_accessor self.info_signal: untyped + + attr_accessor self.allow_fork: untyped + + VERSION: String +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/abstract_reporter.rbs b/.gem_rbs_collection/minitest/5.25/minitest/abstract_reporter.rbs new file mode 100644 index 00000000..63788eb4 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/abstract_reporter.rbs @@ -0,0 +1,52 @@ +# +# Defines the API for Reporters. Subclass this and override whatever you want. +# Go nuts. +# +class Minitest::AbstractReporter + @mutex: untyped + def initialize: () -> void + + # + # Starts reporting on the run. + # + def start: () -> nil + + # + # About to start running a test. This allows a reporter to show that it is + # starting or that we are in the middle of a test run. + # + def prerecord: (untyped klass, untyped name) -> nil + + # + # Output and record the result of the test. Call + # [result#result_code](rdoc-ref:Runnable#result_code) to get the result + # character string. Stores the result of the run if the run did not pass. + # + def record: (untyped result) -> nil + + # + # Outputs the summary of the run. + # + def report: () -> nil + + # + # Did this run pass? + # + def passed?: () -> true + def synchronize: () { (?) -> untyped } -> untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/assertion.rbs b/.gem_rbs_collection/minitest/5.25/minitest/assertion.rbs new file mode 100644 index 00000000..c6bb4541 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/assertion.rbs @@ -0,0 +1,17 @@ +# +# Represents run failures. +# +class Minitest::Assertion < ::Exception + def error: () -> self + + # + # Where was this run before an assertion was raised? + # + def location: () -> untyped + def result_code: () -> untyped + def result_label: () -> "Failure" + RE: Regexp +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/assertions.rbs b/.gem_rbs_collection/minitest/5.25/minitest/assertions.rbs new file mode 100644 index 00000000..773ac42d --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/assertions.rbs @@ -0,0 +1,590 @@ +# +# Minitest Assertions. All assertion methods accept a `msg` which is printed if +# the assertion fails. +# +# Protocol: Nearly everything here boils up to `assert`, which expects to be +# able to increment an instance accessor named `assertions`. This is not +# provided by Assertions and must be provided by the thing including Assertions. +# See Minitest::Runnable for an example. +# +module Minitest::Assertions + self.@diff: untyped + + @skip: untyped + + def self.inspect: () -> "UNDEFINED" + + # + # Returns the diff command to use in #diff. Tries to intelligently figure out + # what diff to use. + # + def self.diff: () -> untyped + + # + # Set the diff command to use in #diff. + # + def self.diff=: (untyped o) -> untyped + + # + # Returns a diff between `exp` and `act`. If there is no known diff command or + # if it doesn't make sense to diff the output (single line, short output), then + # it simply returns a basic comparison between the two. + # + # See `things_to_diff` for more info. + # + def diff: (untyped exp, untyped act) -> (::String | untyped) + + # + # Returns things to diff [expect, butwas], or [nil, nil] if nothing to diff. + # + # Criterion: + # + # 1. Strings include newlines or escaped newlines, but not both. + # 2. or: String lengths are > 30 characters. + # 3. or: Strings are equal to each other (but maybe different encodings?). + # 4. and: we found a diff executable. + # + def things_to_diff: (untyped exp, untyped act) -> untyped + + # + # This returns a human-readable version of `obj`. By default #inspect is called. + # You can override this to use #pretty_inspect if you want. + # + # See Minitest::Test.make_my_diffs_pretty! + # + def mu_pp: (untyped obj) -> untyped + + # + # This returns a diff-able more human-readable version of `obj`. This differs + # from the regular mu_pp because it expands escaped newlines and makes + # hex-values (like object_ids) generic. This uses mu_pp to do the first pass and + # then cleans it up. + # + def mu_pp_for_diff: (untyped obj) -> untyped + + # + # Fails unless `test` is truthy. + # + def assert: (untyped test, ?untyped? msg) -> true + + def _synchronize: () { () -> untyped } -> untyped + + # + # Fails unless `obj` is empty. + # + def assert_empty: (untyped obj, ?untyped? msg) -> untyped + + def _where: () -> untyped + + # + # Fails unless `exp == act` printing the difference between the two, if + # possible. + # + # If there is no visible difference but the assertion fails, you should suspect + # that your #== is buggy, or your inspect output is missing crucial details. + # For nicer structural diffing, set Minitest::Test.make_my_diffs_pretty! + # + # For floats use assert_in_delta. + # + # See also: Minitest::Assertions.diff + # + def assert_equal: (untyped exp, untyped act, ?untyped? msg) -> untyped + + # + # For comparing Floats. Fails unless `exp` and `act` are within `delta` of each + # other. + # + # assert_in_delta Math::PI, (22.0 / 7.0), 0.01 + # + def assert_in_delta: (untyped exp, untyped act, ?::Float delta, ?untyped? msg) -> untyped + + # + # For comparing Floats. Fails unless `exp` and `act` have a relative error less + # than `epsilon`. + # + def assert_in_epsilon: (untyped exp, untyped act, ?::Float epsilon, ?untyped? msg) -> untyped + + # + # Fails unless `collection` includes `obj`. + # + def assert_includes: (untyped collection, untyped obj, ?untyped? msg) -> untyped + + # + # Fails unless `obj` is an instance of `cls`. + # + def assert_instance_of: (untyped cls, untyped obj, ?untyped? msg) -> untyped + + # + # Fails unless `obj` is a kind of `cls`. + # + def assert_kind_of: (untyped cls, untyped obj, ?untyped? msg) -> untyped + + # + # Fails unless `matcher` `=~` `obj`. + # + def assert_match: (untyped matcher, untyped obj, ?untyped? msg) -> untyped + + # + # Fails unless `obj` is nil + # + def assert_nil: (untyped obj, ?untyped? msg) -> untyped + + # + # For testing with binary operators. Eg: + # + # assert_operator 5, :<=, 4 + # + def assert_operator: (untyped o1, untyped op, ?untyped o2, ?untyped? msg) -> untyped + + # + # Fails if stdout or stderr do not output the expected results. Pass in nil if + # you don't care about that streams output. Pass in "" if you require it to be + # silent. Pass in a regexp if you want to pattern match. + # + # assert_output(/hey/) { method_with_output } + # + # NOTE: this uses #capture_io, not #capture_subprocess_io. + # + # See also: #assert_silent + # + def assert_output: (?untyped? stdout, ?untyped? stderr) ?{ () -> untyped } -> untyped + + # + # Fails unless `path` exists. + # + def assert_path_exists: (untyped path, ?untyped? msg) -> untyped + + # + # For testing with pattern matching (only supported with Ruby 3.0 and later) + # + # # pass + # assert_pattern { [1,2,3] => [Integer, Integer, Integer] } + # + # # fail "length mismatch (given 3, expected 1)" + # assert_pattern { [1,2,3] => [Integer] } + # + # The bare `=>` pattern will raise a NoMatchingPatternError on failure, which + # would normally be counted as a test error. This assertion rescues + # NoMatchingPatternError and generates a test failure. Any other exception will + # be raised as normal and generate a test error. + # + def assert_pattern: () ?{ () -> untyped } -> untyped + + # + # For testing with predicates. Eg: + # + # assert_predicate str, :empty? + # + # This is really meant for specs and is front-ended by assert_operator: + # + # str.must_be :empty? + # + def assert_predicate: (untyped o1, untyped op, ?untyped? msg) -> untyped + + # + # Fails unless the block raises one of `exp`. Returns the exception matched so + # you can check the message, attributes, etc. + # + # `exp` takes an optional message on the end to help explain failures and + # defaults to StandardError if no exception class is passed. Eg: + # + # assert_raises(CustomError) { method_with_custom_error } + # + # With custom error message: + # + # assert_raises(CustomError, 'This should have raised CustomError') { method_with_custom_error } + # + # Using the returned object: + # + # error = assert_raises(CustomError) do + # raise CustomError, 'This is really bad' + # end + # + # assert_equal 'This is really bad', error.message + # + def assert_raises: (*untyped exp) ?{ () -> untyped } -> untyped + + # + # Fails unless `obj` responds to `meth`. include_all defaults to false to match + # Object#respond_to? + # + def assert_respond_to: (untyped obj, untyped meth, ?untyped? msg, ?include_all: bool) -> untyped + + # + # Fails unless `exp` and `act` are #equal? + # + def assert_same: (untyped exp, untyped act, ?untyped? msg) -> untyped + + # + # `send_ary` is a receiver, message and arguments. + # + # Fails unless the call returns a true value + # + def assert_send: (untyped send_ary, ?untyped? m) -> untyped + + # + # Fails if the block outputs anything to stderr or stdout. + # + # See also: #assert_output + # + def assert_silent: () { () -> untyped } -> untyped + + # + # Fails unless the block throws `sym` + # + def assert_throws: (untyped sym, ?untyped? msg) { () -> untyped } -> untyped + + # + # Captures $stdout and $stderr into strings: + # + # out, err = capture_io do + # puts "Some info" + # warn "You did a bad thing" + # end + # + # assert_match %r%info%, out + # assert_match %r%bad%, err + # + # NOTE: For efficiency, this method uses StringIO and does not capture IO for + # subprocesses. Use #capture_subprocess_io for that. + # + def capture_io: () { () -> untyped } -> untyped + + # + # Captures $stdout and $stderr into strings, using Tempfile to ensure that + # subprocess IO is captured as well. + # + # out, err = capture_subprocess_io do + # system "echo Some info" + # system "echo You did a bad thing 1>&2" + # end + # + # assert_match %r%info%, out + # assert_match %r%bad%, err + # + # NOTE: This method is approximately 10x slower than #capture_io so only use it + # when you need to test the output of a subprocess. + # + def capture_subprocess_io: () { () -> untyped } -> untyped + + # + # Returns details for exception `e` + # + def exception_details: (untyped e, untyped msg) -> untyped + + # + # Fails after a given date (in the local time zone). This allows you to put + # time-bombs in your tests if you need to keep something around until a later + # date lest you forget about it. + # + def fail_after: (untyped y, untyped m, untyped d, untyped msg) -> (untyped | nil) + + # + # Fails with `msg`. + # + def flunk: (?untyped? msg) -> untyped + + # + # Returns a proc that will output `msg` along with the default message. + # + def message: (?untyped? msg, ?untyped? ending) { (?) -> untyped } -> untyped + + # + # used for counting assertions + # + def pass: (?untyped? _msg) -> untyped + + # + # Fails if `test` is truthy. + # + def refute: (untyped test, ?untyped? msg) -> untyped + + # + # Fails if `obj` is empty. + # + def refute_empty: (untyped obj, ?untyped? msg) -> untyped + + # + # Fails if `exp == act`. + # + # For floats use refute_in_delta. + # + def refute_equal: (untyped exp, untyped act, ?untyped? msg) -> untyped + + # + # For comparing Floats. Fails if `exp` is within `delta` of `act`. + # + # refute_in_delta Math::PI, (22.0 / 7.0) + # + def refute_in_delta: (untyped exp, untyped act, ?::Float delta, ?untyped? msg) -> untyped + + # + # For comparing Floats. Fails if `exp` and `act` have a relative error less + # than `epsilon`. + # + def refute_in_epsilon: (untyped a, untyped b, ?::Float epsilon, ?untyped? msg) -> untyped + + # + # Fails if `collection` includes `obj`. + # + def refute_includes: (untyped collection, untyped obj, ?untyped? msg) -> untyped + + # + # Fails if `obj` is an instance of `cls`. + # + def refute_instance_of: (untyped cls, untyped obj, ?untyped? msg) -> untyped + + # + # Fails if `obj` is a kind of `cls`. + # + def refute_kind_of: (untyped cls, untyped obj, ?untyped? msg) -> untyped + + # + # Fails if `matcher` `=~` `obj`. + # + def refute_match: (untyped matcher, untyped obj, ?untyped? msg) -> untyped + + # + # Fails if `obj` is nil. + # + def refute_nil: (untyped obj, ?untyped? msg) -> untyped + + # + # For testing with pattern matching (only supported with Ruby 3.0 and later) + # + # # pass + # refute_pattern { [1,2,3] => [String] } + # + # # fail "NoMatchingPatternError expected, but nothing was raised." + # refute_pattern { [1,2,3] => [Integer, Integer, Integer] } + # + # This assertion expects a NoMatchingPatternError exception, and will fail if + # none is raised. Any other exceptions will be raised as normal and generate a + # test error. + # + def refute_pattern: () ?{ () -> untyped } -> untyped + + # + # Fails if `o1` is not `op` `o2`. Eg: + # + # refute_operator 1, :>, 2 #=> pass + # refute_operator 1, :<, 2 #=> fail + # + def refute_operator: (untyped o1, untyped op, ?untyped o2, ?untyped? msg) -> untyped + + # + # Fails if `path` exists. + # + def refute_path_exists: (untyped path, ?untyped? msg) -> untyped + + # + # For testing with predicates. + # + # refute_predicate str, :empty? + # + # This is really meant for specs and is front-ended by refute_operator: + # + # str.wont_be :empty? + # + def refute_predicate: (untyped o1, untyped op, ?untyped? msg) -> untyped + + # + # Fails if `obj` responds to the message `meth`. include_all defaults to false + # to match Object#respond_to? + # + def refute_respond_to: (untyped obj, untyped meth, ?untyped? msg, ?include_all: bool) -> untyped + + # + # Fails if `exp` is the same (by object identity) as `act`. + # + def refute_same: (untyped exp, untyped act, ?untyped? msg) -> untyped + + # + # Skips the current run. If run in verbose-mode, the skipped run gets listed at + # the end of the run but doesn't cause a failure exit code. + # + def skip: (?untyped? msg, ?untyped? _ignored) -> untyped + + # + # Skips the current run until a given date (in the local time zone). This allows + # you to put some fixes on hold until a later date, but still holds you + # accountable and prevents you from forgetting it. + # + def skip_until: (untyped y, untyped m, untyped d, untyped msg) -> untyped + + # + # Was this testcase skipped? Meant for #teardown. + # + def skipped?: () -> untyped + + # + # Assert that the mock verifies correctly. + # + def assert_mock: (untyped mock) -> untyped + + E: String + + UNDEFINED: Object +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/backtrace_filter.rbs b/.gem_rbs_collection/minitest/5.25/minitest/backtrace_filter.rbs new file mode 100644 index 00000000..e45ec252 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/backtrace_filter.rbs @@ -0,0 +1,23 @@ +# +# The standard backtrace filter for minitest. +# +# See Minitest.backtrace_filter=. +# +class Minitest::BacktraceFilter + def initialize: (?untyped regexp) -> void + + # + # Filter `bt` to something useful. Returns the whole thing if $DEBUG (ruby) or + # $MT_DEBUG (env). + # + def filter: (untyped bt) -> (::Array["No backtrace"] | untyped) + + # + # The regular expression to use to filter backtraces. Defaults to `MT_RE`. + # + attr_accessor regexp: untyped + MT_RE: Regexp +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/bench_spec.rbs b/.gem_rbs_collection/minitest/5.25/minitest/bench_spec.rbs new file mode 100644 index 00000000..8759aa71 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/bench_spec.rbs @@ -0,0 +1,102 @@ +# +# The spec version of Minitest::Benchmark. +# +class Minitest::BenchSpec < ::Minitest::Benchmark + # + # This is used to define a new benchmark method. You usually don't use this + # directly and is intended for those needing to write new performance curve fits + # (eg: you need a specific polynomial fit). + # + # See ::bench_performance_linear for an example of how to use this. + # + def self.bench: (untyped name) { (?) -> untyped } -> untyped + + # + # Specifies the ranges used for benchmarking for that class. + # + # bench_range do + # bench_exp(2, 16, 2) + # end + # + # See Minitest::Benchmark#bench_range for more details. + # + def self.bench_range: () ?{ (?) -> untyped } -> untyped + + # + # Create a benchmark that verifies that the performance is linear. + # + # describe "my class Bench" do + # bench_performance_linear "fast_algorithm", 0.9999 do |n| + # @obj.fast_algorithm(n) + # end + # end + # + def self.bench_performance_linear: (untyped name, ?::Float threshold) { (?) -> untyped } -> untyped + + # + # Create a benchmark that verifies that the performance is constant. + # + # describe "my class Bench" do + # bench_performance_constant "zoom_algorithm!" do |n| + # @obj.zoom_algorithm!(n) + # end + # end + # + def self.bench_performance_constant: (untyped name, ?::Float threshold) { (?) -> untyped } -> untyped + + # + # Create a benchmark that verifies that the performance is exponential. + # + # describe "my class Bench" do + # bench_performance_exponential "algorithm" do |n| + # @obj.algorithm(n) + # end + # end + # + def self.bench_performance_exponential: (untyped name, ?::Float threshold) { (?) -> untyped } -> untyped + + # + # Create a benchmark that verifies that the performance is logarithmic. + # + # describe "my class Bench" do + # bench_performance_logarithmic "algorithm" do |n| + # @obj.algorithm(n) + # end + # end + # + def self.bench_performance_logarithmic: (untyped name, ?::Float threshold) { (?) -> untyped } -> untyped + + # + # Create a benchmark that verifies that the performance is power. + # + # describe "my class Bench" do + # bench_performance_power "algorithm" do |n| + # @obj.algorithm(n) + # end + # end + # + def self.bench_performance_power: (untyped name, ?::Float threshold) { (?) -> untyped } -> untyped + extend Minitest::Spec::DSL + include Minitest::Spec::DSL::InstanceMethods +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/benchmark.rbs b/.gem_rbs_collection/minitest/5.25/minitest/benchmark.rbs new file mode 100644 index 00000000..9b703cb8 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/benchmark.rbs @@ -0,0 +1,259 @@ +# +# Subclass Benchmark to create your own benchmark runs. Methods starting with +# "bench_" get executed on a per-class. +# +# See Minitest::Assertions +# +class Minitest::Benchmark < ::Minitest::Test + self.@io: untyped + def self.io: () -> untyped + def io: () -> untyped + def self.run: (untyped reporter, ?::Hash[untyped, untyped] options) -> untyped + def self.runnable_methods: () -> untyped + + # + # Returns a set of ranges stepped exponentially from `min` to `max` by powers of + # `base`. Eg: + # + # bench_exp(2, 16, 2) # => [2, 4, 8, 16] + # + def self.bench_exp: (untyped min, untyped max, ?::Integer base) -> untyped + + # + # Returns a set of ranges stepped linearly from `min` to `max` by `step`. Eg: + # + # bench_linear(20, 40, 10) # => [20, 30, 40] + # + def self.bench_linear: (untyped min, untyped max, ?::Integer step) -> untyped + + # + # Specifies the ranges used for benchmarking for that class. Defaults to + # exponential growth from 1 to 10k by powers of 10. Override if you need + # different ranges for your benchmarks. + # + # See also: ::bench_exp and ::bench_linear. + # + def self.bench_range: () -> untyped + + # + # Runs the given `work`, gathering the times of each run. Range and times are + # then passed to a given `validation` proc. Outputs the benchmark name and times + # in tab-separated format, making it easy to paste into a spreadsheet for + # graphing or further analysis. + # + # Ranges are specified by ::bench_range. + # + # Eg: + # + # def bench_algorithm + # validation = proc { |x, y| ... } + # assert_performance validation do |n| + # @obj.algorithm(n) + # end + # end + # + def assert_performance: (untyped validation) { (?) -> untyped } -> untyped + + # + # Runs the given `work` and asserts that the times gathered fit to match a + # constant rate (eg, linear slope == 0) within a given `threshold`. Note: + # because we're testing for a slope of 0, R^2 is not a good determining factor + # for the fit, so the threshold is applied against the slope itself. As such, + # you probably want to tighten it from the default. + # + # See + # https://www.graphpad.com/guides/prism/8/curve-fitting/reg_intepretingnonlinr2. + # htm for more details. + # + # Fit is calculated by #fit_linear. + # + # Ranges are specified by ::bench_range. + # + # Eg: + # + # def bench_algorithm + # assert_performance_constant 0.9999 do |n| + # @obj.algorithm(n) + # end + # end + # + def assert_performance_constant: (?::Float threshold) { (?) -> untyped } -> untyped + + # + # Runs the given `work` and asserts that the times gathered fit to match a + # exponential curve within a given error `threshold`. + # + # Fit is calculated by #fit_exponential. + # + # Ranges are specified by ::bench_range. + # + # Eg: + # + # def bench_algorithm + # assert_performance_exponential 0.9999 do |n| + # @obj.algorithm(n) + # end + # end + # + def assert_performance_exponential: (?::Float threshold) { (?) -> untyped } -> untyped + + # + # Runs the given `work` and asserts that the times gathered fit to match a + # logarithmic curve within a given error `threshold`. + # + # Fit is calculated by #fit_logarithmic. + # + # Ranges are specified by ::bench_range. + # + # Eg: + # + # def bench_algorithm + # assert_performance_logarithmic 0.9999 do |n| + # @obj.algorithm(n) + # end + # end + # + def assert_performance_logarithmic: (?::Float threshold) { (?) -> untyped } -> untyped + + # + # Runs the given `work` and asserts that the times gathered fit to match a + # straight line within a given error `threshold`. + # + # Fit is calculated by #fit_linear. + # + # Ranges are specified by ::bench_range. + # + # Eg: + # + # def bench_algorithm + # assert_performance_linear 0.9999 do |n| + # @obj.algorithm(n) + # end + # end + # + def assert_performance_linear: (?::Float threshold) { (?) -> untyped } -> untyped + + # + # Runs the given `work` and asserts that the times gathered curve fit to match a + # power curve within a given error `threshold`. + # + # Fit is calculated by #fit_power. + # + # Ranges are specified by ::bench_range. + # + # Eg: + # + # def bench_algorithm + # assert_performance_power 0.9999 do |x| + # @obj.algorithm + # end + # end + # + def assert_performance_power: (?::Float threshold) { (?) -> untyped } -> untyped + + # + # Takes an array of x/y pairs and calculates the general R^2 value. + # + # See: https://en.wikipedia.org/wiki/Coefficient_of_determination + # + def fit_error: (untyped xys) { (untyped) -> untyped } -> untyped + + # + # To fit a functional form: y = ae^(bx). + # + # Takes x and y values and returns [a, b, r^2]. + # + # See: https://mathworld.wolfram.com/LeastSquaresFittingExponential.html + # + def fit_exponential: (untyped xs, untyped ys) -> ::Array[untyped] + + # + # To fit a functional form: y = a + b*ln(x). + # + # Takes x and y values and returns [a, b, r^2]. + # + # See: https://mathworld.wolfram.com/LeastSquaresFittingLogarithmic.html + # + def fit_logarithmic: (untyped xs, untyped ys) -> ::Array[untyped] + + # + # Fits the functional form: a + bx. + # + # Takes x and y values and returns [a, b, r^2]. + # + # See: https://mathworld.wolfram.com/LeastSquaresFitting.html + # + def fit_linear: (untyped xs, untyped ys) -> ::Array[untyped] + + # + # To fit a functional form: y = ax^b. + # + # Takes x and y values and returns [a, b, r^2]. + # + # See: https://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html + # + def fit_power: (untyped xs, untyped ys) -> ::Array[untyped] + + # + # Enumerates over `enum` mapping `block` if given, returning the sum of the + # result. Eg: + # + # sigma([1, 2, 3]) # => 1 + 2 + 3 => 6 + # sigma([1, 2, 3]) { |n| n ** 2 } # => 1 + 4 + 9 => 14 + # + def sigma: (untyped enum) ?{ (?) -> untyped } -> untyped + + # + # Returns a proc that calls the specified fit method and asserts that the error + # is within a tolerable threshold. + # + def validation_for_fit: (untyped msg, untyped threshold) -> untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/composite_reporter.rbs b/.gem_rbs_collection/minitest/5.25/minitest/composite_reporter.rbs new file mode 100644 index 00000000..1ccdf8ef --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/composite_reporter.rbs @@ -0,0 +1,25 @@ +# +# Dispatch to multiple reporters as one. +# +class Minitest::CompositeReporter < ::Minitest::AbstractReporter + def initialize: (*untyped reporters) -> void + def io: () -> untyped + + # + # Add another reporter to the mix. + # + def <<: (untyped reporter) -> untyped + def passed?: () -> untyped + def start: () -> untyped + def prerecord: (untyped klass, untyped name) -> untyped + def record: (untyped result) -> untyped + def report: () -> untyped + + # + # The list of reporters to dispatch to. + # + attr_accessor reporters: untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/compress.rbs b/.gem_rbs_collection/minitest/5.25/minitest/compress.rbs new file mode 100644 index 00000000..7f213303 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/compress.rbs @@ -0,0 +1,13 @@ +# +# Compresses backtraces. +# +module Minitest::Compress + # + # Takes a backtrace (array of strings) and compresses repeating cycles in it to + # make it more readable. + # + def compress: (untyped orig) -> untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/error_on_warning.rbs b/.gem_rbs_collection/minitest/5.25/minitest/error_on_warning.rbs new file mode 100644 index 00000000..7abfdeed --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/error_on_warning.rbs @@ -0,0 +1,3 @@ +module Minitest::ErrorOnWarning + def warn: (untyped message, ?category: untyped?) -> untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/expectation.rbs b/.gem_rbs_collection/minitest/5.25/minitest/expectation.rbs new file mode 100644 index 00000000..14394214 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/expectation.rbs @@ -0,0 +1,2 @@ +class Minitest::Expectation < ::Struct[untyped] +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/expectations.rbs b/.gem_rbs_collection/minitest/5.25/minitest/expectations.rbs new file mode 100644 index 00000000..8493c3ef --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/expectations.rbs @@ -0,0 +1,21 @@ +# +# It's where you hide your "assertions". +# +# Please note, because of the way that expectations are implemented, all +# expectations (eg must_equal) are dependent upon a thread local variable +# `:current_spec`. If your specs rely on mixing threads into the specs +# themselves, you're better off using assertions or the new _(value) wrapper. +# For example: +# +# it "should still work in threads" do +# my_threaded_thingy do +# (1+1).must_equal 2 # bad +# assert_equal 2, 1+1 # good +# _(1 + 1).must_equal 2 # good +# value(1 + 1).must_equal 2 # good, also #expect +# _ { 1 + "1" }.must_raise TypeError # good +# end +# end +# +module Minitest::Expectations +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/guard.rbs b/.gem_rbs_collection/minitest/5.25/minitest/guard.rbs new file mode 100644 index 00000000..7a617d20 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/guard.rbs @@ -0,0 +1,64 @@ +# +# Provides a simple set of guards that you can use in your tests to skip +# execution if it is not applicable. These methods are mixed into Test as both +# instance and class methods so you can use them inside or outside of the test +# methods. +# +# def test_something_for_mri +# skip "bug 1234" if jruby? +# # ... +# end +# +# if windows? then +# # ... lots of test methods ... +# end +# +module Minitest::Guard + # + # Is this running on jruby? + # + def jruby?: (?untyped platform) -> untyped + + # + # Is this running on maglev? + # + def maglev?: (?untyped platform) -> untyped + + # + # Is this running on mri? + # + def mri?: (?untyped platform) -> untyped + + # + # Is this running on macOS? + # + def osx?: (?untyped platform) -> untyped + + # + # Is this running on rubinius? + # + def rubinius?: (?untyped platform) -> untyped + + # + # Is this running on windows? + # + def windows?: (?untyped platform) -> untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/mock.rbs b/.gem_rbs_collection/minitest/5.25/minitest/mock.rbs new file mode 100644 index 00000000..41de6352 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/mock.rbs @@ -0,0 +1,64 @@ +# +# A simple and clean mock object framework. +# +# All mock objects are an instance of Mock +# +class Minitest::Mock + @@KW_WARNED: untyped + @delegator: untyped + @expected_calls: untyped + @actual_calls: untyped + alias __respond_to? respond_to? + def initialize: (?untyped? delegator) -> void + + # + # Expect that method `name` is called, optionally with `args` (and `kwargs` or a + # `blk`), and returns `retval`. + # + # @mock.expect(:meaning_of_life, 42) + # @mock.meaning_of_life # => 42 + # + # @mock.expect(:do_something_with, true, [some_obj, true]) + # @mock.do_something_with(some_obj, true) # => true + # + # @mock.expect(:do_something_else, true) do |a1, a2| + # a1 == "buggs" && a2 == :bunny + # end + # + # `args` is compared to the expected args using case equality (ie, the '===' + # operator), allowing for less specific expectations. + # + # @mock.expect(:uses_any_string, true, [String]) + # @mock.uses_any_string("foo") # => true + # @mock.verify # => true + # + # @mock.expect(:uses_one_string, true, ["foo"]) + # @mock.uses_one_string("bar") # => raises MockExpectationError + # + # If a method will be called multiple times, specify a new expect for each one. + # They will be used in the order you define them. + # + # @mock.expect(:ordinal_increment, 'first') + # @mock.expect(:ordinal_increment, 'second') + # + # @mock.ordinal_increment # => 'first' + # @mock.ordinal_increment # => 'second' + # @mock.ordinal_increment # => raises MockExpectationError "No more expects available for :ordinal_increment" + # + def expect: (untyped name, untyped retval, ?untyped args, **untyped kwargs) ?{ (?) -> untyped } -> self + def __call: (untyped name, untyped data) -> untyped + + # + # Verify that all methods were called as expected. Raises `MockExpectationError` + # if the mock object was not called as expected. + # + def verify: () -> true + def method_missing: (untyped sym, *untyped args, **untyped kwargs) { (?) -> untyped } -> untyped + def respond_to?: (untyped sym, ?bool include_private) -> (true | untyped) +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/parallel.rbs b/.gem_rbs_collection/minitest/5.25/minitest/parallel.rbs new file mode 100644 index 00000000..2a09825b --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/parallel.rbs @@ -0,0 +1,2 @@ +module Minitest::Parallel +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/parallel/executor.rbs b/.gem_rbs_collection/minitest/5.25/minitest/parallel/executor.rbs new file mode 100644 index 00000000..c0e39248 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/parallel/executor.rbs @@ -0,0 +1,46 @@ +# +# The engine used to run multiple tests in parallel. +# +class Minitest::Parallel::Executor + @size: untyped + @queue: untyped + @pool: untyped + + # + # Create a parallel test executor of with `size` workers. + # + def initialize: (untyped size) -> void + + # + # Start the executor + # + def start: () -> untyped + + # + # Add a job to the queue + # + def <<: (untyped work) -> untyped + + # + # Shuts down the pool of workers by signalling them to quit and waiting for them + # all to finish what they're currently working on. + # + def shutdown: () -> untyped + + # + # The size of the pool of workers. + # + attr_reader size: untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/parallel/test.rbs b/.gem_rbs_collection/minitest/5.25/minitest/parallel/test.rbs new file mode 100644 index 00000000..b95ac3f8 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/parallel/test.rbs @@ -0,0 +1,3 @@ +module Minitest::Parallel::Test + def _synchronize: () { () -> untyped } -> untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/parallel/test/class_methods.rbs b/.gem_rbs_collection/minitest/5.25/minitest/parallel/test/class_methods.rbs new file mode 100644 index 00000000..ddf3cdb9 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/parallel/test/class_methods.rbs @@ -0,0 +1,5 @@ +module Minitest::Parallel::Test::ClassMethods + def run_one_method: (untyped klass, untyped method_name, untyped reporter) -> untyped + + def test_order: () -> :parallel +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/pride_io.rbs b/.gem_rbs_collection/minitest/5.25/minitest/pride_io.rbs new file mode 100644 index 00000000..e67e2805 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/pride_io.rbs @@ -0,0 +1,62 @@ +# +# Show your testing pride! +# +class Minitest::PrideIO + self.@pride: untyped + @io: untyped + # stolen from /System/Library/Perl/5.10.0/Term/ANSIColor.pm + # also reference https://en.wikipedia.org/wiki/ANSI_escape_code + @colors: untyped + @size: untyped + @index: untyped + + # + # Activate the pride plugin. Called from both -p option and minitest/pride + # + def self.pride!: () -> untyped + + # + # Are we showing our testing pride? + # + def self.pride?: () -> untyped + def initialize: (untyped io) -> void + + # + # Wrap print to colorize the output. + # + def print: (untyped o) -> untyped + def puts: (*untyped o) -> untyped + + # + # Color a string. + # + def pride: (untyped string) -> ::String + def method_missing: (untyped msg, *untyped args) -> untyped + + # + # The IO we're going to pipe through. + # + attr_reader io: untyped + + # + # Start an escape sequence + # + ESC: String + + # + # End the escape sequence + # + NND: String +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/pride_lol.rbs b/.gem_rbs_collection/minitest/5.25/minitest/pride_lol.rbs new file mode 100644 index 00000000..f62ee14d --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/pride_lol.rbs @@ -0,0 +1,19 @@ +# +# If you thought the PrideIO was colorful... +# +# (Inspired by lolcat, but with clean math) +# +class Minitest::PrideLOL < ::Minitest::PrideIO + @colors: untyped + @index: untyped + def initialize: (untyped io) -> void + + # + # Make the string even more colorful. Damnit. + # + def pride: (untyped string) -> ::String + PI_3: Float +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/progress_reporter.rbs b/.gem_rbs_collection/minitest/5.25/minitest/progress_reporter.rbs new file mode 100644 index 00000000..2cc89ae8 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/progress_reporter.rbs @@ -0,0 +1,11 @@ +# +# A very simple reporter that prints the "dots" during the run. +# +# This is added to the top-level CompositeReporter at the start of the run. If +# you want to change the output of minitest via a plugin, pull this out of the +# composite and replace it with your own. +# +class Minitest::ProgressReporter < ::Minitest::Reporter + def prerecord: (untyped klass, untyped name) -> (nil | untyped) + def record: (untyped result) -> untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/reportable.rbs b/.gem_rbs_collection/minitest/5.25/minitest/reportable.rbs new file mode 100644 index 00000000..358eac35 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/reportable.rbs @@ -0,0 +1,53 @@ +# +# Shared code for anything that can get passed to a Reporter. See Minitest::Test +# & Minitest::Result. +# +module Minitest::Reportable + # + # Did this run pass? + # + # Note: skipped runs are not considered passing, but they don't cause the + # process to exit non-zero. + # + def passed?: () -> untyped + + # + # The location identifier of this test. Depends on a method existing called + # class_name. + # + def location: () -> ::String + + def class_name: () -> untyped + + # + # Returns ".", "F", or "E" based on the result of the run. + # + def result_code: () -> untyped + + # + # Was this run skipped? + # + def skipped?: () -> untyped + + # + # Did this run error? + # + def error?: () -> untyped + + BASE_DIR: String +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/reporter.rbs b/.gem_rbs_collection/minitest/5.25/minitest/reporter.rbs new file mode 100644 index 00000000..451708e5 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/reporter.rbs @@ -0,0 +1,5 @@ +class Minitest::Reporter < ::Minitest::AbstractReporter + def initialize: (?untyped io, ?::Hash[untyped, untyped] options) -> void + attr_accessor io: untyped + attr_accessor options: untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/result.rbs b/.gem_rbs_collection/minitest/5.25/minitest/result.rbs new file mode 100644 index 00000000..2f26b63c --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/result.rbs @@ -0,0 +1,28 @@ +# +# This represents a test result in a clean way that can be marshalled over a +# wire. Tests can do anything they want to the test instance and can create +# conditions that cause Marshal.dump to blow up. By using Result.from(a_test) +# you can be reasonably sure that the test result can be marshalled. +# +class Minitest::Result < ::Minitest::Runnable + # + # Create a new test result from a Runnable instance. + # + def self.from: (untyped runnable) -> untyped + def class_name: () -> untyped + def to_s: () -> untyped + + # + # The class name of the test result. + # + attr_accessor klass: untyped + + # + # The location of the test method. + # + attr_accessor source_location: untyped + include Minitest::Reportable +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/runnable.rbs b/.gem_rbs_collection/minitest/5.25/minitest/runnable.rbs new file mode 100644 index 00000000..803bc231 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/runnable.rbs @@ -0,0 +1,163 @@ +# +# Represents anything "runnable", like Test, Spec, Benchmark, or whatever you +# can dream up. +# +# Subclasses of this are automatically registered and available in +# Runnable.runnables. +# +class Minitest::Runnable + @@runnables: untyped + @@marshal_dump_warned: untyped + self.@_info_handler: untyped + @NAME: untyped + @metadata: untyped + def time_it: () { () -> untyped } -> untyped + + # + # Name of the run. + # + def name: () -> untyped + + # + # Set the name of the run. + # + def name=: (untyped o) -> untyped + + # + # Returns all instance methods matching the pattern `re`. + # + def self.methods_matching: (untyped re) -> untyped + def self.reset: () -> untyped + + # + # Responsible for running all runnable methods in a given class, each in its own + # instance. Each instance is passed to the reporter to record. + # + def self.run: (untyped reporter, ?::Hash[untyped, untyped] options) -> (nil | untyped) + + # + # Runs a single method and has the reporter record the result. This was + # considered internal API but is factored out of run so that subclasses can + # specialize the running of an individual test. See + # Minitest::ParallelTest::ClassMethods for an example. + # + def self.run_one_method: (untyped klass, untyped method_name, untyped reporter) -> untyped + + # + # Defines the order to run tests (:random by default). Override this or use a + # convenience method to change it for your tests. + # + def self.test_order: () -> :random + def self.with_info_handler: (untyped reporter) { (?) -> untyped } -> untyped + def self.on_signal: (untyped name, untyped action) { () -> untyped } -> untyped + + # + # Each subclass of Runnable is responsible for overriding this method to return + # all runnable methods. See #methods_matching. + # + def self.runnable_methods: () -> untyped + + # + # Returns all subclasses of Runnable. + # + def self.runnables: () -> untyped + def marshal_dump: () -> ::Array[untyped] + def marshal_load: (untyped ary) -> untyped + def failure: () -> untyped + def initialize: (untyped name) -> void + + # + # Sets metadata, mainly used for `Result.from`. + # + def metadata: () -> untyped + + # + # Returns true if metadata exists. + # + def metadata?: () -> untyped + + # + # Runs a single method. Needs to return self. + # + def run: () -> untyped + + # + # Did this run pass? + # + # Note: skipped runs are not considered passing, but they don't cause the + # process to exit non-zero. + # + def passed?: () -> untyped + + # + # Returns a single character string to print based on the result of the run. One + # of `"."`, `"F"`, `"E"` or `"S"`. + # + def result_code: () -> untyped + + # + # Was this run skipped? See #passed? for more information. + # + def skipped?: () -> untyped + def self.inherited: (untyped klass) -> untyped + + # + # Number of assertions executed in this run. + # + attr_accessor assertions: untyped + + # + # An assertion raised during the run, if any. + # + attr_accessor failures: untyped + + # + # The time it took to run. + # + attr_accessor time: untyped + + # + # Sets metadata, mainly used for `Result.from`. + # + attr_writer metadata: untyped + SIGNALS: Hash[String, Integer] +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/skip.rbs b/.gem_rbs_collection/minitest/5.25/minitest/skip.rbs new file mode 100644 index 00000000..40f1c4df --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/skip.rbs @@ -0,0 +1,6 @@ +# +# Assertion raised when skipping a run. +# +class Minitest::Skip < ::Minitest::Assertion + def result_label: () -> "Skipped" +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/spec.rbs b/.gem_rbs_collection/minitest/5.25/minitest/spec.rbs new file mode 100644 index 00000000..51ecdf63 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/spec.rbs @@ -0,0 +1,11 @@ +# +# Minitest::Spec -- The faster, better, less-magical spec framework! +# +# For a list of expectations, see Minitest::Expectations. +# +class Minitest::Spec < ::Minitest::Test + def self.current: () -> untyped + def initialize: (untyped name) -> void + extend Minitest::Spec::DSL + include Minitest::Spec::DSL::InstanceMethods +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl.rbs b/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl.rbs new file mode 100644 index 00000000..6e6a2d4e --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl.rbs @@ -0,0 +1,129 @@ +# +# Oh look! A Minitest::Spec::DSL module! Eat your heart out DHH. +# +module Minitest::Spec::DSL + @children: untyped + + @specs: untyped + + # + # Register a new type of spec that matches the spec's description. This method + # can take either a Regexp and a spec class or a spec class and a block that + # takes the description and returns true if it matches. + # + # Eg: + # + # register_spec_type(/Controller$/, Minitest::Spec::Rails) + # + # or: + # + # register_spec_type(Minitest::Spec::RailsModel) do |desc| + # desc.superclass == ActiveRecord::Base + # end + # + def register_spec_type: (*untyped args) ?{ (?) -> untyped } -> untyped + + # + # Figure out the spec class to use based on a spec's description. Eg: + # + # spec_type("BlahController") # => Minitest::Spec::Rails + # + def spec_type: (untyped desc, *untyped additional) -> untyped + + def describe_stack: () -> untyped + + def children: () -> untyped + + def nuke_test_methods!: () -> untyped + + # + # Define a 'before' action. Inherits the way normal methods should. + # + # NOTE: `type` is ignored and is only there to make porting easier. + # + # Equivalent to Minitest::Test#setup. + # + def before: (?untyped? _type) { (?) -> untyped } -> untyped + + # + # Define an 'after' action. Inherits the way normal methods should. + # + # NOTE: `type` is ignored and is only there to make porting easier. + # + # Equivalent to Minitest::Test#teardown. + # + def after: (?untyped? _type) { (?) -> untyped } -> untyped + + # + # Define an expectation with name `desc`. Name gets morphed to a proper test + # method name. For some freakish reason, people who write specs don't like class + # inheritance, so this goes way out of its way to make sure that expectations + # aren't inherited. + # + # This is also aliased to #specify and doesn't require a `desc` arg. + # + # Hint: If you *do* want inheritance, use minitest/test. You can mix and match + # between assertions and expectations as much as you want. + # + def it: (?::String desc) ?{ (?) -> untyped } -> untyped + + # + # Essentially, define an accessor for `name` with `block`. + # + # Why use let instead of def? I honestly don't know. + # + def let: (untyped name) { (?) -> untyped } -> untyped + + # + # Another lazy man's accessor generator. Made even more lazy by setting the name + # for you to `subject`. + # + def subject: () { (?) -> untyped } -> untyped + + def create: (untyped name, untyped desc) -> untyped + + def name: () -> untyped + + def to_s: () -> untyped + + # + # + alias specify it + + def self.extended: (untyped obj) -> untyped + + attr_reader desc: untyped + + # + # Contains pairs of matchers and Spec classes to be used to calculate the + # superclass of a top-level describe. This allows for automatically customizable + # spec types. + # + # See: register_spec_type and spec_type + # + TYPES: Array[Array[Regexp | singleton(Minitest::BenchSpec)] | Array[Regexp | singleton(Minitest::Spec)]] +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl/instance_methods.rbs b/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl/instance_methods.rbs new file mode 100644 index 00000000..df2b3a48 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl/instance_methods.rbs @@ -0,0 +1,48 @@ +# +# Rdoc... why are you so dumb? +# +module Minitest::Spec::DSL::InstanceMethods + # + # Takes a value or a block and returns a value monad that has all of + # Expectations methods available to it. + # + # _(1 + 1).must_equal 2 + # + # And for blocks: + # + # _ { 1 + "1" }.must_raise TypeError + # + # This method of expectation-based testing is preferable to straight-expectation + # methods (on Object) because it stores its test context, bypassing our hacky + # use of thread-local variables. + # + # NOTE: At some point, the methods on Object will be deprecated and then + # removed. + # + # It is also aliased to #value and #expect for your aesthetic pleasure: + # + # _(1 + 1).must_equal 2 + # value(1 + 1).must_equal 2 + # expect(1 + 1).must_equal 2 + # + def _: (?untyped? value) ?{ (?) -> untyped } -> untyped + + # + # + alias value _ + + # + # + alias expect _ + + def before_setup: () -> untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/statistics_reporter.rbs b/.gem_rbs_collection/minitest/5.25/minitest/statistics_reporter.rbs new file mode 100644 index 00000000..514e08d9 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/statistics_reporter.rbs @@ -0,0 +1,81 @@ +# +# A reporter that gathers statistics about a test run. Does not do any IO +# because meant to be used as a parent class for a reporter that does. +# +# If you want to create an entirely different type of output (eg, CI, HTML, +# etc), this is the place to start. +# +# Example: +# +# class JenkinsCIReporter < StatisticsReporter +# def report +# super # Needed to calculate some statistics +# +# print " void + def passed?: () -> untyped + def start: () -> untyped + def record: (untyped result) -> untyped + + # + # Report on the tracked statistics. + # + def report: () -> untyped + + # + # Total number of assertions. + # + attr_accessor assertions: untyped + + # + # Total number of test cases. + # + attr_accessor count: untyped + + # + # An `Array` of test cases that failed or were skipped. + # + attr_accessor results: untyped + + # + # Time the test run started. If available, the monotonic clock is used and this + # is a `Float`, otherwise it's an instance of `Time`. + # + attr_accessor start_time: untyped + + # + # Test run time. If available, the monotonic clock is used and this is a + # `Float`, otherwise it's an instance of `Time`. + # + attr_accessor total_time: untyped + + # + # Total number of tests that failed. + # + attr_accessor failures: untyped + + # + # Total number of tests that erred. + # + attr_accessor errors: untyped + + # + # Total number of tests that warned. + # + attr_accessor warnings: untyped + + # + # Total number of tests that where skipped. + # + attr_accessor skips: untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/summary_reporter.rbs b/.gem_rbs_collection/minitest/5.25/minitest/summary_reporter.rbs new file mode 100644 index 00000000..e5d601e5 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/summary_reporter.rbs @@ -0,0 +1,18 @@ +# +# A reporter that prints the header, summary, and failure details at the end of +# the run. +# +# This is added to the top-level CompositeReporter at the start of the run. If +# you want to change the output of minitest via a plugin, pull this out of the +# composite and replace it with your own. +# +class Minitest::SummaryReporter < ::Minitest::StatisticsReporter + def start: () -> untyped + def report: () -> untyped + def statistics: () -> untyped + def aggregated_results: (untyped io) -> untyped + def to_s: () -> untyped + def summary: () -> untyped + attr_accessor sync: untyped + attr_accessor old_sync: untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/test.rbs b/.gem_rbs_collection/minitest/5.25/minitest/test.rbs new file mode 100644 index 00000000..9b6b8504 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/test.rbs @@ -0,0 +1,69 @@ +# +# Subclass Test to create your own tests. Typically you'll want a Test subclass +# per implementation class. +# +# See Minitest::Assertions +# +class Minitest::Test < ::Minitest::Runnable + def class_name: () -> untyped + + # + # Call this at the top of your tests when you absolutely positively need to have + # ordered tests. In doing so, you're admitting that you suck and your tests are + # weak. + # + def self.i_suck_and_my_tests_are_order_dependent!: () -> untyped + + # + # Make diffs for this Test use #pretty_inspect so that diff in assert_equal can + # have more details. NOTE: this is much slower than the regular inspect but much + # more usable for complex objects. + # + def self.make_my_diffs_pretty!: () -> untyped + + # + # Call this at the top of your tests (inside the `Minitest::Test` subclass or + # `describe` block) when you want to run your tests in parallel. In doing so, + # you're admitting that you rule and your tests are awesome. + # + def self.parallelize_me!: () -> untyped + + # + # Returns all instance methods starting with "test_". Based on #test_order, the + # methods are either sorted, randomized (default), or run in parallel. + # + def self.runnable_methods: () -> untyped + + # + # Runs a single test with setup/teardown hooks. + # + def run: () -> untyped + def capture_exceptions: () { () -> untyped } -> untyped + def sanitize_exception: (untyped e) -> untyped + def neuter_exception: (untyped e) -> untyped + def new_exception: (untyped klass, untyped msg, untyped bt, ?bool kill) -> untyped + attr_accessor self.io_lock: untyped + include Minitest::Assertions + include Minitest::Reportable + include Minitest::Test::LifecycleHooks + include Minitest::Guard + extend Minitest::Guard + PASSTHROUGH_EXCEPTIONS: Array[singleton(NoMemoryError) | singleton(SignalException) | singleton(SystemExit)] + SETUP_METHODS: Array[String] + TEARDOWN_METHODS: Array[String] +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/test/lifecycle_hooks.rbs b/.gem_rbs_collection/minitest/5.25/minitest/test/lifecycle_hooks.rbs new file mode 100644 index 00000000..e1b9a0ca --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/test/lifecycle_hooks.rbs @@ -0,0 +1,92 @@ +# +# Provides before/after hooks for setup and teardown. These are meant for +# library writers, NOT for regular test authors. See #before_setup for an +# example. +# +module Minitest::Test::LifecycleHooks + # + # Runs before every test, before setup. This hook is meant for libraries to + # extend minitest. It is not meant to be used by test developers. + # + # As a simplistic example: + # + # module MyMinitestPlugin + # def before_setup + # super + # # ... stuff to do before setup is run + # end + # + # def after_setup + # # ... stuff to do after setup is run + # super + # end + # + # def before_teardown + # super + # # ... stuff to do before teardown is run + # end + # + # def after_teardown + # # ... stuff to do after teardown is run + # super + # end + # end + # + # class Minitest::Test + # include MyMinitestPlugin + # end + # + def before_setup: () -> void + + # + # Runs before every test. Use this to set up before each test run. + # + def setup: () -> void + + # + # Runs before every test, after setup. This hook is meant for libraries to + # extend minitest. It is not meant to be used by test developers. + # + # See #before_setup for an example. + # + def after_setup: () -> void + + # + # Runs after every test, before teardown. This hook is meant for libraries to + # extend minitest. It is not meant to be used by test developers. + # + # See #before_setup for an example. + # + def before_teardown: () -> void + + # + # Runs after every test. Use this to clean up after each test run. + # + def teardown: () -> void + + # + # Runs after every test, after teardown. This hook is meant for libraries to + # extend minitest. It is not meant to be used by test developers. + # + # See #before_setup for an example. + # + def after_teardown: () -> void +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/unexpected_error.rbs b/.gem_rbs_collection/minitest/5.25/minitest/unexpected_error.rbs new file mode 100644 index 00000000..1c6fa7c6 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/unexpected_error.rbs @@ -0,0 +1,12 @@ +# +# Assertion wrapping an unexpected error that was raised during a run. +# +class Minitest::UnexpectedError < ::Minitest::Assertion + def initialize: (untyped error) -> void + def backtrace: () -> untyped + def message: () -> ::String + def result_label: () -> "Error" + attr_accessor error: untyped + include Minitest::Compress + BASE_RE: Regexp +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/unexpected_warning.rbs b/.gem_rbs_collection/minitest/5.25/minitest/unexpected_warning.rbs new file mode 100644 index 00000000..24694911 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/unexpected_warning.rbs @@ -0,0 +1,6 @@ +# +# Assertion raised on warning when running in -Werror mode. +# +class Minitest::UnexpectedWarning < ::Minitest::Assertion + def result_label: () -> "Warning" +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/unit.rbs b/.gem_rbs_collection/minitest/5.25/minitest/unit.rbs new file mode 100644 index 00000000..1d7bfbde --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/unit.rbs @@ -0,0 +1,4 @@ +class Minitest::Unit + def self.autorun: () -> untyped + def self.after_tests: () { (?) -> untyped } -> untyped +end diff --git a/.gem_rbs_collection/minitest/5.25/minitest/unit/test_case.rbs b/.gem_rbs_collection/minitest/5.25/minitest/unit/test_case.rbs new file mode 100644 index 00000000..a6daf380 --- /dev/null +++ b/.gem_rbs_collection/minitest/5.25/minitest/unit/test_case.rbs @@ -0,0 +1,3 @@ +class Minitest::Unit::TestCase < ::Minitest::Test + def self.inherited: (untyped klass) -> untyped +end diff --git a/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml b/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml new file mode 100644 index 00000000..d29ba5c7 --- /dev/null +++ b/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml @@ -0,0 +1,9 @@ +--- +name: rake +version: '13.0' +source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems diff --git a/.gem_rbs_collection/rake/13.0/manifest.yaml b/.gem_rbs_collection/rake/13.0/manifest.yaml new file mode 100644 index 00000000..387ebc4d --- /dev/null +++ b/.gem_rbs_collection/rake/13.0/manifest.yaml @@ -0,0 +1,2 @@ +dependencies: + - name: fileutils diff --git a/.gem_rbs_collection/rake/13.0/rake.rbs b/.gem_rbs_collection/rake/13.0/rake.rbs new file mode 100644 index 00000000..89e231fb --- /dev/null +++ b/.gem_rbs_collection/rake/13.0/rake.rbs @@ -0,0 +1,39 @@ +module Rake + class TaskLib + include Rake::DSL + end + + class Task + end + + class TaskArguments + include Enumerable[untyped] + + def []: (untyped index) -> untyped + def each: () ?{ (untyped, untyped) -> void } -> void + end + + module DSL + private + + include FileUtils + + def desc: (String description) -> void + def directory: (*untyped args) ?{ () -> void } -> void + def file: (*untyped args) ?{ () -> void } -> void + def file_create: (*untyped args) ?{ () -> void } -> void + def import: (*String fns) -> void + def multitask: (*untyped args) ?{ () -> void } -> void + def namespace: (?untyped name) ?{ () -> void } -> void + def rule: (*untyped args) ?{ () -> void } -> void + def task: (*untyped args) ?{ (Rake::Task, Rake::TaskArguments) -> void } -> void + end +end + +module FileUtils + def sh: (*String cmd, **untyped options) ?{ (bool, Process::Status) -> void } -> void + | (Hash[String, String] env, *String cmd, **untyped options) ?{ (bool, Process::Status) -> void } -> void + def ruby: (*String args, **untyped options) ?{ (bool, Process::Status) -> void } -> void + def safe_ln: (*untyped args, **untyped options) -> void + def split_all: (String path) -> Array[String] +end diff --git a/.gem_rbs_collection/simplecov/0.22/.rbs_meta.yaml b/.gem_rbs_collection/simplecov/0.22/.rbs_meta.yaml new file mode 100644 index 00000000..e55a72ba --- /dev/null +++ b/.gem_rbs_collection/simplecov/0.22/.rbs_meta.yaml @@ -0,0 +1,9 @@ +--- +name: simplecov +version: '0.22' +source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems diff --git a/.gem_rbs_collection/simplecov/0.22/simplecov.rbs b/.gem_rbs_collection/simplecov/0.22/simplecov.rbs new file mode 100644 index 00000000..35c1f7da --- /dev/null +++ b/.gem_rbs_collection/simplecov/0.22/simplecov.rbs @@ -0,0 +1,54 @@ +module SimpleCov + extend Configuration + + VERSION: String + + def self.collate: (Array[String] result_filenames) -> void + + def self.start: (?(String | Symbol | nil) profile) ?{ [self: Configuration] -> void } -> void + + module Configuration + type filter = String + | Regexp + | Filter[untyped] + | ^(SourceFile source_file) -> boolish + | Array[filter] + + type criterion = :line | :branch + + def add_filter: (filter filter_argument) -> void + | { (SourceFile source_file) -> boolish } -> void + + def add_group: (String group_name, filter filter_argument) -> untyped + | (String group_name) { (SourceFile source_file) -> boolish } -> void + + def command_name: (String name) -> void + + def enable_coverage: (criterion criterion) -> void + + def enable_coverage_for_eval: () -> void + + def filters: () -> Array[Filter[untyped]] + + def primary_coverage: (criterion criterion) -> void + + def root: (?String? root) -> String? + end + + class SourceFile + attr_reader filename: String? + + def lines: () -> Array[Line] + + class Line + end + end + + class Filter[T] + attr_reader filter_argument: T + + def initialize: (T filter_argument) -> void + + def matches?: (SourceFile source_file) -> boolish + end +end diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 5dde45cd..73283c8b 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -19,7 +19,7 @@ jobs: name: Validate Commits steps: - - name: Harden Runner + - name: Harden runner uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 with: egress-policy: audit @@ -31,6 +31,6 @@ jobs: fetch-depth: 0 - name: Inspect Commits - uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed # v6.2.1 + uses: mridang/action-commit-lint@v1 with: - configFile: .commitlintrc.json + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index edd9f26e..f65b9c8f 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -18,7 +18,7 @@ jobs: id-token: write steps: - - name: Harden Runner + - name: Harden runner uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 with: egress-policy: audit diff --git a/.gitignore b/.gitignore index 63cea27e..8ced8ada 100644 --- a/.gitignore +++ b/.gitignore @@ -1,45 +1,19 @@ -# Generated by: https://openapi-generator.tech -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ +# Bundle dependencies +.bundle/ /vendor/ -/lib/bundler/man/ +Gemfile.lock + +# Tool caches +devbox.d/ +.rubocop/ +.yardoc/ -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset +# Gem builds +*.gem -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc +# Coverage output +coverage/ +.out/ +# Local secrets / test credentials (never commit) .env - -devbox.json -devbox.lock -.devbox diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 00000000..1fa64fb1 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,93 @@ +# OpenAPI Generator Ignore +# +# Hand-maintained keep-list: paths the generator must never overwrite and the +# manifest-driven prune must never delete. Patterns follow .gitignore syntax; +# negate with a leading `!`. Organized into the shared cross-SDK sections below +# and sorted alphabetically (case-insensitive) within each section. + +# --- bespoke authenticators (ported onto the generated Authenticator / ApiClient contract) --- +lib/zitadel/client/auth/client_credentials_authenticator.rb +lib/zitadel/client/auth/no_auth_authenticator.rb +lib/zitadel/client/auth/o_auth_authenticator.rb +lib/zitadel/client/auth/open_id.rb +lib/zitadel/client/auth/personal_access_token_authenticator.rb +lib/zitadel/client/auth/web_token_authenticator.rb + +# --- bespoke support classes (error base, dual entrypoints, Zeitwerk inflector, RBS trees) --- +# zitadel-client.rb is the gem-name entrypoint shim delegating to the Zeitwerk +# entrypoint zitadel_client.rb, which loads zitadel_inflector.rb (custom acronym +# inflector). The facade (zitadel.rb, named via clientClassName=Zitadel) is now +# generated; the SDK-wide error base zitadel_error.rb is now generated too (via +# the apiErrorParent option) and the generated ApiError extends it. sig/lib.rbs +# is the `module Zitadel`/`module Client` namespace anchor the generated +# signatures require; sig/lib, sig/spec, sig/test, sig/vendor are hand-authored +# RBS trees the generator does not produce. +lib/zitadel-client.rb +lib/zitadel_client.rb +lib/zitadel_inflector.rb +sig/lib.rbs +sig/lib/ +sig/spec/ +sig/test/ +sig/vendor/ + +# --- bespoke tests + fixtures the generator does not emit --- +# Zitadel authenticator unit tests, the facade test, the integration +# test_helper (boots the CHASM mock + Squid proxy via testcontainers), the +# wiremock/squid/cert fixtures, the spec tree, and the integration-test +# docker-compose stack under etc/. +etc/ +spec/ +test/fixtures/ +test/test_helper.rb +test/zitadel/client/auth/client_credentials_authenticator_test.rb +test/zitadel/client/auth/no_auth_authenticator_test.rb +test/zitadel/client/auth/oauth_authenticator_test.rb +test/zitadel/client/auth/personal_access_token_authenticator_test.rb +test/zitadel/client/auth/web_token_authenticator_test.rb +test/zitadel/client/zitadel_test.rb + +# --- repo identity + docs (team-owned) --- +LICENSE +README.md +SECURITY.md +VERSIONING.md + +# --- house tooling (team-owned task/lint/type config) --- +# .gitignore is team-owned because the generated one omits .env and other +# repo-specific entries. The rbs_collection.* + .gem_rbs_collection/ files are +# the hand-managed `rbs collection` manifest/lock and vendored gem signatures. +.commitlintrc.json +.dockerignore +.editorconfig +.gem_rbs_collection/ +.github/ +.gitignore +.pre-commit-config.yaml +.releaserc.json +.rubocop.yml +.ruby-version +Dockerfile +devbox.json +devbox.lock +lefthook.yml +qodana.yaml +rbs_collection.lock.yaml +rbs_collection.yaml +Steepfile + +# --- build / package config (team-owned) --- +Gemfile +Rakefile +zitadel-client.gemspec + +# --- generation tooling we added --- +Makefile +proc.yml +.openapi-generator-ignore + +# --- generator bookkeeping --- +# FILES is the prune manifest and VERSION records the generator version; the +# generator rewrites both every run but never lists them in FILES, so the +# manifest-driven prune would otherwise delete them. +.openapi-generator/ diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 00000000..56334cdd --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,2802 @@ +.yardopts +SKILLS.md +lib/zitadel/client/api/action_service_api.rb +lib/zitadel/client/api/application_service_api.rb +lib/zitadel/client/api/authorization_service_api.rb +lib/zitadel/client/api/base_api.rb +lib/zitadel/client/api/beta_action_service_api.rb +lib/zitadel/client/api/beta_app_service_api.rb +lib/zitadel/client/api/beta_authorization_service_api.rb +lib/zitadel/client/api/beta_feature_service_api.rb +lib/zitadel/client/api/beta_instance_service_api.rb +lib/zitadel/client/api/beta_internal_permission_service_api.rb +lib/zitadel/client/api/beta_oidc_service_api.rb +lib/zitadel/client/api/beta_organization_service_api.rb +lib/zitadel/client/api/beta_project_service_api.rb +lib/zitadel/client/api/beta_session_service_api.rb +lib/zitadel/client/api/beta_settings_service_api.rb +lib/zitadel/client/api/beta_telemetry_service_api.rb +lib/zitadel/client/api/beta_user_service_api.rb +lib/zitadel/client/api/beta_web_key_service_api.rb +lib/zitadel/client/api/feature_service_api.rb +lib/zitadel/client/api/identity_provider_service_api.rb +lib/zitadel/client/api/instance_service_api.rb +lib/zitadel/client/api/internal_permission_service_api.rb +lib/zitadel/client/api/oidc_service_api.rb +lib/zitadel/client/api/organization_service_api.rb +lib/zitadel/client/api/project_service_api.rb +lib/zitadel/client/api/saml_service_api.rb +lib/zitadel/client/api/session_service_api.rb +lib/zitadel/client/api/settings_service_api.rb +lib/zitadel/client/api/user_service_api.rb +lib/zitadel/client/api/web_key_service_api.rb +lib/zitadel/client/api_client.rb +lib/zitadel/client/api_error.rb +lib/zitadel/client/api_response.rb +lib/zitadel/client/api_result.rb +lib/zitadel/client/auth/authenticator.rb +lib/zitadel/client/auth/base_authenticator.rb +lib/zitadel/client/auth/bearer_authenticator.rb +lib/zitadel/client/auth/http_aware_authenticator.rb +lib/zitadel/client/auth/zitadel_access_token_authenticator.rb +lib/zitadel/client/configuration.rb +lib/zitadel/client/default_api_client.rb +lib/zitadel/client/errors/bad_request_error.rb +lib/zitadel/client/errors/client_error.rb +lib/zitadel/client/errors/conflict_error.rb +lib/zitadel/client/errors/forbidden_error.rb +lib/zitadel/client/errors/internal_server_error.rb +lib/zitadel/client/errors/not_found_error.rb +lib/zitadel/client/errors/server_error.rb +lib/zitadel/client/errors/unauthorized_error.rb +lib/zitadel/client/errors/unprocessable_entity_error.rb +lib/zitadel/client/header_selector.rb +lib/zitadel/client/models/action_service_activate_public_key_request.rb +lib/zitadel/client/models/action_service_activate_public_key_response.rb +lib/zitadel/client/models/action_service_add_public_key_request.rb +lib/zitadel/client/models/action_service_add_public_key_response.rb +lib/zitadel/client/models/action_service_any.rb +lib/zitadel/client/models/action_service_condition.rb +lib/zitadel/client/models/action_service_connect_error.rb +lib/zitadel/client/models/action_service_create_target_request.rb +lib/zitadel/client/models/action_service_create_target_response.rb +lib/zitadel/client/models/action_service_deactivate_public_key_request.rb +lib/zitadel/client/models/action_service_deactivate_public_key_response.rb +lib/zitadel/client/models/action_service_delete_target_request.rb +lib/zitadel/client/models/action_service_delete_target_response.rb +lib/zitadel/client/models/action_service_event_execution.rb +lib/zitadel/client/models/action_service_execution.rb +lib/zitadel/client/models/action_service_execution_field_name.rb +lib/zitadel/client/models/action_service_execution_search_filter.rb +lib/zitadel/client/models/action_service_execution_type.rb +lib/zitadel/client/models/action_service_execution_type_filter.rb +lib/zitadel/client/models/action_service_function_execution.rb +lib/zitadel/client/models/action_service_get_target_request.rb +lib/zitadel/client/models/action_service_get_target_response.rb +lib/zitadel/client/models/action_service_in_conditions_filter.rb +lib/zitadel/client/models/action_service_in_ids_filter.rb +lib/zitadel/client/models/action_service_in_target_ids_filter.rb +lib/zitadel/client/models/action_service_list_execution_functions_response.rb +lib/zitadel/client/models/action_service_list_execution_methods_response.rb +lib/zitadel/client/models/action_service_list_execution_services_response.rb +lib/zitadel/client/models/action_service_list_executions_request.rb +lib/zitadel/client/models/action_service_list_executions_response.rb +lib/zitadel/client/models/action_service_list_public_keys_request.rb +lib/zitadel/client/models/action_service_list_public_keys_response.rb +lib/zitadel/client/models/action_service_list_targets_request.rb +lib/zitadel/client/models/action_service_list_targets_response.rb +lib/zitadel/client/models/action_service_pagination_request.rb +lib/zitadel/client/models/action_service_pagination_response.rb +lib/zitadel/client/models/action_service_payload_type.rb +lib/zitadel/client/models/action_service_public_key.rb +lib/zitadel/client/models/action_service_public_key_field_name.rb +lib/zitadel/client/models/action_service_public_key_search_filter.rb +lib/zitadel/client/models/action_service_remove_public_key_request.rb +lib/zitadel/client/models/action_service_remove_public_key_response.rb +lib/zitadel/client/models/action_service_request_execution.rb +lib/zitadel/client/models/action_service_response_execution.rb +lib/zitadel/client/models/action_service_rest_call.rb +lib/zitadel/client/models/action_service_rest_webhook.rb +lib/zitadel/client/models/action_service_set_execution_request.rb +lib/zitadel/client/models/action_service_set_execution_response.rb +lib/zitadel/client/models/action_service_target.rb +lib/zitadel/client/models/action_service_target_field_name.rb +lib/zitadel/client/models/action_service_target_filter.rb +lib/zitadel/client/models/action_service_target_name_filter.rb +lib/zitadel/client/models/action_service_target_search_filter.rb +lib/zitadel/client/models/action_service_text_filter_method.rb +lib/zitadel/client/models/action_service_timestamp_filter.rb +lib/zitadel/client/models/action_service_timestamp_filter_method.rb +lib/zitadel/client/models/action_service_update_target_request.rb +lib/zitadel/client/models/action_service_update_target_response.rb +lib/zitadel/client/models/application_service_any.rb +lib/zitadel/client/models/application_service_api_auth_method_type.rb +lib/zitadel/client/models/application_service_api_configuration.rb +lib/zitadel/client/models/application_service_application.rb +lib/zitadel/client/models/application_service_application_key.rb +lib/zitadel/client/models/application_service_application_key_application_id_filter.rb +lib/zitadel/client/models/application_service_application_key_organization_id_filter.rb +lib/zitadel/client/models/application_service_application_key_project_id_filter.rb +lib/zitadel/client/models/application_service_application_key_search_filter.rb +lib/zitadel/client/models/application_service_application_keys_sorting.rb +lib/zitadel/client/models/application_service_application_name_filter.rb +lib/zitadel/client/models/application_service_application_search_filter.rb +lib/zitadel/client/models/application_service_application_sorting.rb +lib/zitadel/client/models/application_service_application_state.rb +lib/zitadel/client/models/application_service_application_type.rb +lib/zitadel/client/models/application_service_client_id_filter.rb +lib/zitadel/client/models/application_service_connect_error.rb +lib/zitadel/client/models/application_service_create_api_application_request.rb +lib/zitadel/client/models/application_service_create_api_application_response.rb +lib/zitadel/client/models/application_service_create_application_key_request.rb +lib/zitadel/client/models/application_service_create_application_key_response.rb +lib/zitadel/client/models/application_service_create_application_request.rb +lib/zitadel/client/models/application_service_create_application_response.rb +lib/zitadel/client/models/application_service_create_oidc_application_request.rb +lib/zitadel/client/models/application_service_create_oidc_application_response.rb +lib/zitadel/client/models/application_service_create_saml_application_request.rb +lib/zitadel/client/models/application_service_deactivate_application_request.rb +lib/zitadel/client/models/application_service_deactivate_application_response.rb +lib/zitadel/client/models/application_service_delete_application_key_request.rb +lib/zitadel/client/models/application_service_delete_application_key_response.rb +lib/zitadel/client/models/application_service_delete_application_request.rb +lib/zitadel/client/models/application_service_delete_application_response.rb +lib/zitadel/client/models/application_service_entity_id_filter.rb +lib/zitadel/client/models/application_service_generate_client_secret_request.rb +lib/zitadel/client/models/application_service_generate_client_secret_response.rb +lib/zitadel/client/models/application_service_get_application_key_request.rb +lib/zitadel/client/models/application_service_get_application_key_response.rb +lib/zitadel/client/models/application_service_get_application_request.rb +lib/zitadel/client/models/application_service_get_application_response.rb +lib/zitadel/client/models/application_service_list_application_keys_request.rb +lib/zitadel/client/models/application_service_list_application_keys_response.rb +lib/zitadel/client/models/application_service_list_applications_request.rb +lib/zitadel/client/models/application_service_list_applications_response.rb +lib/zitadel/client/models/application_service_login_v2.rb +lib/zitadel/client/models/application_service_login_version.rb +lib/zitadel/client/models/application_service_oidc_application_type.rb +lib/zitadel/client/models/application_service_oidc_auth_method_type.rb +lib/zitadel/client/models/application_service_oidc_configuration.rb +lib/zitadel/client/models/application_service_oidc_grant_type.rb +lib/zitadel/client/models/application_service_oidc_localized_message.rb +lib/zitadel/client/models/application_service_oidc_response_type.rb +lib/zitadel/client/models/application_service_oidc_token_type.rb +lib/zitadel/client/models/application_service_oidc_version.rb +lib/zitadel/client/models/application_service_pagination_request.rb +lib/zitadel/client/models/application_service_pagination_response.rb +lib/zitadel/client/models/application_service_project_id_filter.rb +lib/zitadel/client/models/application_service_reactivate_application_request.rb +lib/zitadel/client/models/application_service_reactivate_application_response.rb +lib/zitadel/client/models/application_service_saml_configuration.rb +lib/zitadel/client/models/application_service_text_filter_method.rb +lib/zitadel/client/models/application_service_update_api_application_configuration_request.rb +lib/zitadel/client/models/application_service_update_application_request.rb +lib/zitadel/client/models/application_service_update_application_response.rb +lib/zitadel/client/models/application_service_update_oidc_application_configuration_request.rb +lib/zitadel/client/models/application_service_update_saml_application_configuration_request.rb +lib/zitadel/client/models/authorization_service_activate_authorization_request.rb +lib/zitadel/client/models/authorization_service_activate_authorization_response.rb +lib/zitadel/client/models/authorization_service_any.rb +lib/zitadel/client/models/authorization_service_authorization.rb +lib/zitadel/client/models/authorization_service_authorization_field_name.rb +lib/zitadel/client/models/authorization_service_authorizations_search_filter.rb +lib/zitadel/client/models/authorization_service_connect_error.rb +lib/zitadel/client/models/authorization_service_create_authorization_request.rb +lib/zitadel/client/models/authorization_service_create_authorization_response.rb +lib/zitadel/client/models/authorization_service_deactivate_authorization_request.rb +lib/zitadel/client/models/authorization_service_deactivate_authorization_response.rb +lib/zitadel/client/models/authorization_service_delete_authorization_request.rb +lib/zitadel/client/models/authorization_service_delete_authorization_response.rb +lib/zitadel/client/models/authorization_service_id_filter.rb +lib/zitadel/client/models/authorization_service_in_ids_filter.rb +lib/zitadel/client/models/authorization_service_list_authorizations_request.rb +lib/zitadel/client/models/authorization_service_list_authorizations_response.rb +lib/zitadel/client/models/authorization_service_organization.rb +lib/zitadel/client/models/authorization_service_pagination_request.rb +lib/zitadel/client/models/authorization_service_pagination_response.rb +lib/zitadel/client/models/authorization_service_project.rb +lib/zitadel/client/models/authorization_service_project_name_query.rb +lib/zitadel/client/models/authorization_service_role.rb +lib/zitadel/client/models/authorization_service_role_key_query.rb +lib/zitadel/client/models/authorization_service_state.rb +lib/zitadel/client/models/authorization_service_state_query.rb +lib/zitadel/client/models/authorization_service_text_filter_method.rb +lib/zitadel/client/models/authorization_service_update_authorization_request.rb +lib/zitadel/client/models/authorization_service_update_authorization_response.rb +lib/zitadel/client/models/authorization_service_user.rb +lib/zitadel/client/models/authorization_service_user_display_name_query.rb +lib/zitadel/client/models/authorization_service_user_preferred_login_name_query.rb +lib/zitadel/client/models/beta_action_service_any.rb +lib/zitadel/client/models/beta_action_service_condition.rb +lib/zitadel/client/models/beta_action_service_connect_error.rb +lib/zitadel/client/models/beta_action_service_create_target_request.rb +lib/zitadel/client/models/beta_action_service_create_target_response.rb +lib/zitadel/client/models/beta_action_service_delete_target_request.rb +lib/zitadel/client/models/beta_action_service_delete_target_response.rb +lib/zitadel/client/models/beta_action_service_event_execution.rb +lib/zitadel/client/models/beta_action_service_execution.rb +lib/zitadel/client/models/beta_action_service_execution_field_name.rb +lib/zitadel/client/models/beta_action_service_execution_search_filter.rb +lib/zitadel/client/models/beta_action_service_execution_type.rb +lib/zitadel/client/models/beta_action_service_execution_type_filter.rb +lib/zitadel/client/models/beta_action_service_function_execution.rb +lib/zitadel/client/models/beta_action_service_get_target_request.rb +lib/zitadel/client/models/beta_action_service_get_target_response.rb +lib/zitadel/client/models/beta_action_service_in_conditions_filter.rb +lib/zitadel/client/models/beta_action_service_in_target_ids_filter.rb +lib/zitadel/client/models/beta_action_service_list_execution_functions_response.rb +lib/zitadel/client/models/beta_action_service_list_execution_methods_response.rb +lib/zitadel/client/models/beta_action_service_list_execution_services_response.rb +lib/zitadel/client/models/beta_action_service_list_executions_request.rb +lib/zitadel/client/models/beta_action_service_list_executions_response.rb +lib/zitadel/client/models/beta_action_service_list_targets_request.rb +lib/zitadel/client/models/beta_action_service_list_targets_response.rb +lib/zitadel/client/models/beta_action_service_pagination_request.rb +lib/zitadel/client/models/beta_action_service_pagination_response.rb +lib/zitadel/client/models/beta_action_service_request_execution.rb +lib/zitadel/client/models/beta_action_service_response_execution.rb +lib/zitadel/client/models/beta_action_service_rest_call.rb +lib/zitadel/client/models/beta_action_service_rest_webhook.rb +lib/zitadel/client/models/beta_action_service_set_execution_request.rb +lib/zitadel/client/models/beta_action_service_set_execution_response.rb +lib/zitadel/client/models/beta_action_service_target.rb +lib/zitadel/client/models/beta_action_service_target_field_name.rb +lib/zitadel/client/models/beta_action_service_target_filter.rb +lib/zitadel/client/models/beta_action_service_target_name_filter.rb +lib/zitadel/client/models/beta_action_service_target_search_filter.rb +lib/zitadel/client/models/beta_action_service_text_filter_method.rb +lib/zitadel/client/models/beta_action_service_update_target_request.rb +lib/zitadel/client/models/beta_action_service_update_target_response.rb +lib/zitadel/client/models/beta_app_service_any.rb +lib/zitadel/client/models/beta_app_service_api_auth_method_type.rb +lib/zitadel/client/models/beta_app_service_api_config.rb +lib/zitadel/client/models/beta_app_service_app_sorting.rb +lib/zitadel/client/models/beta_app_service_app_state.rb +lib/zitadel/client/models/beta_app_service_application.rb +lib/zitadel/client/models/beta_app_service_application_key.rb +lib/zitadel/client/models/beta_app_service_application_keys_sorting.rb +lib/zitadel/client/models/beta_app_service_application_name_query.rb +lib/zitadel/client/models/beta_app_service_application_search_filter.rb +lib/zitadel/client/models/beta_app_service_connect_error.rb +lib/zitadel/client/models/beta_app_service_create_api_application_request.rb +lib/zitadel/client/models/beta_app_service_create_api_application_response.rb +lib/zitadel/client/models/beta_app_service_create_application_key_request.rb +lib/zitadel/client/models/beta_app_service_create_application_key_response.rb +lib/zitadel/client/models/beta_app_service_create_application_request.rb +lib/zitadel/client/models/beta_app_service_create_application_response.rb +lib/zitadel/client/models/beta_app_service_create_oidc_application_request.rb +lib/zitadel/client/models/beta_app_service_create_oidc_application_response.rb +lib/zitadel/client/models/beta_app_service_create_saml_application_request.rb +lib/zitadel/client/models/beta_app_service_deactivate_application_request.rb +lib/zitadel/client/models/beta_app_service_deactivate_application_response.rb +lib/zitadel/client/models/beta_app_service_delete_application_key_request.rb +lib/zitadel/client/models/beta_app_service_delete_application_key_response.rb +lib/zitadel/client/models/beta_app_service_delete_application_request.rb +lib/zitadel/client/models/beta_app_service_delete_application_response.rb +lib/zitadel/client/models/beta_app_service_get_application_key_request.rb +lib/zitadel/client/models/beta_app_service_get_application_key_response.rb +lib/zitadel/client/models/beta_app_service_get_application_request.rb +lib/zitadel/client/models/beta_app_service_get_application_response.rb +lib/zitadel/client/models/beta_app_service_list_application_keys_request.rb +lib/zitadel/client/models/beta_app_service_list_application_keys_response.rb +lib/zitadel/client/models/beta_app_service_list_applications_request.rb +lib/zitadel/client/models/beta_app_service_list_applications_response.rb +lib/zitadel/client/models/beta_app_service_login_v2.rb +lib/zitadel/client/models/beta_app_service_login_version.rb +lib/zitadel/client/models/beta_app_service_oidc_app_type.rb +lib/zitadel/client/models/beta_app_service_oidc_auth_method_type.rb +lib/zitadel/client/models/beta_app_service_oidc_config.rb +lib/zitadel/client/models/beta_app_service_oidc_grant_type.rb +lib/zitadel/client/models/beta_app_service_oidc_localized_message.rb +lib/zitadel/client/models/beta_app_service_oidc_response_type.rb +lib/zitadel/client/models/beta_app_service_oidc_token_type.rb +lib/zitadel/client/models/beta_app_service_oidc_version.rb +lib/zitadel/client/models/beta_app_service_pagination_request.rb +lib/zitadel/client/models/beta_app_service_pagination_response.rb +lib/zitadel/client/models/beta_app_service_reactivate_application_request.rb +lib/zitadel/client/models/beta_app_service_reactivate_application_response.rb +lib/zitadel/client/models/beta_app_service_regenerate_client_secret_request.rb +lib/zitadel/client/models/beta_app_service_regenerate_client_secret_response.rb +lib/zitadel/client/models/beta_app_service_saml_config.rb +lib/zitadel/client/models/beta_app_service_text_filter_method.rb +lib/zitadel/client/models/beta_app_service_update_api_application_configuration_request.rb +lib/zitadel/client/models/beta_app_service_update_application_request.rb +lib/zitadel/client/models/beta_app_service_update_application_response.rb +lib/zitadel/client/models/beta_app_service_update_oidc_application_configuration_request.rb +lib/zitadel/client/models/beta_app_service_update_saml_application_configuration_request.rb +lib/zitadel/client/models/beta_authorization_service_activate_authorization_request.rb +lib/zitadel/client/models/beta_authorization_service_activate_authorization_response.rb +lib/zitadel/client/models/beta_authorization_service_any.rb +lib/zitadel/client/models/beta_authorization_service_authorization.rb +lib/zitadel/client/models/beta_authorization_service_authorization_field_name.rb +lib/zitadel/client/models/beta_authorization_service_authorizations_search_filter.rb +lib/zitadel/client/models/beta_authorization_service_connect_error.rb +lib/zitadel/client/models/beta_authorization_service_create_authorization_request.rb +lib/zitadel/client/models/beta_authorization_service_create_authorization_response.rb +lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_request.rb +lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_response.rb +lib/zitadel/client/models/beta_authorization_service_delete_authorization_request.rb +lib/zitadel/client/models/beta_authorization_service_delete_authorization_response.rb +lib/zitadel/client/models/beta_authorization_service_id_filter.rb +lib/zitadel/client/models/beta_authorization_service_in_ids_filter.rb +lib/zitadel/client/models/beta_authorization_service_list_authorizations_request.rb +lib/zitadel/client/models/beta_authorization_service_list_authorizations_response.rb +lib/zitadel/client/models/beta_authorization_service_pagination_request.rb +lib/zitadel/client/models/beta_authorization_service_pagination_response.rb +lib/zitadel/client/models/beta_authorization_service_project_name_query.rb +lib/zitadel/client/models/beta_authorization_service_role_key_query.rb +lib/zitadel/client/models/beta_authorization_service_state.rb +lib/zitadel/client/models/beta_authorization_service_state_query.rb +lib/zitadel/client/models/beta_authorization_service_text_filter_method.rb +lib/zitadel/client/models/beta_authorization_service_update_authorization_request.rb +lib/zitadel/client/models/beta_authorization_service_update_authorization_response.rb +lib/zitadel/client/models/beta_authorization_service_user.rb +lib/zitadel/client/models/beta_authorization_service_user_display_name_query.rb +lib/zitadel/client/models/beta_authorization_service_user_preferred_login_name_query.rb +lib/zitadel/client/models/beta_feature_service_any.rb +lib/zitadel/client/models/beta_feature_service_connect_error.rb +lib/zitadel/client/models/beta_feature_service_details.rb +lib/zitadel/client/models/beta_feature_service_feature_flag.rb +lib/zitadel/client/models/beta_feature_service_get_instance_features_request.rb +lib/zitadel/client/models/beta_feature_service_get_instance_features_response.rb +lib/zitadel/client/models/beta_feature_service_get_organization_features_request.rb +lib/zitadel/client/models/beta_feature_service_get_organization_features_response.rb +lib/zitadel/client/models/beta_feature_service_get_system_features_response.rb +lib/zitadel/client/models/beta_feature_service_get_user_features_request.rb +lib/zitadel/client/models/beta_feature_service_get_user_features_response.rb +lib/zitadel/client/models/beta_feature_service_improved_performance.rb +lib/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rb +lib/zitadel/client/models/beta_feature_service_reset_instance_features_response.rb +lib/zitadel/client/models/beta_feature_service_reset_organization_features_request.rb +lib/zitadel/client/models/beta_feature_service_reset_organization_features_response.rb +lib/zitadel/client/models/beta_feature_service_reset_system_features_response.rb +lib/zitadel/client/models/beta_feature_service_reset_user_features_request.rb +lib/zitadel/client/models/beta_feature_service_reset_user_features_response.rb +lib/zitadel/client/models/beta_feature_service_set_instance_features_request.rb +lib/zitadel/client/models/beta_feature_service_set_instance_features_response.rb +lib/zitadel/client/models/beta_feature_service_set_organization_features_request.rb +lib/zitadel/client/models/beta_feature_service_set_organization_features_response.rb +lib/zitadel/client/models/beta_feature_service_set_system_features_request.rb +lib/zitadel/client/models/beta_feature_service_set_system_features_response.rb +lib/zitadel/client/models/beta_feature_service_set_user_feature_request.rb +lib/zitadel/client/models/beta_feature_service_set_user_features_response.rb +lib/zitadel/client/models/beta_feature_service_source.rb +lib/zitadel/client/models/beta_instance_service_add_custom_domain_request.rb +lib/zitadel/client/models/beta_instance_service_add_custom_domain_response.rb +lib/zitadel/client/models/beta_instance_service_add_trusted_domain_request.rb +lib/zitadel/client/models/beta_instance_service_add_trusted_domain_response.rb +lib/zitadel/client/models/beta_instance_service_any.rb +lib/zitadel/client/models/beta_instance_service_connect_error.rb +lib/zitadel/client/models/beta_instance_service_delete_instance_request.rb +lib/zitadel/client/models/beta_instance_service_delete_instance_response.rb +lib/zitadel/client/models/beta_instance_service_domain.rb +lib/zitadel/client/models/beta_instance_service_domain_field_name.rb +lib/zitadel/client/models/beta_instance_service_domain_generated_query.rb +lib/zitadel/client/models/beta_instance_service_domain_primary_query.rb +lib/zitadel/client/models/beta_instance_service_domain_query.rb +lib/zitadel/client/models/beta_instance_service_domain_search_query.rb +lib/zitadel/client/models/beta_instance_service_domains_query.rb +lib/zitadel/client/models/beta_instance_service_field_name.rb +lib/zitadel/client/models/beta_instance_service_get_instance_request.rb +lib/zitadel/client/models/beta_instance_service_get_instance_response.rb +lib/zitadel/client/models/beta_instance_service_ids_query.rb +lib/zitadel/client/models/beta_instance_service_instance.rb +lib/zitadel/client/models/beta_instance_service_list_custom_domains_request.rb +lib/zitadel/client/models/beta_instance_service_list_custom_domains_response.rb +lib/zitadel/client/models/beta_instance_service_list_instances_request.rb +lib/zitadel/client/models/beta_instance_service_list_instances_response.rb +lib/zitadel/client/models/beta_instance_service_list_trusted_domains_request.rb +lib/zitadel/client/models/beta_instance_service_list_trusted_domains_response.rb +lib/zitadel/client/models/beta_instance_service_pagination_request.rb +lib/zitadel/client/models/beta_instance_service_pagination_response.rb +lib/zitadel/client/models/beta_instance_service_query.rb +lib/zitadel/client/models/beta_instance_service_remove_custom_domain_request.rb +lib/zitadel/client/models/beta_instance_service_remove_custom_domain_response.rb +lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_request.rb +lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_response.rb +lib/zitadel/client/models/beta_instance_service_state.rb +lib/zitadel/client/models/beta_instance_service_text_query_method.rb +lib/zitadel/client/models/beta_instance_service_trusted_domain.rb +lib/zitadel/client/models/beta_instance_service_trusted_domain_field_name.rb +lib/zitadel/client/models/beta_instance_service_trusted_domain_search_query.rb +lib/zitadel/client/models/beta_instance_service_update_instance_request.rb +lib/zitadel/client/models/beta_instance_service_update_instance_response.rb +lib/zitadel/client/models/beta_internal_permission_service_administrator.rb +lib/zitadel/client/models/beta_internal_permission_service_administrator_field_name.rb +lib/zitadel/client/models/beta_internal_permission_service_administrator_search_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_and_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_any.rb +lib/zitadel/client/models/beta_internal_permission_service_connect_error.rb +lib/zitadel/client/models/beta_internal_permission_service_create_administrator_request.rb +lib/zitadel/client/models/beta_internal_permission_service_create_administrator_response.rb +lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_request.rb +lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_response.rb +lib/zitadel/client/models/beta_internal_permission_service_id_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_in_ids_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_list_administrators_request.rb +lib/zitadel/client/models/beta_internal_permission_service_list_administrators_response.rb +lib/zitadel/client/models/beta_internal_permission_service_not_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_or_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_organization.rb +lib/zitadel/client/models/beta_internal_permission_service_pagination_request.rb +lib/zitadel/client/models/beta_internal_permission_service_pagination_response.rb +lib/zitadel/client/models/beta_internal_permission_service_project.rb +lib/zitadel/client/models/beta_internal_permission_service_project_grant.rb +lib/zitadel/client/models/beta_internal_permission_service_resource_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_resource_type.rb +lib/zitadel/client/models/beta_internal_permission_service_role_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_text_filter_method.rb +lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter_method.rb +lib/zitadel/client/models/beta_internal_permission_service_update_administrator_request.rb +lib/zitadel/client/models/beta_internal_permission_service_update_administrator_response.rb +lib/zitadel/client/models/beta_internal_permission_service_user.rb +lib/zitadel/client/models/beta_internal_permission_service_user_display_name_filter.rb +lib/zitadel/client/models/beta_internal_permission_service_user_preferred_login_name_filter.rb +lib/zitadel/client/models/beta_oidc_service_any.rb +lib/zitadel/client/models/beta_oidc_service_auth_request.rb +lib/zitadel/client/models/beta_oidc_service_authorization_error.rb +lib/zitadel/client/models/beta_oidc_service_connect_error.rb +lib/zitadel/client/models/beta_oidc_service_create_callback_request.rb +lib/zitadel/client/models/beta_oidc_service_create_callback_response.rb +lib/zitadel/client/models/beta_oidc_service_details.rb +lib/zitadel/client/models/beta_oidc_service_error_reason.rb +lib/zitadel/client/models/beta_oidc_service_get_auth_request_request.rb +lib/zitadel/client/models/beta_oidc_service_get_auth_request_response.rb +lib/zitadel/client/models/beta_oidc_service_prompt.rb +lib/zitadel/client/models/beta_oidc_service_session.rb +lib/zitadel/client/models/beta_organization_service_activate_organization_request.rb +lib/zitadel/client/models/beta_organization_service_activate_organization_response.rb +lib/zitadel/client/models/beta_organization_service_add_human_user_request.rb +lib/zitadel/client/models/beta_organization_service_add_organization_domain_request.rb +lib/zitadel/client/models/beta_organization_service_add_organization_domain_response.rb +lib/zitadel/client/models/beta_organization_service_admin.rb +lib/zitadel/client/models/beta_organization_service_any.rb +lib/zitadel/client/models/beta_organization_service_assigned_admin.rb +lib/zitadel/client/models/beta_organization_service_connect_error.rb +lib/zitadel/client/models/beta_organization_service_create_organization_request.rb +lib/zitadel/client/models/beta_organization_service_create_organization_response.rb +lib/zitadel/client/models/beta_organization_service_created_admin.rb +lib/zitadel/client/models/beta_organization_service_deactivate_organization_request.rb +lib/zitadel/client/models/beta_organization_service_deactivate_organization_response.rb +lib/zitadel/client/models/beta_organization_service_delete_organization_domain_request.rb +lib/zitadel/client/models/beta_organization_service_delete_organization_domain_response.rb +lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_request.rb +lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_response.rb +lib/zitadel/client/models/beta_organization_service_delete_organization_request.rb +lib/zitadel/client/models/beta_organization_service_delete_organization_response.rb +lib/zitadel/client/models/beta_organization_service_domain.rb +lib/zitadel/client/models/beta_organization_service_domain_name_filter.rb +lib/zitadel/client/models/beta_organization_service_domain_search_filter.rb +lib/zitadel/client/models/beta_organization_service_domain_validation_type.rb +lib/zitadel/client/models/beta_organization_service_gender.rb +lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_request.rb +lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_response.rb +lib/zitadel/client/models/beta_organization_service_hashed_password.rb +lib/zitadel/client/models/beta_organization_service_idp_link.rb +lib/zitadel/client/models/beta_organization_service_list_organization_domains_request.rb +lib/zitadel/client/models/beta_organization_service_list_organization_domains_response.rb +lib/zitadel/client/models/beta_organization_service_list_organization_metadata_request.rb +lib/zitadel/client/models/beta_organization_service_list_organization_metadata_response.rb +lib/zitadel/client/models/beta_organization_service_list_organizations_request.rb +lib/zitadel/client/models/beta_organization_service_list_organizations_response.rb +lib/zitadel/client/models/beta_organization_service_metadata.rb +lib/zitadel/client/models/beta_organization_service_metadata_key_query.rb +lib/zitadel/client/models/beta_organization_service_metadata_query.rb +lib/zitadel/client/models/beta_organization_service_org_domain_filter.rb +lib/zitadel/client/models/beta_organization_service_org_field_name.rb +lib/zitadel/client/models/beta_organization_service_org_id_filter.rb +lib/zitadel/client/models/beta_organization_service_org_name_filter.rb +lib/zitadel/client/models/beta_organization_service_org_state.rb +lib/zitadel/client/models/beta_organization_service_org_state_filter.rb +lib/zitadel/client/models/beta_organization_service_organization.rb +lib/zitadel/client/models/beta_organization_service_organization_admin.rb +lib/zitadel/client/models/beta_organization_service_organization_search_filter.rb +lib/zitadel/client/models/beta_organization_service_pagination_request.rb +lib/zitadel/client/models/beta_organization_service_pagination_response.rb +lib/zitadel/client/models/beta_organization_service_password.rb +lib/zitadel/client/models/beta_organization_service_send_email_verification_code.rb +lib/zitadel/client/models/beta_organization_service_set_human_email.rb +lib/zitadel/client/models/beta_organization_service_set_human_phone.rb +lib/zitadel/client/models/beta_organization_service_set_human_profile.rb +lib/zitadel/client/models/beta_organization_service_set_metadata_entry.rb +lib/zitadel/client/models/beta_organization_service_set_organization_metadata_request.rb +lib/zitadel/client/models/beta_organization_service_set_organization_metadata_response.rb +lib/zitadel/client/models/beta_organization_service_text_query_method.rb +lib/zitadel/client/models/beta_organization_service_update_organization_request.rb +lib/zitadel/client/models/beta_organization_service_update_organization_response.rb +lib/zitadel/client/models/beta_organization_service_verify_organization_domain_request.rb +lib/zitadel/client/models/beta_organization_service_verify_organization_domain_response.rb +lib/zitadel/client/models/beta_project_service_activate_project_grant_request.rb +lib/zitadel/client/models/beta_project_service_activate_project_grant_response.rb +lib/zitadel/client/models/beta_project_service_activate_project_request.rb +lib/zitadel/client/models/beta_project_service_activate_project_response.rb +lib/zitadel/client/models/beta_project_service_add_project_role_request.rb +lib/zitadel/client/models/beta_project_service_add_project_role_response.rb +lib/zitadel/client/models/beta_project_service_admin.rb +lib/zitadel/client/models/beta_project_service_any.rb +lib/zitadel/client/models/beta_project_service_connect_error.rb +lib/zitadel/client/models/beta_project_service_create_project_grant_request.rb +lib/zitadel/client/models/beta_project_service_create_project_grant_response.rb +lib/zitadel/client/models/beta_project_service_create_project_request.rb +lib/zitadel/client/models/beta_project_service_create_project_response.rb +lib/zitadel/client/models/beta_project_service_deactivate_project_grant_request.rb +lib/zitadel/client/models/beta_project_service_deactivate_project_grant_response.rb +lib/zitadel/client/models/beta_project_service_deactivate_project_request.rb +lib/zitadel/client/models/beta_project_service_deactivate_project_response.rb +lib/zitadel/client/models/beta_project_service_delete_project_grant_request.rb +lib/zitadel/client/models/beta_project_service_delete_project_grant_response.rb +lib/zitadel/client/models/beta_project_service_delete_project_request.rb +lib/zitadel/client/models/beta_project_service_delete_project_response.rb +lib/zitadel/client/models/beta_project_service_get_project_request.rb +lib/zitadel/client/models/beta_project_service_get_project_response.rb +lib/zitadel/client/models/beta_project_service_granted_project_state.rb +lib/zitadel/client/models/beta_project_service_id_filter.rb +lib/zitadel/client/models/beta_project_service_in_ids_filter.rb +lib/zitadel/client/models/beta_project_service_list_project_grants_request.rb +lib/zitadel/client/models/beta_project_service_list_project_grants_response.rb +lib/zitadel/client/models/beta_project_service_list_project_roles_request.rb +lib/zitadel/client/models/beta_project_service_list_project_roles_response.rb +lib/zitadel/client/models/beta_project_service_list_projects_request.rb +lib/zitadel/client/models/beta_project_service_list_projects_response.rb +lib/zitadel/client/models/beta_project_service_pagination_request.rb +lib/zitadel/client/models/beta_project_service_pagination_response.rb +lib/zitadel/client/models/beta_project_service_private_labeling_setting.rb +lib/zitadel/client/models/beta_project_service_project.rb +lib/zitadel/client/models/beta_project_service_project_field_name.rb +lib/zitadel/client/models/beta_project_service_project_grant.rb +lib/zitadel/client/models/beta_project_service_project_grant_field_name.rb +lib/zitadel/client/models/beta_project_service_project_grant_search_filter.rb +lib/zitadel/client/models/beta_project_service_project_grant_state.rb +lib/zitadel/client/models/beta_project_service_project_name_filter.rb +lib/zitadel/client/models/beta_project_service_project_role.rb +lib/zitadel/client/models/beta_project_service_project_role_display_name_filter.rb +lib/zitadel/client/models/beta_project_service_project_role_field_name.rb +lib/zitadel/client/models/beta_project_service_project_role_key_filter.rb +lib/zitadel/client/models/beta_project_service_project_role_search_filter.rb +lib/zitadel/client/models/beta_project_service_project_search_filter.rb +lib/zitadel/client/models/beta_project_service_project_state.rb +lib/zitadel/client/models/beta_project_service_remove_project_role_request.rb +lib/zitadel/client/models/beta_project_service_remove_project_role_response.rb +lib/zitadel/client/models/beta_project_service_text_filter_method.rb +lib/zitadel/client/models/beta_project_service_update_project_grant_request.rb +lib/zitadel/client/models/beta_project_service_update_project_grant_response.rb +lib/zitadel/client/models/beta_project_service_update_project_request.rb +lib/zitadel/client/models/beta_project_service_update_project_response.rb +lib/zitadel/client/models/beta_project_service_update_project_role_request.rb +lib/zitadel/client/models/beta_project_service_update_project_role_response.rb +lib/zitadel/client/models/beta_session_service_any.rb +lib/zitadel/client/models/beta_session_service_challenges.rb +lib/zitadel/client/models/beta_session_service_check_idp_intent.rb +lib/zitadel/client/models/beta_session_service_check_otp.rb +lib/zitadel/client/models/beta_session_service_check_password.rb +lib/zitadel/client/models/beta_session_service_check_totp.rb +lib/zitadel/client/models/beta_session_service_check_user.rb +lib/zitadel/client/models/beta_session_service_check_web_auth_n.rb +lib/zitadel/client/models/beta_session_service_checks.rb +lib/zitadel/client/models/beta_session_service_connect_error.rb +lib/zitadel/client/models/beta_session_service_create_session_request.rb +lib/zitadel/client/models/beta_session_service_create_session_response.rb +lib/zitadel/client/models/beta_session_service_creation_date_query.rb +lib/zitadel/client/models/beta_session_service_delete_session_request.rb +lib/zitadel/client/models/beta_session_service_delete_session_response.rb +lib/zitadel/client/models/beta_session_service_details.rb +lib/zitadel/client/models/beta_session_service_factors.rb +lib/zitadel/client/models/beta_session_service_get_session_request.rb +lib/zitadel/client/models/beta_session_service_get_session_response.rb +lib/zitadel/client/models/beta_session_service_header_values.rb +lib/zitadel/client/models/beta_session_service_ids_query.rb +lib/zitadel/client/models/beta_session_service_intent_factor.rb +lib/zitadel/client/models/beta_session_service_list_details.rb +lib/zitadel/client/models/beta_session_service_list_query.rb +lib/zitadel/client/models/beta_session_service_list_sessions_request.rb +lib/zitadel/client/models/beta_session_service_list_sessions_response.rb +lib/zitadel/client/models/beta_session_service_otp_email.rb +lib/zitadel/client/models/beta_session_service_otp_factor.rb +lib/zitadel/client/models/beta_session_service_otpsms.rb +lib/zitadel/client/models/beta_session_service_password_factor.rb +lib/zitadel/client/models/beta_session_service_request_challenges.rb +lib/zitadel/client/models/beta_session_service_search_query.rb +lib/zitadel/client/models/beta_session_service_send_code.rb +lib/zitadel/client/models/beta_session_service_session.rb +lib/zitadel/client/models/beta_session_service_session_field_name.rb +lib/zitadel/client/models/beta_session_service_set_session_request.rb +lib/zitadel/client/models/beta_session_service_set_session_response.rb +lib/zitadel/client/models/beta_session_service_timestamp_query_method.rb +lib/zitadel/client/models/beta_session_service_totp_factor.rb +lib/zitadel/client/models/beta_session_service_user_agent.rb +lib/zitadel/client/models/beta_session_service_user_factor.rb +lib/zitadel/client/models/beta_session_service_user_id_query.rb +lib/zitadel/client/models/beta_session_service_user_verification_requirement.rb +lib/zitadel/client/models/beta_session_service_web_auth_n.rb +lib/zitadel/client/models/beta_session_service_web_auth_n_factor.rb +lib/zitadel/client/models/beta_settings_service_any.rb +lib/zitadel/client/models/beta_settings_service_branding_settings.rb +lib/zitadel/client/models/beta_settings_service_connect_error.rb +lib/zitadel/client/models/beta_settings_service_details.rb +lib/zitadel/client/models/beta_settings_service_domain_settings.rb +lib/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rb +lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rb +lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rb +lib/zitadel/client/models/beta_settings_service_get_branding_settings_request.rb +lib/zitadel/client/models/beta_settings_service_get_branding_settings_response.rb +lib/zitadel/client/models/beta_settings_service_get_domain_settings_request.rb +lib/zitadel/client/models/beta_settings_service_get_domain_settings_response.rb +lib/zitadel/client/models/beta_settings_service_get_general_settings_response.rb +lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rb +lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rb +lib/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rb +lib/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rb +lib/zitadel/client/models/beta_settings_service_get_login_settings_request.rb +lib/zitadel/client/models/beta_settings_service_get_login_settings_response.rb +lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rb +lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rb +lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rb +lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rb +lib/zitadel/client/models/beta_settings_service_get_security_settings_response.rb +lib/zitadel/client/models/beta_settings_service_identity_provider.rb +lib/zitadel/client/models/beta_settings_service_identity_provider_type.rb +lib/zitadel/client/models/beta_settings_service_legal_and_support_settings.rb +lib/zitadel/client/models/beta_settings_service_list_details.rb +lib/zitadel/client/models/beta_settings_service_lockout_settings.rb +lib/zitadel/client/models/beta_settings_service_login_settings.rb +lib/zitadel/client/models/beta_settings_service_multi_factor_type.rb +lib/zitadel/client/models/beta_settings_service_passkeys_type.rb +lib/zitadel/client/models/beta_settings_service_password_complexity_settings.rb +lib/zitadel/client/models/beta_settings_service_password_expiry_settings.rb +lib/zitadel/client/models/beta_settings_service_request_context.rb +lib/zitadel/client/models/beta_settings_service_resource_owner_type.rb +lib/zitadel/client/models/beta_settings_service_second_factor_type.rb +lib/zitadel/client/models/beta_settings_service_security_settings.rb +lib/zitadel/client/models/beta_settings_service_set_security_settings_request.rb +lib/zitadel/client/models/beta_settings_service_set_security_settings_response.rb +lib/zitadel/client/models/beta_settings_service_theme.rb +lib/zitadel/client/models/beta_settings_service_theme_mode.rb +lib/zitadel/client/models/beta_telemetry_service_any.rb +lib/zitadel/client/models/beta_telemetry_service_connect_error.rb +lib/zitadel/client/models/beta_telemetry_service_count_parent_type.rb +lib/zitadel/client/models/beta_telemetry_service_instance_information.rb +lib/zitadel/client/models/beta_telemetry_service_report_base_information_request.rb +lib/zitadel/client/models/beta_telemetry_service_report_base_information_response.rb +lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_request.rb +lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_response.rb +lib/zitadel/client/models/beta_telemetry_service_resource_count.rb +lib/zitadel/client/models/beta_user_service_access_token_type.rb +lib/zitadel/client/models/beta_user_service_add_human_user_request.rb +lib/zitadel/client/models/beta_user_service_add_human_user_response.rb +lib/zitadel/client/models/beta_user_service_add_idp_link_request.rb +lib/zitadel/client/models/beta_user_service_add_idp_link_response.rb +lib/zitadel/client/models/beta_user_service_add_otp_email_request.rb +lib/zitadel/client/models/beta_user_service_add_otp_email_response.rb +lib/zitadel/client/models/beta_user_service_add_otpsms_request.rb +lib/zitadel/client/models/beta_user_service_add_otpsms_response.rb +lib/zitadel/client/models/beta_user_service_and_query.rb +lib/zitadel/client/models/beta_user_service_any.rb +lib/zitadel/client/models/beta_user_service_authentication_method_type.rb +lib/zitadel/client/models/beta_user_service_connect_error.rb +lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rb +lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rb +lib/zitadel/client/models/beta_user_service_deactivate_user_request.rb +lib/zitadel/client/models/beta_user_service_deactivate_user_response.rb +lib/zitadel/client/models/beta_user_service_delete_user_request.rb +lib/zitadel/client/models/beta_user_service_delete_user_response.rb +lib/zitadel/client/models/beta_user_service_details.rb +lib/zitadel/client/models/beta_user_service_display_name_query.rb +lib/zitadel/client/models/beta_user_service_email_query.rb +lib/zitadel/client/models/beta_user_service_first_name_query.rb +lib/zitadel/client/models/beta_user_service_form_data.rb +lib/zitadel/client/models/beta_user_service_gender.rb +lib/zitadel/client/models/beta_user_service_get_user_by_id_request.rb +lib/zitadel/client/models/beta_user_service_get_user_by_id_response.rb +lib/zitadel/client/models/beta_user_service_hashed_password.rb +lib/zitadel/client/models/beta_user_service_human_email.rb +lib/zitadel/client/models/beta_user_service_human_phone.rb +lib/zitadel/client/models/beta_user_service_human_profile.rb +lib/zitadel/client/models/beta_user_service_human_user.rb +lib/zitadel/client/models/beta_user_service_idp_information.rb +lib/zitadel/client/models/beta_user_service_idp_intent.rb +lib/zitadel/client/models/beta_user_service_idp_link.rb +lib/zitadel/client/models/beta_user_service_idpldap_access_information.rb +lib/zitadel/client/models/beta_user_service_idpo_auth_access_information.rb +lib/zitadel/client/models/beta_user_service_idpsaml_access_information.rb +lib/zitadel/client/models/beta_user_service_in_user_emails_query.rb +lib/zitadel/client/models/beta_user_service_in_user_id_query.rb +lib/zitadel/client/models/beta_user_service_last_name_query.rb +lib/zitadel/client/models/beta_user_service_ldap_credentials.rb +lib/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rb +lib/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rb +lib/zitadel/client/models/beta_user_service_list_details.rb +lib/zitadel/client/models/beta_user_service_list_query.rb +lib/zitadel/client/models/beta_user_service_list_users_request.rb +lib/zitadel/client/models/beta_user_service_list_users_response.rb +lib/zitadel/client/models/beta_user_service_lock_user_request.rb +lib/zitadel/client/models/beta_user_service_lock_user_response.rb +lib/zitadel/client/models/beta_user_service_login_name_query.rb +lib/zitadel/client/models/beta_user_service_machine_user.rb +lib/zitadel/client/models/beta_user_service_nick_name_query.rb +lib/zitadel/client/models/beta_user_service_not_query.rb +lib/zitadel/client/models/beta_user_service_notification_type.rb +lib/zitadel/client/models/beta_user_service_or_query.rb +lib/zitadel/client/models/beta_user_service_organization.rb +lib/zitadel/client/models/beta_user_service_organization_id_query.rb +lib/zitadel/client/models/beta_user_service_passkey_authenticator.rb +lib/zitadel/client/models/beta_user_service_passkey_registration_code.rb +lib/zitadel/client/models/beta_user_service_password.rb +lib/zitadel/client/models/beta_user_service_password_reset_request.rb +lib/zitadel/client/models/beta_user_service_password_reset_response.rb +lib/zitadel/client/models/beta_user_service_phone_query.rb +lib/zitadel/client/models/beta_user_service_reactivate_user_request.rb +lib/zitadel/client/models/beta_user_service_reactivate_user_response.rb +lib/zitadel/client/models/beta_user_service_redirect_urls.rb +lib/zitadel/client/models/beta_user_service_register_passkey_request.rb +lib/zitadel/client/models/beta_user_service_register_passkey_response.rb +lib/zitadel/client/models/beta_user_service_register_totp_request.rb +lib/zitadel/client/models/beta_user_service_register_totp_response.rb +lib/zitadel/client/models/beta_user_service_register_u2_f_request.rb +lib/zitadel/client/models/beta_user_service_register_u2_f_response.rb +lib/zitadel/client/models/beta_user_service_remove_otp_email_request.rb +lib/zitadel/client/models/beta_user_service_remove_otp_email_response.rb +lib/zitadel/client/models/beta_user_service_remove_otpsms_request.rb +lib/zitadel/client/models/beta_user_service_remove_otpsms_response.rb +lib/zitadel/client/models/beta_user_service_remove_phone_request.rb +lib/zitadel/client/models/beta_user_service_remove_phone_response.rb +lib/zitadel/client/models/beta_user_service_remove_totp_request.rb +lib/zitadel/client/models/beta_user_service_remove_totp_response.rb +lib/zitadel/client/models/beta_user_service_resend_email_code_request.rb +lib/zitadel/client/models/beta_user_service_resend_email_code_response.rb +lib/zitadel/client/models/beta_user_service_resend_phone_code_request.rb +lib/zitadel/client/models/beta_user_service_resend_phone_code_response.rb +lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rb +lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rb +lib/zitadel/client/models/beta_user_service_search_query.rb +lib/zitadel/client/models/beta_user_service_send_email_verification_code.rb +lib/zitadel/client/models/beta_user_service_send_passkey_registration_link.rb +lib/zitadel/client/models/beta_user_service_send_password_reset_link.rb +lib/zitadel/client/models/beta_user_service_set_email_request.rb +lib/zitadel/client/models/beta_user_service_set_email_response.rb +lib/zitadel/client/models/beta_user_service_set_human_email.rb +lib/zitadel/client/models/beta_user_service_set_human_phone.rb +lib/zitadel/client/models/beta_user_service_set_human_profile.rb +lib/zitadel/client/models/beta_user_service_set_metadata_entry.rb +lib/zitadel/client/models/beta_user_service_set_password.rb +lib/zitadel/client/models/beta_user_service_set_password_request.rb +lib/zitadel/client/models/beta_user_service_set_password_response.rb +lib/zitadel/client/models/beta_user_service_set_phone_request.rb +lib/zitadel/client/models/beta_user_service_set_phone_response.rb +lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rb +lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rb +lib/zitadel/client/models/beta_user_service_state_query.rb +lib/zitadel/client/models/beta_user_service_text_query_method.rb +lib/zitadel/client/models/beta_user_service_type.rb +lib/zitadel/client/models/beta_user_service_type_query.rb +lib/zitadel/client/models/beta_user_service_unlock_user_request.rb +lib/zitadel/client/models/beta_user_service_unlock_user_response.rb +lib/zitadel/client/models/beta_user_service_update_human_user_request.rb +lib/zitadel/client/models/beta_user_service_update_human_user_response.rb +lib/zitadel/client/models/beta_user_service_user.rb +lib/zitadel/client/models/beta_user_service_user_field_name.rb +lib/zitadel/client/models/beta_user_service_user_name_query.rb +lib/zitadel/client/models/beta_user_service_user_state.rb +lib/zitadel/client/models/beta_user_service_verify_email_request.rb +lib/zitadel/client/models/beta_user_service_verify_email_response.rb +lib/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rb +lib/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rb +lib/zitadel/client/models/beta_user_service_verify_phone_request.rb +lib/zitadel/client/models/beta_user_service_verify_phone_response.rb +lib/zitadel/client/models/beta_user_service_verify_totp_registration_request.rb +lib/zitadel/client/models/beta_user_service_verify_totp_registration_response.rb +lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rb +lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rb +lib/zitadel/client/models/beta_web_key_service_activate_web_key_request.rb +lib/zitadel/client/models/beta_web_key_service_activate_web_key_response.rb +lib/zitadel/client/models/beta_web_key_service_any.rb +lib/zitadel/client/models/beta_web_key_service_connect_error.rb +lib/zitadel/client/models/beta_web_key_service_create_web_key_request.rb +lib/zitadel/client/models/beta_web_key_service_create_web_key_response.rb +lib/zitadel/client/models/beta_web_key_service_delete_web_key_request.rb +lib/zitadel/client/models/beta_web_key_service_delete_web_key_response.rb +lib/zitadel/client/models/beta_web_key_service_ecdsa.rb +lib/zitadel/client/models/beta_web_key_service_ecdsa_curve.rb +lib/zitadel/client/models/beta_web_key_service_list_web_keys_response.rb +lib/zitadel/client/models/beta_web_key_service_rsa.rb +lib/zitadel/client/models/beta_web_key_service_rsa_bits.rb +lib/zitadel/client/models/beta_web_key_service_rsa_hasher.rb +lib/zitadel/client/models/beta_web_key_service_state.rb +lib/zitadel/client/models/beta_web_key_service_web_key.rb +lib/zitadel/client/models/feature_service_any.rb +lib/zitadel/client/models/feature_service_connect_error.rb +lib/zitadel/client/models/feature_service_details.rb +lib/zitadel/client/models/feature_service_feature_flag.rb +lib/zitadel/client/models/feature_service_get_instance_features_request.rb +lib/zitadel/client/models/feature_service_get_instance_features_response.rb +lib/zitadel/client/models/feature_service_get_organization_features_request.rb +lib/zitadel/client/models/feature_service_get_organization_features_response.rb +lib/zitadel/client/models/feature_service_get_system_features_response.rb +lib/zitadel/client/models/feature_service_get_user_features_request.rb +lib/zitadel/client/models/feature_service_get_user_features_response.rb +lib/zitadel/client/models/feature_service_improved_performance.rb +lib/zitadel/client/models/feature_service_improved_performance_feature_flag.rb +lib/zitadel/client/models/feature_service_login_v2.rb +lib/zitadel/client/models/feature_service_login_v2_feature_flag.rb +lib/zitadel/client/models/feature_service_reset_instance_features_response.rb +lib/zitadel/client/models/feature_service_reset_organization_features_request.rb +lib/zitadel/client/models/feature_service_reset_organization_features_response.rb +lib/zitadel/client/models/feature_service_reset_system_features_response.rb +lib/zitadel/client/models/feature_service_reset_user_features_request.rb +lib/zitadel/client/models/feature_service_reset_user_features_response.rb +lib/zitadel/client/models/feature_service_set_instance_features_request.rb +lib/zitadel/client/models/feature_service_set_instance_features_response.rb +lib/zitadel/client/models/feature_service_set_organization_features_request.rb +lib/zitadel/client/models/feature_service_set_organization_features_response.rb +lib/zitadel/client/models/feature_service_set_system_features_request.rb +lib/zitadel/client/models/feature_service_set_system_features_response.rb +lib/zitadel/client/models/feature_service_set_user_feature_request.rb +lib/zitadel/client/models/feature_service_set_user_features_response.rb +lib/zitadel/client/models/feature_service_source.rb +lib/zitadel/client/models/identity_provider_service_any.rb +lib/zitadel/client/models/identity_provider_service_apple_config.rb +lib/zitadel/client/models/identity_provider_service_auto_linking_option.rb +lib/zitadel/client/models/identity_provider_service_azure_ad_config.rb +lib/zitadel/client/models/identity_provider_service_azure_ad_tenant.rb +lib/zitadel/client/models/identity_provider_service_azure_ad_tenant_type.rb +lib/zitadel/client/models/identity_provider_service_connect_error.rb +lib/zitadel/client/models/identity_provider_service_details.rb +lib/zitadel/client/models/identity_provider_service_generic_oidc_config.rb +lib/zitadel/client/models/identity_provider_service_get_idpby_id_request.rb +lib/zitadel/client/models/identity_provider_service_get_idpby_id_response.rb +lib/zitadel/client/models/identity_provider_service_git_hub_config.rb +lib/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rb +lib/zitadel/client/models/identity_provider_service_git_lab_config.rb +lib/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rb +lib/zitadel/client/models/identity_provider_service_google_config.rb +lib/zitadel/client/models/identity_provider_service_idp.rb +lib/zitadel/client/models/identity_provider_service_idp_config.rb +lib/zitadel/client/models/identity_provider_service_idp_state.rb +lib/zitadel/client/models/identity_provider_service_idp_type.rb +lib/zitadel/client/models/identity_provider_service_jwt_config.rb +lib/zitadel/client/models/identity_provider_service_ldap_attributes.rb +lib/zitadel/client/models/identity_provider_service_ldap_config.rb +lib/zitadel/client/models/identity_provider_service_o_auth_config.rb +lib/zitadel/client/models/identity_provider_service_options.rb +lib/zitadel/client/models/identity_provider_service_saml_binding.rb +lib/zitadel/client/models/identity_provider_service_saml_config.rb +lib/zitadel/client/models/identity_provider_service_saml_name_id_format.rb +lib/zitadel/client/models/identity_provider_service_saml_signature_algorithm.rb +lib/zitadel/client/models/instance_service_add_custom_domain_request.rb +lib/zitadel/client/models/instance_service_add_custom_domain_response.rb +lib/zitadel/client/models/instance_service_add_trusted_domain_request.rb +lib/zitadel/client/models/instance_service_add_trusted_domain_response.rb +lib/zitadel/client/models/instance_service_any.rb +lib/zitadel/client/models/instance_service_connect_error.rb +lib/zitadel/client/models/instance_service_custom_domain.rb +lib/zitadel/client/models/instance_service_custom_domain_filter.rb +lib/zitadel/client/models/instance_service_custom_domains_filter.rb +lib/zitadel/client/models/instance_service_delete_instance_request.rb +lib/zitadel/client/models/instance_service_delete_instance_response.rb +lib/zitadel/client/models/instance_service_domain_field_name.rb +lib/zitadel/client/models/instance_service_domain_filter.rb +lib/zitadel/client/models/instance_service_field_name.rb +lib/zitadel/client/models/instance_service_filter.rb +lib/zitadel/client/models/instance_service_get_instance_request.rb +lib/zitadel/client/models/instance_service_get_instance_response.rb +lib/zitadel/client/models/instance_service_in_ids_filter.rb +lib/zitadel/client/models/instance_service_instance.rb +lib/zitadel/client/models/instance_service_list_custom_domains_request.rb +lib/zitadel/client/models/instance_service_list_custom_domains_response.rb +lib/zitadel/client/models/instance_service_list_instances_request.rb +lib/zitadel/client/models/instance_service_list_instances_response.rb +lib/zitadel/client/models/instance_service_list_trusted_domains_request.rb +lib/zitadel/client/models/instance_service_list_trusted_domains_response.rb +lib/zitadel/client/models/instance_service_pagination_request.rb +lib/zitadel/client/models/instance_service_pagination_response.rb +lib/zitadel/client/models/instance_service_remove_custom_domain_request.rb +lib/zitadel/client/models/instance_service_remove_custom_domain_response.rb +lib/zitadel/client/models/instance_service_remove_trusted_domain_request.rb +lib/zitadel/client/models/instance_service_remove_trusted_domain_response.rb +lib/zitadel/client/models/instance_service_state.rb +lib/zitadel/client/models/instance_service_text_query_method.rb +lib/zitadel/client/models/instance_service_trusted_domain.rb +lib/zitadel/client/models/instance_service_trusted_domain_field_name.rb +lib/zitadel/client/models/instance_service_trusted_domain_filter.rb +lib/zitadel/client/models/instance_service_update_instance_request.rb +lib/zitadel/client/models/instance_service_update_instance_response.rb +lib/zitadel/client/models/internal_permission_service_administrator.rb +lib/zitadel/client/models/internal_permission_service_administrator_field_name.rb +lib/zitadel/client/models/internal_permission_service_administrator_search_filter.rb +lib/zitadel/client/models/internal_permission_service_and_filter.rb +lib/zitadel/client/models/internal_permission_service_any.rb +lib/zitadel/client/models/internal_permission_service_connect_error.rb +lib/zitadel/client/models/internal_permission_service_create_administrator_request.rb +lib/zitadel/client/models/internal_permission_service_create_administrator_response.rb +lib/zitadel/client/models/internal_permission_service_delete_administrator_request.rb +lib/zitadel/client/models/internal_permission_service_delete_administrator_response.rb +lib/zitadel/client/models/internal_permission_service_id_filter.rb +lib/zitadel/client/models/internal_permission_service_in_ids_filter.rb +lib/zitadel/client/models/internal_permission_service_list_administrators_request.rb +lib/zitadel/client/models/internal_permission_service_list_administrators_response.rb +lib/zitadel/client/models/internal_permission_service_not_filter.rb +lib/zitadel/client/models/internal_permission_service_or_filter.rb +lib/zitadel/client/models/internal_permission_service_organization.rb +lib/zitadel/client/models/internal_permission_service_pagination_request.rb +lib/zitadel/client/models/internal_permission_service_pagination_response.rb +lib/zitadel/client/models/internal_permission_service_project.rb +lib/zitadel/client/models/internal_permission_service_project_grant.rb +lib/zitadel/client/models/internal_permission_service_resource_filter.rb +lib/zitadel/client/models/internal_permission_service_resource_type.rb +lib/zitadel/client/models/internal_permission_service_role_filter.rb +lib/zitadel/client/models/internal_permission_service_text_filter_method.rb +lib/zitadel/client/models/internal_permission_service_timestamp_filter.rb +lib/zitadel/client/models/internal_permission_service_timestamp_filter_method.rb +lib/zitadel/client/models/internal_permission_service_update_administrator_request.rb +lib/zitadel/client/models/internal_permission_service_update_administrator_response.rb +lib/zitadel/client/models/internal_permission_service_user.rb +lib/zitadel/client/models/internal_permission_service_user_display_name_filter.rb +lib/zitadel/client/models/internal_permission_service_user_preferred_login_name_filter.rb +lib/zitadel/client/models/oidc_service_any.rb +lib/zitadel/client/models/oidc_service_auth_request.rb +lib/zitadel/client/models/oidc_service_authorization_error.rb +lib/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rb +lib/zitadel/client/models/oidc_service_connect_error.rb +lib/zitadel/client/models/oidc_service_create_callback_request.rb +lib/zitadel/client/models/oidc_service_create_callback_response.rb +lib/zitadel/client/models/oidc_service_details.rb +lib/zitadel/client/models/oidc_service_device_authorization_request.rb +lib/zitadel/client/models/oidc_service_error_reason.rb +lib/zitadel/client/models/oidc_service_get_auth_request_request.rb +lib/zitadel/client/models/oidc_service_get_auth_request_response.rb +lib/zitadel/client/models/oidc_service_get_device_authorization_request_request.rb +lib/zitadel/client/models/oidc_service_get_device_authorization_request_response.rb +lib/zitadel/client/models/oidc_service_prompt.rb +lib/zitadel/client/models/oidc_service_session.rb +lib/zitadel/client/models/organization_service_activate_organization_request.rb +lib/zitadel/client/models/organization_service_activate_organization_response.rb +lib/zitadel/client/models/organization_service_add_human_user_request.rb +lib/zitadel/client/models/organization_service_add_organization_domain_request.rb +lib/zitadel/client/models/organization_service_add_organization_domain_response.rb +lib/zitadel/client/models/organization_service_add_organization_request.rb +lib/zitadel/client/models/organization_service_add_organization_response.rb +lib/zitadel/client/models/organization_service_admin.rb +lib/zitadel/client/models/organization_service_any.rb +lib/zitadel/client/models/organization_service_connect_error.rb +lib/zitadel/client/models/organization_service_created_admin.rb +lib/zitadel/client/models/organization_service_deactivate_organization_request.rb +lib/zitadel/client/models/organization_service_deactivate_organization_response.rb +lib/zitadel/client/models/organization_service_delete_organization_domain_request.rb +lib/zitadel/client/models/organization_service_delete_organization_domain_response.rb +lib/zitadel/client/models/organization_service_delete_organization_metadata_request.rb +lib/zitadel/client/models/organization_service_delete_organization_metadata_response.rb +lib/zitadel/client/models/organization_service_delete_organization_request.rb +lib/zitadel/client/models/organization_service_delete_organization_response.rb +lib/zitadel/client/models/organization_service_details.rb +lib/zitadel/client/models/organization_service_domain.rb +lib/zitadel/client/models/organization_service_domain_field_name.rb +lib/zitadel/client/models/organization_service_domain_search_filter.rb +lib/zitadel/client/models/organization_service_domain_validation_type.rb +lib/zitadel/client/models/organization_service_gender.rb +lib/zitadel/client/models/organization_service_generate_organization_domain_validation_request.rb +lib/zitadel/client/models/organization_service_generate_organization_domain_validation_response.rb +lib/zitadel/client/models/organization_service_hashed_password.rb +lib/zitadel/client/models/organization_service_idp_link.rb +lib/zitadel/client/models/organization_service_list_details.rb +lib/zitadel/client/models/organization_service_list_organization_domains_request.rb +lib/zitadel/client/models/organization_service_list_organization_domains_response.rb +lib/zitadel/client/models/organization_service_list_organization_metadata_request.rb +lib/zitadel/client/models/organization_service_list_organization_metadata_response.rb +lib/zitadel/client/models/organization_service_list_organizations_request.rb +lib/zitadel/client/models/organization_service_list_organizations_response.rb +lib/zitadel/client/models/organization_service_list_query.rb +lib/zitadel/client/models/organization_service_metadata.rb +lib/zitadel/client/models/organization_service_metadata_key_filter.rb +lib/zitadel/client/models/organization_service_metadata_search_filter.rb +lib/zitadel/client/models/organization_service_organization.rb +lib/zitadel/client/models/organization_service_organization_domain_query.rb +lib/zitadel/client/models/organization_service_organization_field_name.rb +lib/zitadel/client/models/organization_service_organization_id_query.rb +lib/zitadel/client/models/organization_service_organization_name_query.rb +lib/zitadel/client/models/organization_service_organization_state.rb +lib/zitadel/client/models/organization_service_organization_state_query.rb +lib/zitadel/client/models/organization_service_pagination_request.rb +lib/zitadel/client/models/organization_service_pagination_response.rb +lib/zitadel/client/models/organization_service_password.rb +lib/zitadel/client/models/organization_service_search_query.rb +lib/zitadel/client/models/organization_service_send_email_verification_code.rb +lib/zitadel/client/models/organization_service_set_human_email.rb +lib/zitadel/client/models/organization_service_set_human_phone.rb +lib/zitadel/client/models/organization_service_set_human_profile.rb +lib/zitadel/client/models/organization_service_set_metadata_entry.rb +lib/zitadel/client/models/organization_service_set_organization_metadata_request.rb +lib/zitadel/client/models/organization_service_set_organization_metadata_response.rb +lib/zitadel/client/models/organization_service_text_filter_method.rb +lib/zitadel/client/models/organization_service_text_query_method.rb +lib/zitadel/client/models/organization_service_update_organization_request.rb +lib/zitadel/client/models/organization_service_update_organization_response.rb +lib/zitadel/client/models/organization_service_verify_organization_domain_request.rb +lib/zitadel/client/models/organization_service_verify_organization_domain_response.rb +lib/zitadel/client/models/project_service_activate_project_grant_request.rb +lib/zitadel/client/models/project_service_activate_project_grant_response.rb +lib/zitadel/client/models/project_service_activate_project_request.rb +lib/zitadel/client/models/project_service_activate_project_response.rb +lib/zitadel/client/models/project_service_add_project_role_request.rb +lib/zitadel/client/models/project_service_add_project_role_response.rb +lib/zitadel/client/models/project_service_any.rb +lib/zitadel/client/models/project_service_connect_error.rb +lib/zitadel/client/models/project_service_create_project_grant_request.rb +lib/zitadel/client/models/project_service_create_project_grant_response.rb +lib/zitadel/client/models/project_service_create_project_request.rb +lib/zitadel/client/models/project_service_create_project_response.rb +lib/zitadel/client/models/project_service_deactivate_project_grant_request.rb +lib/zitadel/client/models/project_service_deactivate_project_grant_response.rb +lib/zitadel/client/models/project_service_deactivate_project_request.rb +lib/zitadel/client/models/project_service_deactivate_project_response.rb +lib/zitadel/client/models/project_service_delete_project_grant_request.rb +lib/zitadel/client/models/project_service_delete_project_grant_response.rb +lib/zitadel/client/models/project_service_delete_project_request.rb +lib/zitadel/client/models/project_service_delete_project_response.rb +lib/zitadel/client/models/project_service_get_project_request.rb +lib/zitadel/client/models/project_service_get_project_response.rb +lib/zitadel/client/models/project_service_granted_project_state.rb +lib/zitadel/client/models/project_service_id_filter.rb +lib/zitadel/client/models/project_service_in_ids_filter.rb +lib/zitadel/client/models/project_service_list_project_grants_request.rb +lib/zitadel/client/models/project_service_list_project_grants_response.rb +lib/zitadel/client/models/project_service_list_project_roles_request.rb +lib/zitadel/client/models/project_service_list_project_roles_response.rb +lib/zitadel/client/models/project_service_list_projects_request.rb +lib/zitadel/client/models/project_service_list_projects_response.rb +lib/zitadel/client/models/project_service_pagination_request.rb +lib/zitadel/client/models/project_service_pagination_response.rb +lib/zitadel/client/models/project_service_private_labeling_setting.rb +lib/zitadel/client/models/project_service_project.rb +lib/zitadel/client/models/project_service_project_field_name.rb +lib/zitadel/client/models/project_service_project_grant.rb +lib/zitadel/client/models/project_service_project_grant_field_name.rb +lib/zitadel/client/models/project_service_project_grant_search_filter.rb +lib/zitadel/client/models/project_service_project_grant_state.rb +lib/zitadel/client/models/project_service_project_name_filter.rb +lib/zitadel/client/models/project_service_project_organization_id_filter.rb +lib/zitadel/client/models/project_service_project_role.rb +lib/zitadel/client/models/project_service_project_role_display_name_filter.rb +lib/zitadel/client/models/project_service_project_role_field_name.rb +lib/zitadel/client/models/project_service_project_role_key_filter.rb +lib/zitadel/client/models/project_service_project_role_search_filter.rb +lib/zitadel/client/models/project_service_project_search_filter.rb +lib/zitadel/client/models/project_service_project_state.rb +lib/zitadel/client/models/project_service_remove_project_role_request.rb +lib/zitadel/client/models/project_service_remove_project_role_response.rb +lib/zitadel/client/models/project_service_text_filter_method.rb +lib/zitadel/client/models/project_service_type.rb +lib/zitadel/client/models/project_service_update_project_grant_request.rb +lib/zitadel/client/models/project_service_update_project_grant_response.rb +lib/zitadel/client/models/project_service_update_project_request.rb +lib/zitadel/client/models/project_service_update_project_response.rb +lib/zitadel/client/models/project_service_update_project_role_request.rb +lib/zitadel/client/models/project_service_update_project_role_response.rb +lib/zitadel/client/models/saml_service_any.rb +lib/zitadel/client/models/saml_service_authorization_error.rb +lib/zitadel/client/models/saml_service_connect_error.rb +lib/zitadel/client/models/saml_service_create_response_request.rb +lib/zitadel/client/models/saml_service_create_response_response.rb +lib/zitadel/client/models/saml_service_details.rb +lib/zitadel/client/models/saml_service_error_reason.rb +lib/zitadel/client/models/saml_service_get_saml_request_request.rb +lib/zitadel/client/models/saml_service_get_saml_request_response.rb +lib/zitadel/client/models/saml_service_post_response.rb +lib/zitadel/client/models/saml_service_saml_request.rb +lib/zitadel/client/models/saml_service_session.rb +lib/zitadel/client/models/session_service_any.rb +lib/zitadel/client/models/session_service_challenges.rb +lib/zitadel/client/models/session_service_check_idp_intent.rb +lib/zitadel/client/models/session_service_check_otp.rb +lib/zitadel/client/models/session_service_check_password.rb +lib/zitadel/client/models/session_service_check_recovery_code.rb +lib/zitadel/client/models/session_service_check_totp.rb +lib/zitadel/client/models/session_service_check_user.rb +lib/zitadel/client/models/session_service_check_web_auth_n.rb +lib/zitadel/client/models/session_service_checks.rb +lib/zitadel/client/models/session_service_connect_error.rb +lib/zitadel/client/models/session_service_create_session_request.rb +lib/zitadel/client/models/session_service_create_session_response.rb +lib/zitadel/client/models/session_service_creation_date_query.rb +lib/zitadel/client/models/session_service_creator_query.rb +lib/zitadel/client/models/session_service_delete_session_request.rb +lib/zitadel/client/models/session_service_delete_session_response.rb +lib/zitadel/client/models/session_service_details.rb +lib/zitadel/client/models/session_service_expiration_date_query.rb +lib/zitadel/client/models/session_service_factors.rb +lib/zitadel/client/models/session_service_get_session_request.rb +lib/zitadel/client/models/session_service_get_session_response.rb +lib/zitadel/client/models/session_service_header_values.rb +lib/zitadel/client/models/session_service_ids_query.rb +lib/zitadel/client/models/session_service_intent_factor.rb +lib/zitadel/client/models/session_service_list_details.rb +lib/zitadel/client/models/session_service_list_query.rb +lib/zitadel/client/models/session_service_list_sessions_request.rb +lib/zitadel/client/models/session_service_list_sessions_response.rb +lib/zitadel/client/models/session_service_otp_email.rb +lib/zitadel/client/models/session_service_otp_factor.rb +lib/zitadel/client/models/session_service_otpsms.rb +lib/zitadel/client/models/session_service_password_factor.rb +lib/zitadel/client/models/session_service_recovery_code_factor.rb +lib/zitadel/client/models/session_service_request_challenges.rb +lib/zitadel/client/models/session_service_search_query.rb +lib/zitadel/client/models/session_service_send_code.rb +lib/zitadel/client/models/session_service_session.rb +lib/zitadel/client/models/session_service_session_field_name.rb +lib/zitadel/client/models/session_service_set_session_request.rb +lib/zitadel/client/models/session_service_set_session_response.rb +lib/zitadel/client/models/session_service_timestamp_query_method.rb +lib/zitadel/client/models/session_service_totp_factor.rb +lib/zitadel/client/models/session_service_user_agent.rb +lib/zitadel/client/models/session_service_user_agent_query.rb +lib/zitadel/client/models/session_service_user_factor.rb +lib/zitadel/client/models/session_service_user_id_query.rb +lib/zitadel/client/models/session_service_user_verification_requirement.rb +lib/zitadel/client/models/session_service_web_auth_n.rb +lib/zitadel/client/models/session_service_web_auth_n_factor.rb +lib/zitadel/client/models/settings_service_any.rb +lib/zitadel/client/models/settings_service_auto_linking_option.rb +lib/zitadel/client/models/settings_service_branding_settings.rb +lib/zitadel/client/models/settings_service_connect_error.rb +lib/zitadel/client/models/settings_service_details.rb +lib/zitadel/client/models/settings_service_domain_settings.rb +lib/zitadel/client/models/settings_service_embedded_iframe_settings.rb +lib/zitadel/client/models/settings_service_get_active_identity_providers_request.rb +lib/zitadel/client/models/settings_service_get_active_identity_providers_response.rb +lib/zitadel/client/models/settings_service_get_branding_settings_request.rb +lib/zitadel/client/models/settings_service_get_branding_settings_response.rb +lib/zitadel/client/models/settings_service_get_domain_settings_request.rb +lib/zitadel/client/models/settings_service_get_domain_settings_response.rb +lib/zitadel/client/models/settings_service_get_general_settings_response.rb +lib/zitadel/client/models/settings_service_get_hosted_login_translation_request.rb +lib/zitadel/client/models/settings_service_get_hosted_login_translation_response.rb +lib/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rb +lib/zitadel/client/models/settings_service_get_legal_and_support_settings_response.rb +lib/zitadel/client/models/settings_service_get_lockout_settings_request.rb +lib/zitadel/client/models/settings_service_get_lockout_settings_response.rb +lib/zitadel/client/models/settings_service_get_login_settings_request.rb +lib/zitadel/client/models/settings_service_get_login_settings_response.rb +lib/zitadel/client/models/settings_service_get_password_complexity_settings_request.rb +lib/zitadel/client/models/settings_service_get_password_complexity_settings_response.rb +lib/zitadel/client/models/settings_service_get_password_expiry_settings_request.rb +lib/zitadel/client/models/settings_service_get_password_expiry_settings_response.rb +lib/zitadel/client/models/settings_service_get_security_settings_response.rb +lib/zitadel/client/models/settings_service_identity_provider.rb +lib/zitadel/client/models/settings_service_identity_provider_type.rb +lib/zitadel/client/models/settings_service_legal_and_support_settings.rb +lib/zitadel/client/models/settings_service_list_details.rb +lib/zitadel/client/models/settings_service_lockout_settings.rb +lib/zitadel/client/models/settings_service_login_settings.rb +lib/zitadel/client/models/settings_service_multi_factor_type.rb +lib/zitadel/client/models/settings_service_options.rb +lib/zitadel/client/models/settings_service_passkeys_type.rb +lib/zitadel/client/models/settings_service_password_complexity_settings.rb +lib/zitadel/client/models/settings_service_password_expiry_settings.rb +lib/zitadel/client/models/settings_service_request_context.rb +lib/zitadel/client/models/settings_service_resource_owner_type.rb +lib/zitadel/client/models/settings_service_second_factor_type.rb +lib/zitadel/client/models/settings_service_security_settings.rb +lib/zitadel/client/models/settings_service_set_hosted_login_translation_request.rb +lib/zitadel/client/models/settings_service_set_hosted_login_translation_response.rb +lib/zitadel/client/models/settings_service_set_security_settings_request.rb +lib/zitadel/client/models/settings_service_set_security_settings_response.rb +lib/zitadel/client/models/settings_service_theme.rb +lib/zitadel/client/models/settings_service_theme_mode.rb +lib/zitadel/client/models/user_service_access_token_type.rb +lib/zitadel/client/models/user_service_add_human_user_request.rb +lib/zitadel/client/models/user_service_add_human_user_response.rb +lib/zitadel/client/models/user_service_add_idp_link_request.rb +lib/zitadel/client/models/user_service_add_idp_link_response.rb +lib/zitadel/client/models/user_service_add_key_request.rb +lib/zitadel/client/models/user_service_add_key_response.rb +lib/zitadel/client/models/user_service_add_otp_email_request.rb +lib/zitadel/client/models/user_service_add_otp_email_response.rb +lib/zitadel/client/models/user_service_add_otpsms_request.rb +lib/zitadel/client/models/user_service_add_otpsms_response.rb +lib/zitadel/client/models/user_service_add_personal_access_token_request.rb +lib/zitadel/client/models/user_service_add_personal_access_token_response.rb +lib/zitadel/client/models/user_service_add_secret_request.rb +lib/zitadel/client/models/user_service_add_secret_response.rb +lib/zitadel/client/models/user_service_and_query.rb +lib/zitadel/client/models/user_service_any.rb +lib/zitadel/client/models/user_service_auth_factor.rb +lib/zitadel/client/models/user_service_auth_factor_state.rb +lib/zitadel/client/models/user_service_auth_factor_u2_f.rb +lib/zitadel/client/models/user_service_auth_factors.rb +lib/zitadel/client/models/user_service_authentication_method_type.rb +lib/zitadel/client/models/user_service_byte_filter_method.rb +lib/zitadel/client/models/user_service_connect_error.rb +lib/zitadel/client/models/user_service_create_invite_code_request.rb +lib/zitadel/client/models/user_service_create_invite_code_response.rb +lib/zitadel/client/models/user_service_create_passkey_registration_link_request.rb +lib/zitadel/client/models/user_service_create_passkey_registration_link_response.rb +lib/zitadel/client/models/user_service_create_user_request.rb +lib/zitadel/client/models/user_service_create_user_response.rb +lib/zitadel/client/models/user_service_deactivate_user_request.rb +lib/zitadel/client/models/user_service_deactivate_user_response.rb +lib/zitadel/client/models/user_service_delete_user_metadata_request.rb +lib/zitadel/client/models/user_service_delete_user_metadata_response.rb +lib/zitadel/client/models/user_service_delete_user_request.rb +lib/zitadel/client/models/user_service_delete_user_response.rb +lib/zitadel/client/models/user_service_details.rb +lib/zitadel/client/models/user_service_display_name_query.rb +lib/zitadel/client/models/user_service_domain_query.rb +lib/zitadel/client/models/user_service_email_query.rb +lib/zitadel/client/models/user_service_first_name_query.rb +lib/zitadel/client/models/user_service_form_data.rb +lib/zitadel/client/models/user_service_gender.rb +lib/zitadel/client/models/user_service_generate_recovery_codes_request.rb +lib/zitadel/client/models/user_service_generate_recovery_codes_response.rb +lib/zitadel/client/models/user_service_get_user_by_id_request.rb +lib/zitadel/client/models/user_service_get_user_by_id_response.rb +lib/zitadel/client/models/user_service_hashed_password.rb +lib/zitadel/client/models/user_service_human.rb +lib/zitadel/client/models/user_service_human_email.rb +lib/zitadel/client/models/user_service_human_mfa_init_skipped_request.rb +lib/zitadel/client/models/user_service_human_mfa_init_skipped_response.rb +lib/zitadel/client/models/user_service_human_phone.rb +lib/zitadel/client/models/user_service_human_profile.rb +lib/zitadel/client/models/user_service_human_user.rb +lib/zitadel/client/models/user_service_id_filter.rb +lib/zitadel/client/models/user_service_idp_information.rb +lib/zitadel/client/models/user_service_idp_intent.rb +lib/zitadel/client/models/user_service_idp_link.rb +lib/zitadel/client/models/user_service_idpldap_access_information.rb +lib/zitadel/client/models/user_service_idpo_auth_access_information.rb +lib/zitadel/client/models/user_service_idpsaml_access_information.rb +lib/zitadel/client/models/user_service_in_user_emails_query.rb +lib/zitadel/client/models/user_service_in_user_id_query.rb +lib/zitadel/client/models/user_service_key.rb +lib/zitadel/client/models/user_service_key_field_name.rb +lib/zitadel/client/models/user_service_keys_search_filter.rb +lib/zitadel/client/models/user_service_last_name_query.rb +lib/zitadel/client/models/user_service_ldap_credentials.rb +lib/zitadel/client/models/user_service_list_authentication_factors_request.rb +lib/zitadel/client/models/user_service_list_authentication_factors_response.rb +lib/zitadel/client/models/user_service_list_authentication_method_types_request.rb +lib/zitadel/client/models/user_service_list_authentication_method_types_response.rb +lib/zitadel/client/models/user_service_list_details.rb +lib/zitadel/client/models/user_service_list_idp_links_request.rb +lib/zitadel/client/models/user_service_list_idp_links_response.rb +lib/zitadel/client/models/user_service_list_keys_request.rb +lib/zitadel/client/models/user_service_list_keys_response.rb +lib/zitadel/client/models/user_service_list_passkeys_request.rb +lib/zitadel/client/models/user_service_list_passkeys_response.rb +lib/zitadel/client/models/user_service_list_personal_access_tokens_request.rb +lib/zitadel/client/models/user_service_list_personal_access_tokens_response.rb +lib/zitadel/client/models/user_service_list_query.rb +lib/zitadel/client/models/user_service_list_user_metadata_request.rb +lib/zitadel/client/models/user_service_list_user_metadata_response.rb +lib/zitadel/client/models/user_service_list_users_request.rb +lib/zitadel/client/models/user_service_list_users_response.rb +lib/zitadel/client/models/user_service_lock_user_request.rb +lib/zitadel/client/models/user_service_lock_user_response.rb +lib/zitadel/client/models/user_service_login_name_query.rb +lib/zitadel/client/models/user_service_machine.rb +lib/zitadel/client/models/user_service_machine_user.rb +lib/zitadel/client/models/user_service_metadata.rb +lib/zitadel/client/models/user_service_metadata_key_filter.rb +lib/zitadel/client/models/user_service_metadata_search_filter.rb +lib/zitadel/client/models/user_service_metadata_value_filter.rb +lib/zitadel/client/models/user_service_nick_name_query.rb +lib/zitadel/client/models/user_service_not_query.rb +lib/zitadel/client/models/user_service_notification_type.rb +lib/zitadel/client/models/user_service_or_query.rb +lib/zitadel/client/models/user_service_organization.rb +lib/zitadel/client/models/user_service_organization_id_query.rb +lib/zitadel/client/models/user_service_pagination_request.rb +lib/zitadel/client/models/user_service_pagination_response.rb +lib/zitadel/client/models/user_service_passkey.rb +lib/zitadel/client/models/user_service_passkey_authenticator.rb +lib/zitadel/client/models/user_service_passkey_registration_code.rb +lib/zitadel/client/models/user_service_password.rb +lib/zitadel/client/models/user_service_password_reset_request.rb +lib/zitadel/client/models/user_service_password_reset_response.rb +lib/zitadel/client/models/user_service_personal_access_token.rb +lib/zitadel/client/models/user_service_personal_access_token_field_name.rb +lib/zitadel/client/models/user_service_personal_access_tokens_search_filter.rb +lib/zitadel/client/models/user_service_phone_query.rb +lib/zitadel/client/models/user_service_profile.rb +lib/zitadel/client/models/user_service_reactivate_user_request.rb +lib/zitadel/client/models/user_service_reactivate_user_response.rb +lib/zitadel/client/models/user_service_redirect_urls.rb +lib/zitadel/client/models/user_service_register_passkey_request.rb +lib/zitadel/client/models/user_service_register_passkey_response.rb +lib/zitadel/client/models/user_service_register_totp_request.rb +lib/zitadel/client/models/user_service_register_totp_response.rb +lib/zitadel/client/models/user_service_register_u2_f_request.rb +lib/zitadel/client/models/user_service_register_u2_f_response.rb +lib/zitadel/client/models/user_service_remove_idp_link_request.rb +lib/zitadel/client/models/user_service_remove_idp_link_response.rb +lib/zitadel/client/models/user_service_remove_key_request.rb +lib/zitadel/client/models/user_service_remove_key_response.rb +lib/zitadel/client/models/user_service_remove_otp_email_request.rb +lib/zitadel/client/models/user_service_remove_otp_email_response.rb +lib/zitadel/client/models/user_service_remove_otpsms_request.rb +lib/zitadel/client/models/user_service_remove_otpsms_response.rb +lib/zitadel/client/models/user_service_remove_passkey_request.rb +lib/zitadel/client/models/user_service_remove_passkey_response.rb +lib/zitadel/client/models/user_service_remove_personal_access_token_request.rb +lib/zitadel/client/models/user_service_remove_personal_access_token_response.rb +lib/zitadel/client/models/user_service_remove_phone_request.rb +lib/zitadel/client/models/user_service_remove_phone_response.rb +lib/zitadel/client/models/user_service_remove_recovery_codes_request.rb +lib/zitadel/client/models/user_service_remove_recovery_codes_response.rb +lib/zitadel/client/models/user_service_remove_secret_request.rb +lib/zitadel/client/models/user_service_remove_secret_response.rb +lib/zitadel/client/models/user_service_remove_totp_request.rb +lib/zitadel/client/models/user_service_remove_totp_response.rb +lib/zitadel/client/models/user_service_remove_u2_f_request.rb +lib/zitadel/client/models/user_service_remove_u2_f_response.rb +lib/zitadel/client/models/user_service_resend_email_code_request.rb +lib/zitadel/client/models/user_service_resend_email_code_response.rb +lib/zitadel/client/models/user_service_resend_invite_code_request.rb +lib/zitadel/client/models/user_service_resend_invite_code_response.rb +lib/zitadel/client/models/user_service_resend_phone_code_request.rb +lib/zitadel/client/models/user_service_resend_phone_code_response.rb +lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rb +lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rb +lib/zitadel/client/models/user_service_search_query.rb +lib/zitadel/client/models/user_service_send_email_code_request.rb +lib/zitadel/client/models/user_service_send_email_code_response.rb +lib/zitadel/client/models/user_service_send_email_verification_code.rb +lib/zitadel/client/models/user_service_send_invite_code.rb +lib/zitadel/client/models/user_service_send_passkey_registration_link.rb +lib/zitadel/client/models/user_service_send_password_reset_link.rb +lib/zitadel/client/models/user_service_set_email_request.rb +lib/zitadel/client/models/user_service_set_email_response.rb +lib/zitadel/client/models/user_service_set_human_email.rb +lib/zitadel/client/models/user_service_set_human_phone.rb +lib/zitadel/client/models/user_service_set_human_profile.rb +lib/zitadel/client/models/user_service_set_metadata_entry.rb +lib/zitadel/client/models/user_service_set_password.rb +lib/zitadel/client/models/user_service_set_password_request.rb +lib/zitadel/client/models/user_service_set_password_response.rb +lib/zitadel/client/models/user_service_set_phone_request.rb +lib/zitadel/client/models/user_service_set_phone_response.rb +lib/zitadel/client/models/user_service_set_user_metadata_request.rb +lib/zitadel/client/models/user_service_set_user_metadata_response.rb +lib/zitadel/client/models/user_service_start_identity_provider_intent_request.rb +lib/zitadel/client/models/user_service_start_identity_provider_intent_response.rb +lib/zitadel/client/models/user_service_state_query.rb +lib/zitadel/client/models/user_service_text_filter_method.rb +lib/zitadel/client/models/user_service_text_query_method.rb +lib/zitadel/client/models/user_service_timestamp_filter.rb +lib/zitadel/client/models/user_service_timestamp_filter_method.rb +lib/zitadel/client/models/user_service_type.rb +lib/zitadel/client/models/user_service_type_query.rb +lib/zitadel/client/models/user_service_unlock_user_request.rb +lib/zitadel/client/models/user_service_unlock_user_response.rb +lib/zitadel/client/models/user_service_update_human_user_request.rb +lib/zitadel/client/models/user_service_update_human_user_response.rb +lib/zitadel/client/models/user_service_update_user_request.rb +lib/zitadel/client/models/user_service_update_user_response.rb +lib/zitadel/client/models/user_service_user.rb +lib/zitadel/client/models/user_service_user_field_name.rb +lib/zitadel/client/models/user_service_user_name_query.rb +lib/zitadel/client/models/user_service_user_state.rb +lib/zitadel/client/models/user_service_verify_email_request.rb +lib/zitadel/client/models/user_service_verify_email_response.rb +lib/zitadel/client/models/user_service_verify_invite_code_request.rb +lib/zitadel/client/models/user_service_verify_invite_code_response.rb +lib/zitadel/client/models/user_service_verify_passkey_registration_request.rb +lib/zitadel/client/models/user_service_verify_passkey_registration_response.rb +lib/zitadel/client/models/user_service_verify_phone_request.rb +lib/zitadel/client/models/user_service_verify_phone_response.rb +lib/zitadel/client/models/user_service_verify_totp_registration_request.rb +lib/zitadel/client/models/user_service_verify_totp_registration_response.rb +lib/zitadel/client/models/user_service_verify_u2_f_registration_request.rb +lib/zitadel/client/models/user_service_verify_u2_f_registration_response.rb +lib/zitadel/client/models/web_key_service_activate_web_key_request.rb +lib/zitadel/client/models/web_key_service_activate_web_key_response.rb +lib/zitadel/client/models/web_key_service_any.rb +lib/zitadel/client/models/web_key_service_connect_error.rb +lib/zitadel/client/models/web_key_service_create_web_key_request.rb +lib/zitadel/client/models/web_key_service_create_web_key_response.rb +lib/zitadel/client/models/web_key_service_delete_web_key_request.rb +lib/zitadel/client/models/web_key_service_delete_web_key_response.rb +lib/zitadel/client/models/web_key_service_ecdsa.rb +lib/zitadel/client/models/web_key_service_ecdsa_curve.rb +lib/zitadel/client/models/web_key_service_list_web_keys_response.rb +lib/zitadel/client/models/web_key_service_rsa.rb +lib/zitadel/client/models/web_key_service_rsa_bits.rb +lib/zitadel/client/models/web_key_service_rsa_hasher.rb +lib/zitadel/client/models/web_key_service_state.rb +lib/zitadel/client/models/web_key_service_web_key.rb +lib/zitadel/client/object_serializer.rb +lib/zitadel/client/server_configuration.rb +lib/zitadel/client/servers.rb +lib/zitadel/client/trace_context_util.rb +lib/zitadel/client/transport_options.rb +lib/zitadel/client/value_serializer.rb +lib/zitadel/client/version.rb +lib/zitadel/client/zitadel.rb +lib/zitadel/client/zitadel_error.rb +sig/infrastructure.rbs +sig/vendor.rbs +sig/zitadel/client/api/action_service_api.rbs +sig/zitadel/client/api/application_service_api.rbs +sig/zitadel/client/api/authorization_service_api.rbs +sig/zitadel/client/api/beta_action_service_api.rbs +sig/zitadel/client/api/beta_app_service_api.rbs +sig/zitadel/client/api/beta_authorization_service_api.rbs +sig/zitadel/client/api/beta_feature_service_api.rbs +sig/zitadel/client/api/beta_instance_service_api.rbs +sig/zitadel/client/api/beta_internal_permission_service_api.rbs +sig/zitadel/client/api/beta_oidc_service_api.rbs +sig/zitadel/client/api/beta_organization_service_api.rbs +sig/zitadel/client/api/beta_project_service_api.rbs +sig/zitadel/client/api/beta_session_service_api.rbs +sig/zitadel/client/api/beta_settings_service_api.rbs +sig/zitadel/client/api/beta_telemetry_service_api.rbs +sig/zitadel/client/api/beta_user_service_api.rbs +sig/zitadel/client/api/beta_web_key_service_api.rbs +sig/zitadel/client/api/feature_service_api.rbs +sig/zitadel/client/api/identity_provider_service_api.rbs +sig/zitadel/client/api/instance_service_api.rbs +sig/zitadel/client/api/internal_permission_service_api.rbs +sig/zitadel/client/api/oidc_service_api.rbs +sig/zitadel/client/api/organization_service_api.rbs +sig/zitadel/client/api/project_service_api.rbs +sig/zitadel/client/api/saml_service_api.rbs +sig/zitadel/client/api/session_service_api.rbs +sig/zitadel/client/api/settings_service_api.rbs +sig/zitadel/client/api/user_service_api.rbs +sig/zitadel/client/api/web_key_service_api.rbs +sig/zitadel/client/auth/zitadel_access_token_authenticator.rbs +sig/zitadel/client/models/action_service_activate_public_key_request.rbs +sig/zitadel/client/models/action_service_activate_public_key_response.rbs +sig/zitadel/client/models/action_service_add_public_key_request.rbs +sig/zitadel/client/models/action_service_add_public_key_response.rbs +sig/zitadel/client/models/action_service_any.rbs +sig/zitadel/client/models/action_service_condition.rbs +sig/zitadel/client/models/action_service_connect_error.rbs +sig/zitadel/client/models/action_service_create_target_request.rbs +sig/zitadel/client/models/action_service_create_target_response.rbs +sig/zitadel/client/models/action_service_deactivate_public_key_request.rbs +sig/zitadel/client/models/action_service_deactivate_public_key_response.rbs +sig/zitadel/client/models/action_service_delete_target_request.rbs +sig/zitadel/client/models/action_service_delete_target_response.rbs +sig/zitadel/client/models/action_service_event_execution.rbs +sig/zitadel/client/models/action_service_execution.rbs +sig/zitadel/client/models/action_service_execution_field_name.rbs +sig/zitadel/client/models/action_service_execution_search_filter.rbs +sig/zitadel/client/models/action_service_execution_type.rbs +sig/zitadel/client/models/action_service_execution_type_filter.rbs +sig/zitadel/client/models/action_service_function_execution.rbs +sig/zitadel/client/models/action_service_get_target_request.rbs +sig/zitadel/client/models/action_service_get_target_response.rbs +sig/zitadel/client/models/action_service_in_conditions_filter.rbs +sig/zitadel/client/models/action_service_in_ids_filter.rbs +sig/zitadel/client/models/action_service_in_target_ids_filter.rbs +sig/zitadel/client/models/action_service_list_execution_functions_response.rbs +sig/zitadel/client/models/action_service_list_execution_methods_response.rbs +sig/zitadel/client/models/action_service_list_execution_services_response.rbs +sig/zitadel/client/models/action_service_list_executions_request.rbs +sig/zitadel/client/models/action_service_list_executions_response.rbs +sig/zitadel/client/models/action_service_list_public_keys_request.rbs +sig/zitadel/client/models/action_service_list_public_keys_response.rbs +sig/zitadel/client/models/action_service_list_targets_request.rbs +sig/zitadel/client/models/action_service_list_targets_response.rbs +sig/zitadel/client/models/action_service_pagination_request.rbs +sig/zitadel/client/models/action_service_pagination_response.rbs +sig/zitadel/client/models/action_service_payload_type.rbs +sig/zitadel/client/models/action_service_public_key.rbs +sig/zitadel/client/models/action_service_public_key_field_name.rbs +sig/zitadel/client/models/action_service_public_key_search_filter.rbs +sig/zitadel/client/models/action_service_remove_public_key_request.rbs +sig/zitadel/client/models/action_service_remove_public_key_response.rbs +sig/zitadel/client/models/action_service_request_execution.rbs +sig/zitadel/client/models/action_service_response_execution.rbs +sig/zitadel/client/models/action_service_rest_call.rbs +sig/zitadel/client/models/action_service_rest_webhook.rbs +sig/zitadel/client/models/action_service_set_execution_request.rbs +sig/zitadel/client/models/action_service_set_execution_response.rbs +sig/zitadel/client/models/action_service_target.rbs +sig/zitadel/client/models/action_service_target_field_name.rbs +sig/zitadel/client/models/action_service_target_filter.rbs +sig/zitadel/client/models/action_service_target_name_filter.rbs +sig/zitadel/client/models/action_service_target_search_filter.rbs +sig/zitadel/client/models/action_service_text_filter_method.rbs +sig/zitadel/client/models/action_service_timestamp_filter.rbs +sig/zitadel/client/models/action_service_timestamp_filter_method.rbs +sig/zitadel/client/models/action_service_update_target_request.rbs +sig/zitadel/client/models/action_service_update_target_response.rbs +sig/zitadel/client/models/application_service_any.rbs +sig/zitadel/client/models/application_service_api_auth_method_type.rbs +sig/zitadel/client/models/application_service_api_configuration.rbs +sig/zitadel/client/models/application_service_application.rbs +sig/zitadel/client/models/application_service_application_key.rbs +sig/zitadel/client/models/application_service_application_key_application_id_filter.rbs +sig/zitadel/client/models/application_service_application_key_organization_id_filter.rbs +sig/zitadel/client/models/application_service_application_key_project_id_filter.rbs +sig/zitadel/client/models/application_service_application_key_search_filter.rbs +sig/zitadel/client/models/application_service_application_keys_sorting.rbs +sig/zitadel/client/models/application_service_application_name_filter.rbs +sig/zitadel/client/models/application_service_application_search_filter.rbs +sig/zitadel/client/models/application_service_application_sorting.rbs +sig/zitadel/client/models/application_service_application_state.rbs +sig/zitadel/client/models/application_service_application_type.rbs +sig/zitadel/client/models/application_service_client_id_filter.rbs +sig/zitadel/client/models/application_service_connect_error.rbs +sig/zitadel/client/models/application_service_create_api_application_request.rbs +sig/zitadel/client/models/application_service_create_api_application_response.rbs +sig/zitadel/client/models/application_service_create_application_key_request.rbs +sig/zitadel/client/models/application_service_create_application_key_response.rbs +sig/zitadel/client/models/application_service_create_application_request.rbs +sig/zitadel/client/models/application_service_create_application_response.rbs +sig/zitadel/client/models/application_service_create_oidc_application_request.rbs +sig/zitadel/client/models/application_service_create_oidc_application_response.rbs +sig/zitadel/client/models/application_service_create_saml_application_request.rbs +sig/zitadel/client/models/application_service_deactivate_application_request.rbs +sig/zitadel/client/models/application_service_deactivate_application_response.rbs +sig/zitadel/client/models/application_service_delete_application_key_request.rbs +sig/zitadel/client/models/application_service_delete_application_key_response.rbs +sig/zitadel/client/models/application_service_delete_application_request.rbs +sig/zitadel/client/models/application_service_delete_application_response.rbs +sig/zitadel/client/models/application_service_entity_id_filter.rbs +sig/zitadel/client/models/application_service_generate_client_secret_request.rbs +sig/zitadel/client/models/application_service_generate_client_secret_response.rbs +sig/zitadel/client/models/application_service_get_application_key_request.rbs +sig/zitadel/client/models/application_service_get_application_key_response.rbs +sig/zitadel/client/models/application_service_get_application_request.rbs +sig/zitadel/client/models/application_service_get_application_response.rbs +sig/zitadel/client/models/application_service_list_application_keys_request.rbs +sig/zitadel/client/models/application_service_list_application_keys_response.rbs +sig/zitadel/client/models/application_service_list_applications_request.rbs +sig/zitadel/client/models/application_service_list_applications_response.rbs +sig/zitadel/client/models/application_service_login_v2.rbs +sig/zitadel/client/models/application_service_login_version.rbs +sig/zitadel/client/models/application_service_oidc_application_type.rbs +sig/zitadel/client/models/application_service_oidc_auth_method_type.rbs +sig/zitadel/client/models/application_service_oidc_configuration.rbs +sig/zitadel/client/models/application_service_oidc_grant_type.rbs +sig/zitadel/client/models/application_service_oidc_localized_message.rbs +sig/zitadel/client/models/application_service_oidc_response_type.rbs +sig/zitadel/client/models/application_service_oidc_token_type.rbs +sig/zitadel/client/models/application_service_oidc_version.rbs +sig/zitadel/client/models/application_service_pagination_request.rbs +sig/zitadel/client/models/application_service_pagination_response.rbs +sig/zitadel/client/models/application_service_project_id_filter.rbs +sig/zitadel/client/models/application_service_reactivate_application_request.rbs +sig/zitadel/client/models/application_service_reactivate_application_response.rbs +sig/zitadel/client/models/application_service_saml_configuration.rbs +sig/zitadel/client/models/application_service_text_filter_method.rbs +sig/zitadel/client/models/application_service_update_api_application_configuration_request.rbs +sig/zitadel/client/models/application_service_update_application_request.rbs +sig/zitadel/client/models/application_service_update_application_response.rbs +sig/zitadel/client/models/application_service_update_oidc_application_configuration_request.rbs +sig/zitadel/client/models/application_service_update_saml_application_configuration_request.rbs +sig/zitadel/client/models/authorization_service_activate_authorization_request.rbs +sig/zitadel/client/models/authorization_service_activate_authorization_response.rbs +sig/zitadel/client/models/authorization_service_any.rbs +sig/zitadel/client/models/authorization_service_authorization.rbs +sig/zitadel/client/models/authorization_service_authorization_field_name.rbs +sig/zitadel/client/models/authorization_service_authorizations_search_filter.rbs +sig/zitadel/client/models/authorization_service_connect_error.rbs +sig/zitadel/client/models/authorization_service_create_authorization_request.rbs +sig/zitadel/client/models/authorization_service_create_authorization_response.rbs +sig/zitadel/client/models/authorization_service_deactivate_authorization_request.rbs +sig/zitadel/client/models/authorization_service_deactivate_authorization_response.rbs +sig/zitadel/client/models/authorization_service_delete_authorization_request.rbs +sig/zitadel/client/models/authorization_service_delete_authorization_response.rbs +sig/zitadel/client/models/authorization_service_id_filter.rbs +sig/zitadel/client/models/authorization_service_in_ids_filter.rbs +sig/zitadel/client/models/authorization_service_list_authorizations_request.rbs +sig/zitadel/client/models/authorization_service_list_authorizations_response.rbs +sig/zitadel/client/models/authorization_service_organization.rbs +sig/zitadel/client/models/authorization_service_pagination_request.rbs +sig/zitadel/client/models/authorization_service_pagination_response.rbs +sig/zitadel/client/models/authorization_service_project.rbs +sig/zitadel/client/models/authorization_service_project_name_query.rbs +sig/zitadel/client/models/authorization_service_role.rbs +sig/zitadel/client/models/authorization_service_role_key_query.rbs +sig/zitadel/client/models/authorization_service_state.rbs +sig/zitadel/client/models/authorization_service_state_query.rbs +sig/zitadel/client/models/authorization_service_text_filter_method.rbs +sig/zitadel/client/models/authorization_service_update_authorization_request.rbs +sig/zitadel/client/models/authorization_service_update_authorization_response.rbs +sig/zitadel/client/models/authorization_service_user.rbs +sig/zitadel/client/models/authorization_service_user_display_name_query.rbs +sig/zitadel/client/models/authorization_service_user_preferred_login_name_query.rbs +sig/zitadel/client/models/beta_action_service_any.rbs +sig/zitadel/client/models/beta_action_service_condition.rbs +sig/zitadel/client/models/beta_action_service_connect_error.rbs +sig/zitadel/client/models/beta_action_service_create_target_request.rbs +sig/zitadel/client/models/beta_action_service_create_target_response.rbs +sig/zitadel/client/models/beta_action_service_delete_target_request.rbs +sig/zitadel/client/models/beta_action_service_delete_target_response.rbs +sig/zitadel/client/models/beta_action_service_event_execution.rbs +sig/zitadel/client/models/beta_action_service_execution.rbs +sig/zitadel/client/models/beta_action_service_execution_field_name.rbs +sig/zitadel/client/models/beta_action_service_execution_search_filter.rbs +sig/zitadel/client/models/beta_action_service_execution_type.rbs +sig/zitadel/client/models/beta_action_service_execution_type_filter.rbs +sig/zitadel/client/models/beta_action_service_function_execution.rbs +sig/zitadel/client/models/beta_action_service_get_target_request.rbs +sig/zitadel/client/models/beta_action_service_get_target_response.rbs +sig/zitadel/client/models/beta_action_service_in_conditions_filter.rbs +sig/zitadel/client/models/beta_action_service_in_target_ids_filter.rbs +sig/zitadel/client/models/beta_action_service_list_execution_functions_response.rbs +sig/zitadel/client/models/beta_action_service_list_execution_methods_response.rbs +sig/zitadel/client/models/beta_action_service_list_execution_services_response.rbs +sig/zitadel/client/models/beta_action_service_list_executions_request.rbs +sig/zitadel/client/models/beta_action_service_list_executions_response.rbs +sig/zitadel/client/models/beta_action_service_list_targets_request.rbs +sig/zitadel/client/models/beta_action_service_list_targets_response.rbs +sig/zitadel/client/models/beta_action_service_pagination_request.rbs +sig/zitadel/client/models/beta_action_service_pagination_response.rbs +sig/zitadel/client/models/beta_action_service_request_execution.rbs +sig/zitadel/client/models/beta_action_service_response_execution.rbs +sig/zitadel/client/models/beta_action_service_rest_call.rbs +sig/zitadel/client/models/beta_action_service_rest_webhook.rbs +sig/zitadel/client/models/beta_action_service_set_execution_request.rbs +sig/zitadel/client/models/beta_action_service_set_execution_response.rbs +sig/zitadel/client/models/beta_action_service_target.rbs +sig/zitadel/client/models/beta_action_service_target_field_name.rbs +sig/zitadel/client/models/beta_action_service_target_filter.rbs +sig/zitadel/client/models/beta_action_service_target_name_filter.rbs +sig/zitadel/client/models/beta_action_service_target_search_filter.rbs +sig/zitadel/client/models/beta_action_service_text_filter_method.rbs +sig/zitadel/client/models/beta_action_service_update_target_request.rbs +sig/zitadel/client/models/beta_action_service_update_target_response.rbs +sig/zitadel/client/models/beta_app_service_any.rbs +sig/zitadel/client/models/beta_app_service_api_auth_method_type.rbs +sig/zitadel/client/models/beta_app_service_api_config.rbs +sig/zitadel/client/models/beta_app_service_app_sorting.rbs +sig/zitadel/client/models/beta_app_service_app_state.rbs +sig/zitadel/client/models/beta_app_service_application.rbs +sig/zitadel/client/models/beta_app_service_application_key.rbs +sig/zitadel/client/models/beta_app_service_application_keys_sorting.rbs +sig/zitadel/client/models/beta_app_service_application_name_query.rbs +sig/zitadel/client/models/beta_app_service_application_search_filter.rbs +sig/zitadel/client/models/beta_app_service_connect_error.rbs +sig/zitadel/client/models/beta_app_service_create_api_application_request.rbs +sig/zitadel/client/models/beta_app_service_create_api_application_response.rbs +sig/zitadel/client/models/beta_app_service_create_application_key_request.rbs +sig/zitadel/client/models/beta_app_service_create_application_key_response.rbs +sig/zitadel/client/models/beta_app_service_create_application_request.rbs +sig/zitadel/client/models/beta_app_service_create_application_response.rbs +sig/zitadel/client/models/beta_app_service_create_oidc_application_request.rbs +sig/zitadel/client/models/beta_app_service_create_oidc_application_response.rbs +sig/zitadel/client/models/beta_app_service_create_saml_application_request.rbs +sig/zitadel/client/models/beta_app_service_deactivate_application_request.rbs +sig/zitadel/client/models/beta_app_service_deactivate_application_response.rbs +sig/zitadel/client/models/beta_app_service_delete_application_key_request.rbs +sig/zitadel/client/models/beta_app_service_delete_application_key_response.rbs +sig/zitadel/client/models/beta_app_service_delete_application_request.rbs +sig/zitadel/client/models/beta_app_service_delete_application_response.rbs +sig/zitadel/client/models/beta_app_service_get_application_key_request.rbs +sig/zitadel/client/models/beta_app_service_get_application_key_response.rbs +sig/zitadel/client/models/beta_app_service_get_application_request.rbs +sig/zitadel/client/models/beta_app_service_get_application_response.rbs +sig/zitadel/client/models/beta_app_service_list_application_keys_request.rbs +sig/zitadel/client/models/beta_app_service_list_application_keys_response.rbs +sig/zitadel/client/models/beta_app_service_list_applications_request.rbs +sig/zitadel/client/models/beta_app_service_list_applications_response.rbs +sig/zitadel/client/models/beta_app_service_login_v2.rbs +sig/zitadel/client/models/beta_app_service_login_version.rbs +sig/zitadel/client/models/beta_app_service_oidc_app_type.rbs +sig/zitadel/client/models/beta_app_service_oidc_auth_method_type.rbs +sig/zitadel/client/models/beta_app_service_oidc_config.rbs +sig/zitadel/client/models/beta_app_service_oidc_grant_type.rbs +sig/zitadel/client/models/beta_app_service_oidc_localized_message.rbs +sig/zitadel/client/models/beta_app_service_oidc_response_type.rbs +sig/zitadel/client/models/beta_app_service_oidc_token_type.rbs +sig/zitadel/client/models/beta_app_service_oidc_version.rbs +sig/zitadel/client/models/beta_app_service_pagination_request.rbs +sig/zitadel/client/models/beta_app_service_pagination_response.rbs +sig/zitadel/client/models/beta_app_service_reactivate_application_request.rbs +sig/zitadel/client/models/beta_app_service_reactivate_application_response.rbs +sig/zitadel/client/models/beta_app_service_regenerate_client_secret_request.rbs +sig/zitadel/client/models/beta_app_service_regenerate_client_secret_response.rbs +sig/zitadel/client/models/beta_app_service_saml_config.rbs +sig/zitadel/client/models/beta_app_service_text_filter_method.rbs +sig/zitadel/client/models/beta_app_service_update_api_application_configuration_request.rbs +sig/zitadel/client/models/beta_app_service_update_application_request.rbs +sig/zitadel/client/models/beta_app_service_update_application_response.rbs +sig/zitadel/client/models/beta_app_service_update_oidc_application_configuration_request.rbs +sig/zitadel/client/models/beta_app_service_update_saml_application_configuration_request.rbs +sig/zitadel/client/models/beta_authorization_service_activate_authorization_request.rbs +sig/zitadel/client/models/beta_authorization_service_activate_authorization_response.rbs +sig/zitadel/client/models/beta_authorization_service_any.rbs +sig/zitadel/client/models/beta_authorization_service_authorization.rbs +sig/zitadel/client/models/beta_authorization_service_authorization_field_name.rbs +sig/zitadel/client/models/beta_authorization_service_authorizations_search_filter.rbs +sig/zitadel/client/models/beta_authorization_service_connect_error.rbs +sig/zitadel/client/models/beta_authorization_service_create_authorization_request.rbs +sig/zitadel/client/models/beta_authorization_service_create_authorization_response.rbs +sig/zitadel/client/models/beta_authorization_service_deactivate_authorization_request.rbs +sig/zitadel/client/models/beta_authorization_service_deactivate_authorization_response.rbs +sig/zitadel/client/models/beta_authorization_service_delete_authorization_request.rbs +sig/zitadel/client/models/beta_authorization_service_delete_authorization_response.rbs +sig/zitadel/client/models/beta_authorization_service_id_filter.rbs +sig/zitadel/client/models/beta_authorization_service_in_ids_filter.rbs +sig/zitadel/client/models/beta_authorization_service_list_authorizations_request.rbs +sig/zitadel/client/models/beta_authorization_service_list_authorizations_response.rbs +sig/zitadel/client/models/beta_authorization_service_pagination_request.rbs +sig/zitadel/client/models/beta_authorization_service_pagination_response.rbs +sig/zitadel/client/models/beta_authorization_service_project_name_query.rbs +sig/zitadel/client/models/beta_authorization_service_role_key_query.rbs +sig/zitadel/client/models/beta_authorization_service_state.rbs +sig/zitadel/client/models/beta_authorization_service_state_query.rbs +sig/zitadel/client/models/beta_authorization_service_text_filter_method.rbs +sig/zitadel/client/models/beta_authorization_service_update_authorization_request.rbs +sig/zitadel/client/models/beta_authorization_service_update_authorization_response.rbs +sig/zitadel/client/models/beta_authorization_service_user.rbs +sig/zitadel/client/models/beta_authorization_service_user_display_name_query.rbs +sig/zitadel/client/models/beta_authorization_service_user_preferred_login_name_query.rbs +sig/zitadel/client/models/beta_feature_service_any.rbs +sig/zitadel/client/models/beta_feature_service_connect_error.rbs +sig/zitadel/client/models/beta_feature_service_details.rbs +sig/zitadel/client/models/beta_feature_service_feature_flag.rbs +sig/zitadel/client/models/beta_feature_service_get_instance_features_request.rbs +sig/zitadel/client/models/beta_feature_service_get_instance_features_response.rbs +sig/zitadel/client/models/beta_feature_service_get_organization_features_request.rbs +sig/zitadel/client/models/beta_feature_service_get_organization_features_response.rbs +sig/zitadel/client/models/beta_feature_service_get_system_features_response.rbs +sig/zitadel/client/models/beta_feature_service_get_user_features_request.rbs +sig/zitadel/client/models/beta_feature_service_get_user_features_response.rbs +sig/zitadel/client/models/beta_feature_service_improved_performance.rbs +sig/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rbs +sig/zitadel/client/models/beta_feature_service_reset_instance_features_response.rbs +sig/zitadel/client/models/beta_feature_service_reset_organization_features_request.rbs +sig/zitadel/client/models/beta_feature_service_reset_organization_features_response.rbs +sig/zitadel/client/models/beta_feature_service_reset_system_features_response.rbs +sig/zitadel/client/models/beta_feature_service_reset_user_features_request.rbs +sig/zitadel/client/models/beta_feature_service_reset_user_features_response.rbs +sig/zitadel/client/models/beta_feature_service_set_instance_features_request.rbs +sig/zitadel/client/models/beta_feature_service_set_instance_features_response.rbs +sig/zitadel/client/models/beta_feature_service_set_organization_features_request.rbs +sig/zitadel/client/models/beta_feature_service_set_organization_features_response.rbs +sig/zitadel/client/models/beta_feature_service_set_system_features_request.rbs +sig/zitadel/client/models/beta_feature_service_set_system_features_response.rbs +sig/zitadel/client/models/beta_feature_service_set_user_feature_request.rbs +sig/zitadel/client/models/beta_feature_service_set_user_features_response.rbs +sig/zitadel/client/models/beta_feature_service_source.rbs +sig/zitadel/client/models/beta_instance_service_add_custom_domain_request.rbs +sig/zitadel/client/models/beta_instance_service_add_custom_domain_response.rbs +sig/zitadel/client/models/beta_instance_service_add_trusted_domain_request.rbs +sig/zitadel/client/models/beta_instance_service_add_trusted_domain_response.rbs +sig/zitadel/client/models/beta_instance_service_any.rbs +sig/zitadel/client/models/beta_instance_service_connect_error.rbs +sig/zitadel/client/models/beta_instance_service_delete_instance_request.rbs +sig/zitadel/client/models/beta_instance_service_delete_instance_response.rbs +sig/zitadel/client/models/beta_instance_service_domain.rbs +sig/zitadel/client/models/beta_instance_service_domain_field_name.rbs +sig/zitadel/client/models/beta_instance_service_domain_generated_query.rbs +sig/zitadel/client/models/beta_instance_service_domain_primary_query.rbs +sig/zitadel/client/models/beta_instance_service_domain_query.rbs +sig/zitadel/client/models/beta_instance_service_domain_search_query.rbs +sig/zitadel/client/models/beta_instance_service_domains_query.rbs +sig/zitadel/client/models/beta_instance_service_field_name.rbs +sig/zitadel/client/models/beta_instance_service_get_instance_request.rbs +sig/zitadel/client/models/beta_instance_service_get_instance_response.rbs +sig/zitadel/client/models/beta_instance_service_ids_query.rbs +sig/zitadel/client/models/beta_instance_service_instance.rbs +sig/zitadel/client/models/beta_instance_service_list_custom_domains_request.rbs +sig/zitadel/client/models/beta_instance_service_list_custom_domains_response.rbs +sig/zitadel/client/models/beta_instance_service_list_instances_request.rbs +sig/zitadel/client/models/beta_instance_service_list_instances_response.rbs +sig/zitadel/client/models/beta_instance_service_list_trusted_domains_request.rbs +sig/zitadel/client/models/beta_instance_service_list_trusted_domains_response.rbs +sig/zitadel/client/models/beta_instance_service_pagination_request.rbs +sig/zitadel/client/models/beta_instance_service_pagination_response.rbs +sig/zitadel/client/models/beta_instance_service_query.rbs +sig/zitadel/client/models/beta_instance_service_remove_custom_domain_request.rbs +sig/zitadel/client/models/beta_instance_service_remove_custom_domain_response.rbs +sig/zitadel/client/models/beta_instance_service_remove_trusted_domain_request.rbs +sig/zitadel/client/models/beta_instance_service_remove_trusted_domain_response.rbs +sig/zitadel/client/models/beta_instance_service_state.rbs +sig/zitadel/client/models/beta_instance_service_text_query_method.rbs +sig/zitadel/client/models/beta_instance_service_trusted_domain.rbs +sig/zitadel/client/models/beta_instance_service_trusted_domain_field_name.rbs +sig/zitadel/client/models/beta_instance_service_trusted_domain_search_query.rbs +sig/zitadel/client/models/beta_instance_service_update_instance_request.rbs +sig/zitadel/client/models/beta_instance_service_update_instance_response.rbs +sig/zitadel/client/models/beta_internal_permission_service_administrator.rbs +sig/zitadel/client/models/beta_internal_permission_service_administrator_field_name.rbs +sig/zitadel/client/models/beta_internal_permission_service_administrator_search_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_and_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_any.rbs +sig/zitadel/client/models/beta_internal_permission_service_connect_error.rbs +sig/zitadel/client/models/beta_internal_permission_service_create_administrator_request.rbs +sig/zitadel/client/models/beta_internal_permission_service_create_administrator_response.rbs +sig/zitadel/client/models/beta_internal_permission_service_delete_administrator_request.rbs +sig/zitadel/client/models/beta_internal_permission_service_delete_administrator_response.rbs +sig/zitadel/client/models/beta_internal_permission_service_id_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_in_ids_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_list_administrators_request.rbs +sig/zitadel/client/models/beta_internal_permission_service_list_administrators_response.rbs +sig/zitadel/client/models/beta_internal_permission_service_not_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_or_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_organization.rbs +sig/zitadel/client/models/beta_internal_permission_service_pagination_request.rbs +sig/zitadel/client/models/beta_internal_permission_service_pagination_response.rbs +sig/zitadel/client/models/beta_internal_permission_service_project.rbs +sig/zitadel/client/models/beta_internal_permission_service_project_grant.rbs +sig/zitadel/client/models/beta_internal_permission_service_resource_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_resource_type.rbs +sig/zitadel/client/models/beta_internal_permission_service_role_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_text_filter_method.rbs +sig/zitadel/client/models/beta_internal_permission_service_timestamp_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_timestamp_filter_method.rbs +sig/zitadel/client/models/beta_internal_permission_service_update_administrator_request.rbs +sig/zitadel/client/models/beta_internal_permission_service_update_administrator_response.rbs +sig/zitadel/client/models/beta_internal_permission_service_user.rbs +sig/zitadel/client/models/beta_internal_permission_service_user_display_name_filter.rbs +sig/zitadel/client/models/beta_internal_permission_service_user_preferred_login_name_filter.rbs +sig/zitadel/client/models/beta_oidc_service_any.rbs +sig/zitadel/client/models/beta_oidc_service_auth_request.rbs +sig/zitadel/client/models/beta_oidc_service_authorization_error.rbs +sig/zitadel/client/models/beta_oidc_service_connect_error.rbs +sig/zitadel/client/models/beta_oidc_service_create_callback_request.rbs +sig/zitadel/client/models/beta_oidc_service_create_callback_response.rbs +sig/zitadel/client/models/beta_oidc_service_details.rbs +sig/zitadel/client/models/beta_oidc_service_error_reason.rbs +sig/zitadel/client/models/beta_oidc_service_get_auth_request_request.rbs +sig/zitadel/client/models/beta_oidc_service_get_auth_request_response.rbs +sig/zitadel/client/models/beta_oidc_service_prompt.rbs +sig/zitadel/client/models/beta_oidc_service_session.rbs +sig/zitadel/client/models/beta_organization_service_activate_organization_request.rbs +sig/zitadel/client/models/beta_organization_service_activate_organization_response.rbs +sig/zitadel/client/models/beta_organization_service_add_human_user_request.rbs +sig/zitadel/client/models/beta_organization_service_add_organization_domain_request.rbs +sig/zitadel/client/models/beta_organization_service_add_organization_domain_response.rbs +sig/zitadel/client/models/beta_organization_service_admin.rbs +sig/zitadel/client/models/beta_organization_service_any.rbs +sig/zitadel/client/models/beta_organization_service_assigned_admin.rbs +sig/zitadel/client/models/beta_organization_service_connect_error.rbs +sig/zitadel/client/models/beta_organization_service_create_organization_request.rbs +sig/zitadel/client/models/beta_organization_service_create_organization_response.rbs +sig/zitadel/client/models/beta_organization_service_created_admin.rbs +sig/zitadel/client/models/beta_organization_service_deactivate_organization_request.rbs +sig/zitadel/client/models/beta_organization_service_deactivate_organization_response.rbs +sig/zitadel/client/models/beta_organization_service_delete_organization_domain_request.rbs +sig/zitadel/client/models/beta_organization_service_delete_organization_domain_response.rbs +sig/zitadel/client/models/beta_organization_service_delete_organization_metadata_request.rbs +sig/zitadel/client/models/beta_organization_service_delete_organization_metadata_response.rbs +sig/zitadel/client/models/beta_organization_service_delete_organization_request.rbs +sig/zitadel/client/models/beta_organization_service_delete_organization_response.rbs +sig/zitadel/client/models/beta_organization_service_domain.rbs +sig/zitadel/client/models/beta_organization_service_domain_name_filter.rbs +sig/zitadel/client/models/beta_organization_service_domain_search_filter.rbs +sig/zitadel/client/models/beta_organization_service_domain_validation_type.rbs +sig/zitadel/client/models/beta_organization_service_gender.rbs +sig/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_request.rbs +sig/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_response.rbs +sig/zitadel/client/models/beta_organization_service_hashed_password.rbs +sig/zitadel/client/models/beta_organization_service_idp_link.rbs +sig/zitadel/client/models/beta_organization_service_list_organization_domains_request.rbs +sig/zitadel/client/models/beta_organization_service_list_organization_domains_response.rbs +sig/zitadel/client/models/beta_organization_service_list_organization_metadata_request.rbs +sig/zitadel/client/models/beta_organization_service_list_organization_metadata_response.rbs +sig/zitadel/client/models/beta_organization_service_list_organizations_request.rbs +sig/zitadel/client/models/beta_organization_service_list_organizations_response.rbs +sig/zitadel/client/models/beta_organization_service_metadata.rbs +sig/zitadel/client/models/beta_organization_service_metadata_key_query.rbs +sig/zitadel/client/models/beta_organization_service_metadata_query.rbs +sig/zitadel/client/models/beta_organization_service_org_domain_filter.rbs +sig/zitadel/client/models/beta_organization_service_org_field_name.rbs +sig/zitadel/client/models/beta_organization_service_org_id_filter.rbs +sig/zitadel/client/models/beta_organization_service_org_name_filter.rbs +sig/zitadel/client/models/beta_organization_service_org_state.rbs +sig/zitadel/client/models/beta_organization_service_org_state_filter.rbs +sig/zitadel/client/models/beta_organization_service_organization.rbs +sig/zitadel/client/models/beta_organization_service_organization_admin.rbs +sig/zitadel/client/models/beta_organization_service_organization_search_filter.rbs +sig/zitadel/client/models/beta_organization_service_pagination_request.rbs +sig/zitadel/client/models/beta_organization_service_pagination_response.rbs +sig/zitadel/client/models/beta_organization_service_password.rbs +sig/zitadel/client/models/beta_organization_service_send_email_verification_code.rbs +sig/zitadel/client/models/beta_organization_service_set_human_email.rbs +sig/zitadel/client/models/beta_organization_service_set_human_phone.rbs +sig/zitadel/client/models/beta_organization_service_set_human_profile.rbs +sig/zitadel/client/models/beta_organization_service_set_metadata_entry.rbs +sig/zitadel/client/models/beta_organization_service_set_organization_metadata_request.rbs +sig/zitadel/client/models/beta_organization_service_set_organization_metadata_response.rbs +sig/zitadel/client/models/beta_organization_service_text_query_method.rbs +sig/zitadel/client/models/beta_organization_service_update_organization_request.rbs +sig/zitadel/client/models/beta_organization_service_update_organization_response.rbs +sig/zitadel/client/models/beta_organization_service_verify_organization_domain_request.rbs +sig/zitadel/client/models/beta_organization_service_verify_organization_domain_response.rbs +sig/zitadel/client/models/beta_project_service_activate_project_grant_request.rbs +sig/zitadel/client/models/beta_project_service_activate_project_grant_response.rbs +sig/zitadel/client/models/beta_project_service_activate_project_request.rbs +sig/zitadel/client/models/beta_project_service_activate_project_response.rbs +sig/zitadel/client/models/beta_project_service_add_project_role_request.rbs +sig/zitadel/client/models/beta_project_service_add_project_role_response.rbs +sig/zitadel/client/models/beta_project_service_admin.rbs +sig/zitadel/client/models/beta_project_service_any.rbs +sig/zitadel/client/models/beta_project_service_connect_error.rbs +sig/zitadel/client/models/beta_project_service_create_project_grant_request.rbs +sig/zitadel/client/models/beta_project_service_create_project_grant_response.rbs +sig/zitadel/client/models/beta_project_service_create_project_request.rbs +sig/zitadel/client/models/beta_project_service_create_project_response.rbs +sig/zitadel/client/models/beta_project_service_deactivate_project_grant_request.rbs +sig/zitadel/client/models/beta_project_service_deactivate_project_grant_response.rbs +sig/zitadel/client/models/beta_project_service_deactivate_project_request.rbs +sig/zitadel/client/models/beta_project_service_deactivate_project_response.rbs +sig/zitadel/client/models/beta_project_service_delete_project_grant_request.rbs +sig/zitadel/client/models/beta_project_service_delete_project_grant_response.rbs +sig/zitadel/client/models/beta_project_service_delete_project_request.rbs +sig/zitadel/client/models/beta_project_service_delete_project_response.rbs +sig/zitadel/client/models/beta_project_service_get_project_request.rbs +sig/zitadel/client/models/beta_project_service_get_project_response.rbs +sig/zitadel/client/models/beta_project_service_granted_project_state.rbs +sig/zitadel/client/models/beta_project_service_id_filter.rbs +sig/zitadel/client/models/beta_project_service_in_ids_filter.rbs +sig/zitadel/client/models/beta_project_service_list_project_grants_request.rbs +sig/zitadel/client/models/beta_project_service_list_project_grants_response.rbs +sig/zitadel/client/models/beta_project_service_list_project_roles_request.rbs +sig/zitadel/client/models/beta_project_service_list_project_roles_response.rbs +sig/zitadel/client/models/beta_project_service_list_projects_request.rbs +sig/zitadel/client/models/beta_project_service_list_projects_response.rbs +sig/zitadel/client/models/beta_project_service_pagination_request.rbs +sig/zitadel/client/models/beta_project_service_pagination_response.rbs +sig/zitadel/client/models/beta_project_service_private_labeling_setting.rbs +sig/zitadel/client/models/beta_project_service_project.rbs +sig/zitadel/client/models/beta_project_service_project_field_name.rbs +sig/zitadel/client/models/beta_project_service_project_grant.rbs +sig/zitadel/client/models/beta_project_service_project_grant_field_name.rbs +sig/zitadel/client/models/beta_project_service_project_grant_search_filter.rbs +sig/zitadel/client/models/beta_project_service_project_grant_state.rbs +sig/zitadel/client/models/beta_project_service_project_name_filter.rbs +sig/zitadel/client/models/beta_project_service_project_role.rbs +sig/zitadel/client/models/beta_project_service_project_role_display_name_filter.rbs +sig/zitadel/client/models/beta_project_service_project_role_field_name.rbs +sig/zitadel/client/models/beta_project_service_project_role_key_filter.rbs +sig/zitadel/client/models/beta_project_service_project_role_search_filter.rbs +sig/zitadel/client/models/beta_project_service_project_search_filter.rbs +sig/zitadel/client/models/beta_project_service_project_state.rbs +sig/zitadel/client/models/beta_project_service_remove_project_role_request.rbs +sig/zitadel/client/models/beta_project_service_remove_project_role_response.rbs +sig/zitadel/client/models/beta_project_service_text_filter_method.rbs +sig/zitadel/client/models/beta_project_service_update_project_grant_request.rbs +sig/zitadel/client/models/beta_project_service_update_project_grant_response.rbs +sig/zitadel/client/models/beta_project_service_update_project_request.rbs +sig/zitadel/client/models/beta_project_service_update_project_response.rbs +sig/zitadel/client/models/beta_project_service_update_project_role_request.rbs +sig/zitadel/client/models/beta_project_service_update_project_role_response.rbs +sig/zitadel/client/models/beta_session_service_any.rbs +sig/zitadel/client/models/beta_session_service_challenges.rbs +sig/zitadel/client/models/beta_session_service_check_idp_intent.rbs +sig/zitadel/client/models/beta_session_service_check_otp.rbs +sig/zitadel/client/models/beta_session_service_check_password.rbs +sig/zitadel/client/models/beta_session_service_check_totp.rbs +sig/zitadel/client/models/beta_session_service_check_user.rbs +sig/zitadel/client/models/beta_session_service_check_web_auth_n.rbs +sig/zitadel/client/models/beta_session_service_checks.rbs +sig/zitadel/client/models/beta_session_service_connect_error.rbs +sig/zitadel/client/models/beta_session_service_create_session_request.rbs +sig/zitadel/client/models/beta_session_service_create_session_response.rbs +sig/zitadel/client/models/beta_session_service_creation_date_query.rbs +sig/zitadel/client/models/beta_session_service_delete_session_request.rbs +sig/zitadel/client/models/beta_session_service_delete_session_response.rbs +sig/zitadel/client/models/beta_session_service_details.rbs +sig/zitadel/client/models/beta_session_service_factors.rbs +sig/zitadel/client/models/beta_session_service_get_session_request.rbs +sig/zitadel/client/models/beta_session_service_get_session_response.rbs +sig/zitadel/client/models/beta_session_service_header_values.rbs +sig/zitadel/client/models/beta_session_service_ids_query.rbs +sig/zitadel/client/models/beta_session_service_intent_factor.rbs +sig/zitadel/client/models/beta_session_service_list_details.rbs +sig/zitadel/client/models/beta_session_service_list_query.rbs +sig/zitadel/client/models/beta_session_service_list_sessions_request.rbs +sig/zitadel/client/models/beta_session_service_list_sessions_response.rbs +sig/zitadel/client/models/beta_session_service_otp_email.rbs +sig/zitadel/client/models/beta_session_service_otp_factor.rbs +sig/zitadel/client/models/beta_session_service_otpsms.rbs +sig/zitadel/client/models/beta_session_service_password_factor.rbs +sig/zitadel/client/models/beta_session_service_request_challenges.rbs +sig/zitadel/client/models/beta_session_service_search_query.rbs +sig/zitadel/client/models/beta_session_service_send_code.rbs +sig/zitadel/client/models/beta_session_service_session.rbs +sig/zitadel/client/models/beta_session_service_session_field_name.rbs +sig/zitadel/client/models/beta_session_service_set_session_request.rbs +sig/zitadel/client/models/beta_session_service_set_session_response.rbs +sig/zitadel/client/models/beta_session_service_timestamp_query_method.rbs +sig/zitadel/client/models/beta_session_service_totp_factor.rbs +sig/zitadel/client/models/beta_session_service_user_agent.rbs +sig/zitadel/client/models/beta_session_service_user_factor.rbs +sig/zitadel/client/models/beta_session_service_user_id_query.rbs +sig/zitadel/client/models/beta_session_service_user_verification_requirement.rbs +sig/zitadel/client/models/beta_session_service_web_auth_n.rbs +sig/zitadel/client/models/beta_session_service_web_auth_n_factor.rbs +sig/zitadel/client/models/beta_settings_service_any.rbs +sig/zitadel/client/models/beta_settings_service_branding_settings.rbs +sig/zitadel/client/models/beta_settings_service_connect_error.rbs +sig/zitadel/client/models/beta_settings_service_details.rbs +sig/zitadel/client/models/beta_settings_service_domain_settings.rbs +sig/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rbs +sig/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rbs +sig/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rbs +sig/zitadel/client/models/beta_settings_service_get_branding_settings_request.rbs +sig/zitadel/client/models/beta_settings_service_get_branding_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_get_domain_settings_request.rbs +sig/zitadel/client/models/beta_settings_service_get_domain_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_get_general_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rbs +sig/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rbs +sig/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_get_login_settings_request.rbs +sig/zitadel/client/models/beta_settings_service_get_login_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rbs +sig/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rbs +sig/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_get_security_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_identity_provider.rbs +sig/zitadel/client/models/beta_settings_service_identity_provider_type.rbs +sig/zitadel/client/models/beta_settings_service_legal_and_support_settings.rbs +sig/zitadel/client/models/beta_settings_service_list_details.rbs +sig/zitadel/client/models/beta_settings_service_lockout_settings.rbs +sig/zitadel/client/models/beta_settings_service_login_settings.rbs +sig/zitadel/client/models/beta_settings_service_multi_factor_type.rbs +sig/zitadel/client/models/beta_settings_service_passkeys_type.rbs +sig/zitadel/client/models/beta_settings_service_password_complexity_settings.rbs +sig/zitadel/client/models/beta_settings_service_password_expiry_settings.rbs +sig/zitadel/client/models/beta_settings_service_request_context.rbs +sig/zitadel/client/models/beta_settings_service_resource_owner_type.rbs +sig/zitadel/client/models/beta_settings_service_second_factor_type.rbs +sig/zitadel/client/models/beta_settings_service_security_settings.rbs +sig/zitadel/client/models/beta_settings_service_set_security_settings_request.rbs +sig/zitadel/client/models/beta_settings_service_set_security_settings_response.rbs +sig/zitadel/client/models/beta_settings_service_theme.rbs +sig/zitadel/client/models/beta_settings_service_theme_mode.rbs +sig/zitadel/client/models/beta_telemetry_service_any.rbs +sig/zitadel/client/models/beta_telemetry_service_connect_error.rbs +sig/zitadel/client/models/beta_telemetry_service_count_parent_type.rbs +sig/zitadel/client/models/beta_telemetry_service_instance_information.rbs +sig/zitadel/client/models/beta_telemetry_service_report_base_information_request.rbs +sig/zitadel/client/models/beta_telemetry_service_report_base_information_response.rbs +sig/zitadel/client/models/beta_telemetry_service_report_resource_counts_request.rbs +sig/zitadel/client/models/beta_telemetry_service_report_resource_counts_response.rbs +sig/zitadel/client/models/beta_telemetry_service_resource_count.rbs +sig/zitadel/client/models/beta_user_service_access_token_type.rbs +sig/zitadel/client/models/beta_user_service_add_human_user_request.rbs +sig/zitadel/client/models/beta_user_service_add_human_user_response.rbs +sig/zitadel/client/models/beta_user_service_add_idp_link_request.rbs +sig/zitadel/client/models/beta_user_service_add_idp_link_response.rbs +sig/zitadel/client/models/beta_user_service_add_otp_email_request.rbs +sig/zitadel/client/models/beta_user_service_add_otp_email_response.rbs +sig/zitadel/client/models/beta_user_service_add_otpsms_request.rbs +sig/zitadel/client/models/beta_user_service_add_otpsms_response.rbs +sig/zitadel/client/models/beta_user_service_and_query.rbs +sig/zitadel/client/models/beta_user_service_any.rbs +sig/zitadel/client/models/beta_user_service_authentication_method_type.rbs +sig/zitadel/client/models/beta_user_service_connect_error.rbs +sig/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rbs +sig/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rbs +sig/zitadel/client/models/beta_user_service_deactivate_user_request.rbs +sig/zitadel/client/models/beta_user_service_deactivate_user_response.rbs +sig/zitadel/client/models/beta_user_service_delete_user_request.rbs +sig/zitadel/client/models/beta_user_service_delete_user_response.rbs +sig/zitadel/client/models/beta_user_service_details.rbs +sig/zitadel/client/models/beta_user_service_display_name_query.rbs +sig/zitadel/client/models/beta_user_service_email_query.rbs +sig/zitadel/client/models/beta_user_service_first_name_query.rbs +sig/zitadel/client/models/beta_user_service_form_data.rbs +sig/zitadel/client/models/beta_user_service_gender.rbs +sig/zitadel/client/models/beta_user_service_get_user_by_id_request.rbs +sig/zitadel/client/models/beta_user_service_get_user_by_id_response.rbs +sig/zitadel/client/models/beta_user_service_hashed_password.rbs +sig/zitadel/client/models/beta_user_service_human_email.rbs +sig/zitadel/client/models/beta_user_service_human_phone.rbs +sig/zitadel/client/models/beta_user_service_human_profile.rbs +sig/zitadel/client/models/beta_user_service_human_user.rbs +sig/zitadel/client/models/beta_user_service_idp_information.rbs +sig/zitadel/client/models/beta_user_service_idp_intent.rbs +sig/zitadel/client/models/beta_user_service_idp_link.rbs +sig/zitadel/client/models/beta_user_service_idpldap_access_information.rbs +sig/zitadel/client/models/beta_user_service_idpo_auth_access_information.rbs +sig/zitadel/client/models/beta_user_service_idpsaml_access_information.rbs +sig/zitadel/client/models/beta_user_service_in_user_emails_query.rbs +sig/zitadel/client/models/beta_user_service_in_user_id_query.rbs +sig/zitadel/client/models/beta_user_service_last_name_query.rbs +sig/zitadel/client/models/beta_user_service_ldap_credentials.rbs +sig/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rbs +sig/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rbs +sig/zitadel/client/models/beta_user_service_list_details.rbs +sig/zitadel/client/models/beta_user_service_list_query.rbs +sig/zitadel/client/models/beta_user_service_list_users_request.rbs +sig/zitadel/client/models/beta_user_service_list_users_response.rbs +sig/zitadel/client/models/beta_user_service_lock_user_request.rbs +sig/zitadel/client/models/beta_user_service_lock_user_response.rbs +sig/zitadel/client/models/beta_user_service_login_name_query.rbs +sig/zitadel/client/models/beta_user_service_machine_user.rbs +sig/zitadel/client/models/beta_user_service_nick_name_query.rbs +sig/zitadel/client/models/beta_user_service_not_query.rbs +sig/zitadel/client/models/beta_user_service_notification_type.rbs +sig/zitadel/client/models/beta_user_service_or_query.rbs +sig/zitadel/client/models/beta_user_service_organization.rbs +sig/zitadel/client/models/beta_user_service_organization_id_query.rbs +sig/zitadel/client/models/beta_user_service_passkey_authenticator.rbs +sig/zitadel/client/models/beta_user_service_passkey_registration_code.rbs +sig/zitadel/client/models/beta_user_service_password.rbs +sig/zitadel/client/models/beta_user_service_password_reset_request.rbs +sig/zitadel/client/models/beta_user_service_password_reset_response.rbs +sig/zitadel/client/models/beta_user_service_phone_query.rbs +sig/zitadel/client/models/beta_user_service_reactivate_user_request.rbs +sig/zitadel/client/models/beta_user_service_reactivate_user_response.rbs +sig/zitadel/client/models/beta_user_service_redirect_urls.rbs +sig/zitadel/client/models/beta_user_service_register_passkey_request.rbs +sig/zitadel/client/models/beta_user_service_register_passkey_response.rbs +sig/zitadel/client/models/beta_user_service_register_totp_request.rbs +sig/zitadel/client/models/beta_user_service_register_totp_response.rbs +sig/zitadel/client/models/beta_user_service_register_u2_f_request.rbs +sig/zitadel/client/models/beta_user_service_register_u2_f_response.rbs +sig/zitadel/client/models/beta_user_service_remove_otp_email_request.rbs +sig/zitadel/client/models/beta_user_service_remove_otp_email_response.rbs +sig/zitadel/client/models/beta_user_service_remove_otpsms_request.rbs +sig/zitadel/client/models/beta_user_service_remove_otpsms_response.rbs +sig/zitadel/client/models/beta_user_service_remove_phone_request.rbs +sig/zitadel/client/models/beta_user_service_remove_phone_response.rbs +sig/zitadel/client/models/beta_user_service_remove_totp_request.rbs +sig/zitadel/client/models/beta_user_service_remove_totp_response.rbs +sig/zitadel/client/models/beta_user_service_resend_email_code_request.rbs +sig/zitadel/client/models/beta_user_service_resend_email_code_response.rbs +sig/zitadel/client/models/beta_user_service_resend_phone_code_request.rbs +sig/zitadel/client/models/beta_user_service_resend_phone_code_response.rbs +sig/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rbs +sig/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rbs +sig/zitadel/client/models/beta_user_service_search_query.rbs +sig/zitadel/client/models/beta_user_service_send_email_verification_code.rbs +sig/zitadel/client/models/beta_user_service_send_passkey_registration_link.rbs +sig/zitadel/client/models/beta_user_service_send_password_reset_link.rbs +sig/zitadel/client/models/beta_user_service_set_email_request.rbs +sig/zitadel/client/models/beta_user_service_set_email_response.rbs +sig/zitadel/client/models/beta_user_service_set_human_email.rbs +sig/zitadel/client/models/beta_user_service_set_human_phone.rbs +sig/zitadel/client/models/beta_user_service_set_human_profile.rbs +sig/zitadel/client/models/beta_user_service_set_metadata_entry.rbs +sig/zitadel/client/models/beta_user_service_set_password.rbs +sig/zitadel/client/models/beta_user_service_set_password_request.rbs +sig/zitadel/client/models/beta_user_service_set_password_response.rbs +sig/zitadel/client/models/beta_user_service_set_phone_request.rbs +sig/zitadel/client/models/beta_user_service_set_phone_response.rbs +sig/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rbs +sig/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rbs +sig/zitadel/client/models/beta_user_service_state_query.rbs +sig/zitadel/client/models/beta_user_service_text_query_method.rbs +sig/zitadel/client/models/beta_user_service_type.rbs +sig/zitadel/client/models/beta_user_service_type_query.rbs +sig/zitadel/client/models/beta_user_service_unlock_user_request.rbs +sig/zitadel/client/models/beta_user_service_unlock_user_response.rbs +sig/zitadel/client/models/beta_user_service_update_human_user_request.rbs +sig/zitadel/client/models/beta_user_service_update_human_user_response.rbs +sig/zitadel/client/models/beta_user_service_user.rbs +sig/zitadel/client/models/beta_user_service_user_field_name.rbs +sig/zitadel/client/models/beta_user_service_user_name_query.rbs +sig/zitadel/client/models/beta_user_service_user_state.rbs +sig/zitadel/client/models/beta_user_service_verify_email_request.rbs +sig/zitadel/client/models/beta_user_service_verify_email_response.rbs +sig/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rbs +sig/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rbs +sig/zitadel/client/models/beta_user_service_verify_phone_request.rbs +sig/zitadel/client/models/beta_user_service_verify_phone_response.rbs +sig/zitadel/client/models/beta_user_service_verify_totp_registration_request.rbs +sig/zitadel/client/models/beta_user_service_verify_totp_registration_response.rbs +sig/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rbs +sig/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rbs +sig/zitadel/client/models/beta_web_key_service_activate_web_key_request.rbs +sig/zitadel/client/models/beta_web_key_service_activate_web_key_response.rbs +sig/zitadel/client/models/beta_web_key_service_any.rbs +sig/zitadel/client/models/beta_web_key_service_connect_error.rbs +sig/zitadel/client/models/beta_web_key_service_create_web_key_request.rbs +sig/zitadel/client/models/beta_web_key_service_create_web_key_response.rbs +sig/zitadel/client/models/beta_web_key_service_delete_web_key_request.rbs +sig/zitadel/client/models/beta_web_key_service_delete_web_key_response.rbs +sig/zitadel/client/models/beta_web_key_service_ecdsa.rbs +sig/zitadel/client/models/beta_web_key_service_ecdsa_curve.rbs +sig/zitadel/client/models/beta_web_key_service_list_web_keys_response.rbs +sig/zitadel/client/models/beta_web_key_service_rsa.rbs +sig/zitadel/client/models/beta_web_key_service_rsa_bits.rbs +sig/zitadel/client/models/beta_web_key_service_rsa_hasher.rbs +sig/zitadel/client/models/beta_web_key_service_state.rbs +sig/zitadel/client/models/beta_web_key_service_web_key.rbs +sig/zitadel/client/models/feature_service_any.rbs +sig/zitadel/client/models/feature_service_connect_error.rbs +sig/zitadel/client/models/feature_service_details.rbs +sig/zitadel/client/models/feature_service_feature_flag.rbs +sig/zitadel/client/models/feature_service_get_instance_features_request.rbs +sig/zitadel/client/models/feature_service_get_instance_features_response.rbs +sig/zitadel/client/models/feature_service_get_organization_features_request.rbs +sig/zitadel/client/models/feature_service_get_organization_features_response.rbs +sig/zitadel/client/models/feature_service_get_system_features_response.rbs +sig/zitadel/client/models/feature_service_get_user_features_request.rbs +sig/zitadel/client/models/feature_service_get_user_features_response.rbs +sig/zitadel/client/models/feature_service_improved_performance.rbs +sig/zitadel/client/models/feature_service_improved_performance_feature_flag.rbs +sig/zitadel/client/models/feature_service_login_v2.rbs +sig/zitadel/client/models/feature_service_login_v2_feature_flag.rbs +sig/zitadel/client/models/feature_service_reset_instance_features_response.rbs +sig/zitadel/client/models/feature_service_reset_organization_features_request.rbs +sig/zitadel/client/models/feature_service_reset_organization_features_response.rbs +sig/zitadel/client/models/feature_service_reset_system_features_response.rbs +sig/zitadel/client/models/feature_service_reset_user_features_request.rbs +sig/zitadel/client/models/feature_service_reset_user_features_response.rbs +sig/zitadel/client/models/feature_service_set_instance_features_request.rbs +sig/zitadel/client/models/feature_service_set_instance_features_response.rbs +sig/zitadel/client/models/feature_service_set_organization_features_request.rbs +sig/zitadel/client/models/feature_service_set_organization_features_response.rbs +sig/zitadel/client/models/feature_service_set_system_features_request.rbs +sig/zitadel/client/models/feature_service_set_system_features_response.rbs +sig/zitadel/client/models/feature_service_set_user_feature_request.rbs +sig/zitadel/client/models/feature_service_set_user_features_response.rbs +sig/zitadel/client/models/feature_service_source.rbs +sig/zitadel/client/models/identity_provider_service_any.rbs +sig/zitadel/client/models/identity_provider_service_apple_config.rbs +sig/zitadel/client/models/identity_provider_service_auto_linking_option.rbs +sig/zitadel/client/models/identity_provider_service_azure_ad_config.rbs +sig/zitadel/client/models/identity_provider_service_azure_ad_tenant.rbs +sig/zitadel/client/models/identity_provider_service_azure_ad_tenant_type.rbs +sig/zitadel/client/models/identity_provider_service_connect_error.rbs +sig/zitadel/client/models/identity_provider_service_details.rbs +sig/zitadel/client/models/identity_provider_service_generic_oidc_config.rbs +sig/zitadel/client/models/identity_provider_service_get_idpby_id_request.rbs +sig/zitadel/client/models/identity_provider_service_get_idpby_id_response.rbs +sig/zitadel/client/models/identity_provider_service_git_hub_config.rbs +sig/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rbs +sig/zitadel/client/models/identity_provider_service_git_lab_config.rbs +sig/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rbs +sig/zitadel/client/models/identity_provider_service_google_config.rbs +sig/zitadel/client/models/identity_provider_service_idp.rbs +sig/zitadel/client/models/identity_provider_service_idp_config.rbs +sig/zitadel/client/models/identity_provider_service_idp_state.rbs +sig/zitadel/client/models/identity_provider_service_idp_type.rbs +sig/zitadel/client/models/identity_provider_service_jwt_config.rbs +sig/zitadel/client/models/identity_provider_service_ldap_attributes.rbs +sig/zitadel/client/models/identity_provider_service_ldap_config.rbs +sig/zitadel/client/models/identity_provider_service_o_auth_config.rbs +sig/zitadel/client/models/identity_provider_service_options.rbs +sig/zitadel/client/models/identity_provider_service_saml_binding.rbs +sig/zitadel/client/models/identity_provider_service_saml_config.rbs +sig/zitadel/client/models/identity_provider_service_saml_name_id_format.rbs +sig/zitadel/client/models/identity_provider_service_saml_signature_algorithm.rbs +sig/zitadel/client/models/instance_service_add_custom_domain_request.rbs +sig/zitadel/client/models/instance_service_add_custom_domain_response.rbs +sig/zitadel/client/models/instance_service_add_trusted_domain_request.rbs +sig/zitadel/client/models/instance_service_add_trusted_domain_response.rbs +sig/zitadel/client/models/instance_service_any.rbs +sig/zitadel/client/models/instance_service_connect_error.rbs +sig/zitadel/client/models/instance_service_custom_domain.rbs +sig/zitadel/client/models/instance_service_custom_domain_filter.rbs +sig/zitadel/client/models/instance_service_custom_domains_filter.rbs +sig/zitadel/client/models/instance_service_delete_instance_request.rbs +sig/zitadel/client/models/instance_service_delete_instance_response.rbs +sig/zitadel/client/models/instance_service_domain_field_name.rbs +sig/zitadel/client/models/instance_service_domain_filter.rbs +sig/zitadel/client/models/instance_service_field_name.rbs +sig/zitadel/client/models/instance_service_filter.rbs +sig/zitadel/client/models/instance_service_get_instance_request.rbs +sig/zitadel/client/models/instance_service_get_instance_response.rbs +sig/zitadel/client/models/instance_service_in_ids_filter.rbs +sig/zitadel/client/models/instance_service_instance.rbs +sig/zitadel/client/models/instance_service_list_custom_domains_request.rbs +sig/zitadel/client/models/instance_service_list_custom_domains_response.rbs +sig/zitadel/client/models/instance_service_list_instances_request.rbs +sig/zitadel/client/models/instance_service_list_instances_response.rbs +sig/zitadel/client/models/instance_service_list_trusted_domains_request.rbs +sig/zitadel/client/models/instance_service_list_trusted_domains_response.rbs +sig/zitadel/client/models/instance_service_pagination_request.rbs +sig/zitadel/client/models/instance_service_pagination_response.rbs +sig/zitadel/client/models/instance_service_remove_custom_domain_request.rbs +sig/zitadel/client/models/instance_service_remove_custom_domain_response.rbs +sig/zitadel/client/models/instance_service_remove_trusted_domain_request.rbs +sig/zitadel/client/models/instance_service_remove_trusted_domain_response.rbs +sig/zitadel/client/models/instance_service_state.rbs +sig/zitadel/client/models/instance_service_text_query_method.rbs +sig/zitadel/client/models/instance_service_trusted_domain.rbs +sig/zitadel/client/models/instance_service_trusted_domain_field_name.rbs +sig/zitadel/client/models/instance_service_trusted_domain_filter.rbs +sig/zitadel/client/models/instance_service_update_instance_request.rbs +sig/zitadel/client/models/instance_service_update_instance_response.rbs +sig/zitadel/client/models/internal_permission_service_administrator.rbs +sig/zitadel/client/models/internal_permission_service_administrator_field_name.rbs +sig/zitadel/client/models/internal_permission_service_administrator_search_filter.rbs +sig/zitadel/client/models/internal_permission_service_and_filter.rbs +sig/zitadel/client/models/internal_permission_service_any.rbs +sig/zitadel/client/models/internal_permission_service_connect_error.rbs +sig/zitadel/client/models/internal_permission_service_create_administrator_request.rbs +sig/zitadel/client/models/internal_permission_service_create_administrator_response.rbs +sig/zitadel/client/models/internal_permission_service_delete_administrator_request.rbs +sig/zitadel/client/models/internal_permission_service_delete_administrator_response.rbs +sig/zitadel/client/models/internal_permission_service_id_filter.rbs +sig/zitadel/client/models/internal_permission_service_in_ids_filter.rbs +sig/zitadel/client/models/internal_permission_service_list_administrators_request.rbs +sig/zitadel/client/models/internal_permission_service_list_administrators_response.rbs +sig/zitadel/client/models/internal_permission_service_not_filter.rbs +sig/zitadel/client/models/internal_permission_service_or_filter.rbs +sig/zitadel/client/models/internal_permission_service_organization.rbs +sig/zitadel/client/models/internal_permission_service_pagination_request.rbs +sig/zitadel/client/models/internal_permission_service_pagination_response.rbs +sig/zitadel/client/models/internal_permission_service_project.rbs +sig/zitadel/client/models/internal_permission_service_project_grant.rbs +sig/zitadel/client/models/internal_permission_service_resource_filter.rbs +sig/zitadel/client/models/internal_permission_service_resource_type.rbs +sig/zitadel/client/models/internal_permission_service_role_filter.rbs +sig/zitadel/client/models/internal_permission_service_text_filter_method.rbs +sig/zitadel/client/models/internal_permission_service_timestamp_filter.rbs +sig/zitadel/client/models/internal_permission_service_timestamp_filter_method.rbs +sig/zitadel/client/models/internal_permission_service_update_administrator_request.rbs +sig/zitadel/client/models/internal_permission_service_update_administrator_response.rbs +sig/zitadel/client/models/internal_permission_service_user.rbs +sig/zitadel/client/models/internal_permission_service_user_display_name_filter.rbs +sig/zitadel/client/models/internal_permission_service_user_preferred_login_name_filter.rbs +sig/zitadel/client/models/oidc_service_any.rbs +sig/zitadel/client/models/oidc_service_auth_request.rbs +sig/zitadel/client/models/oidc_service_authorization_error.rbs +sig/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rbs +sig/zitadel/client/models/oidc_service_connect_error.rbs +sig/zitadel/client/models/oidc_service_create_callback_request.rbs +sig/zitadel/client/models/oidc_service_create_callback_response.rbs +sig/zitadel/client/models/oidc_service_details.rbs +sig/zitadel/client/models/oidc_service_device_authorization_request.rbs +sig/zitadel/client/models/oidc_service_error_reason.rbs +sig/zitadel/client/models/oidc_service_get_auth_request_request.rbs +sig/zitadel/client/models/oidc_service_get_auth_request_response.rbs +sig/zitadel/client/models/oidc_service_get_device_authorization_request_request.rbs +sig/zitadel/client/models/oidc_service_get_device_authorization_request_response.rbs +sig/zitadel/client/models/oidc_service_prompt.rbs +sig/zitadel/client/models/oidc_service_session.rbs +sig/zitadel/client/models/organization_service_activate_organization_request.rbs +sig/zitadel/client/models/organization_service_activate_organization_response.rbs +sig/zitadel/client/models/organization_service_add_human_user_request.rbs +sig/zitadel/client/models/organization_service_add_organization_domain_request.rbs +sig/zitadel/client/models/organization_service_add_organization_domain_response.rbs +sig/zitadel/client/models/organization_service_add_organization_request.rbs +sig/zitadel/client/models/organization_service_add_organization_response.rbs +sig/zitadel/client/models/organization_service_admin.rbs +sig/zitadel/client/models/organization_service_any.rbs +sig/zitadel/client/models/organization_service_connect_error.rbs +sig/zitadel/client/models/organization_service_created_admin.rbs +sig/zitadel/client/models/organization_service_deactivate_organization_request.rbs +sig/zitadel/client/models/organization_service_deactivate_organization_response.rbs +sig/zitadel/client/models/organization_service_delete_organization_domain_request.rbs +sig/zitadel/client/models/organization_service_delete_organization_domain_response.rbs +sig/zitadel/client/models/organization_service_delete_organization_metadata_request.rbs +sig/zitadel/client/models/organization_service_delete_organization_metadata_response.rbs +sig/zitadel/client/models/organization_service_delete_organization_request.rbs +sig/zitadel/client/models/organization_service_delete_organization_response.rbs +sig/zitadel/client/models/organization_service_details.rbs +sig/zitadel/client/models/organization_service_domain.rbs +sig/zitadel/client/models/organization_service_domain_field_name.rbs +sig/zitadel/client/models/organization_service_domain_search_filter.rbs +sig/zitadel/client/models/organization_service_domain_validation_type.rbs +sig/zitadel/client/models/organization_service_gender.rbs +sig/zitadel/client/models/organization_service_generate_organization_domain_validation_request.rbs +sig/zitadel/client/models/organization_service_generate_organization_domain_validation_response.rbs +sig/zitadel/client/models/organization_service_hashed_password.rbs +sig/zitadel/client/models/organization_service_idp_link.rbs +sig/zitadel/client/models/organization_service_list_details.rbs +sig/zitadel/client/models/organization_service_list_organization_domains_request.rbs +sig/zitadel/client/models/organization_service_list_organization_domains_response.rbs +sig/zitadel/client/models/organization_service_list_organization_metadata_request.rbs +sig/zitadel/client/models/organization_service_list_organization_metadata_response.rbs +sig/zitadel/client/models/organization_service_list_organizations_request.rbs +sig/zitadel/client/models/organization_service_list_organizations_response.rbs +sig/zitadel/client/models/organization_service_list_query.rbs +sig/zitadel/client/models/organization_service_metadata.rbs +sig/zitadel/client/models/organization_service_metadata_key_filter.rbs +sig/zitadel/client/models/organization_service_metadata_search_filter.rbs +sig/zitadel/client/models/organization_service_organization.rbs +sig/zitadel/client/models/organization_service_organization_domain_query.rbs +sig/zitadel/client/models/organization_service_organization_field_name.rbs +sig/zitadel/client/models/organization_service_organization_id_query.rbs +sig/zitadel/client/models/organization_service_organization_name_query.rbs +sig/zitadel/client/models/organization_service_organization_state.rbs +sig/zitadel/client/models/organization_service_organization_state_query.rbs +sig/zitadel/client/models/organization_service_pagination_request.rbs +sig/zitadel/client/models/organization_service_pagination_response.rbs +sig/zitadel/client/models/organization_service_password.rbs +sig/zitadel/client/models/organization_service_search_query.rbs +sig/zitadel/client/models/organization_service_send_email_verification_code.rbs +sig/zitadel/client/models/organization_service_set_human_email.rbs +sig/zitadel/client/models/organization_service_set_human_phone.rbs +sig/zitadel/client/models/organization_service_set_human_profile.rbs +sig/zitadel/client/models/organization_service_set_metadata_entry.rbs +sig/zitadel/client/models/organization_service_set_organization_metadata_request.rbs +sig/zitadel/client/models/organization_service_set_organization_metadata_response.rbs +sig/zitadel/client/models/organization_service_text_filter_method.rbs +sig/zitadel/client/models/organization_service_text_query_method.rbs +sig/zitadel/client/models/organization_service_update_organization_request.rbs +sig/zitadel/client/models/organization_service_update_organization_response.rbs +sig/zitadel/client/models/organization_service_verify_organization_domain_request.rbs +sig/zitadel/client/models/organization_service_verify_organization_domain_response.rbs +sig/zitadel/client/models/project_service_activate_project_grant_request.rbs +sig/zitadel/client/models/project_service_activate_project_grant_response.rbs +sig/zitadel/client/models/project_service_activate_project_request.rbs +sig/zitadel/client/models/project_service_activate_project_response.rbs +sig/zitadel/client/models/project_service_add_project_role_request.rbs +sig/zitadel/client/models/project_service_add_project_role_response.rbs +sig/zitadel/client/models/project_service_any.rbs +sig/zitadel/client/models/project_service_connect_error.rbs +sig/zitadel/client/models/project_service_create_project_grant_request.rbs +sig/zitadel/client/models/project_service_create_project_grant_response.rbs +sig/zitadel/client/models/project_service_create_project_request.rbs +sig/zitadel/client/models/project_service_create_project_response.rbs +sig/zitadel/client/models/project_service_deactivate_project_grant_request.rbs +sig/zitadel/client/models/project_service_deactivate_project_grant_response.rbs +sig/zitadel/client/models/project_service_deactivate_project_request.rbs +sig/zitadel/client/models/project_service_deactivate_project_response.rbs +sig/zitadel/client/models/project_service_delete_project_grant_request.rbs +sig/zitadel/client/models/project_service_delete_project_grant_response.rbs +sig/zitadel/client/models/project_service_delete_project_request.rbs +sig/zitadel/client/models/project_service_delete_project_response.rbs +sig/zitadel/client/models/project_service_get_project_request.rbs +sig/zitadel/client/models/project_service_get_project_response.rbs +sig/zitadel/client/models/project_service_granted_project_state.rbs +sig/zitadel/client/models/project_service_id_filter.rbs +sig/zitadel/client/models/project_service_in_ids_filter.rbs +sig/zitadel/client/models/project_service_list_project_grants_request.rbs +sig/zitadel/client/models/project_service_list_project_grants_response.rbs +sig/zitadel/client/models/project_service_list_project_roles_request.rbs +sig/zitadel/client/models/project_service_list_project_roles_response.rbs +sig/zitadel/client/models/project_service_list_projects_request.rbs +sig/zitadel/client/models/project_service_list_projects_response.rbs +sig/zitadel/client/models/project_service_pagination_request.rbs +sig/zitadel/client/models/project_service_pagination_response.rbs +sig/zitadel/client/models/project_service_private_labeling_setting.rbs +sig/zitadel/client/models/project_service_project.rbs +sig/zitadel/client/models/project_service_project_field_name.rbs +sig/zitadel/client/models/project_service_project_grant.rbs +sig/zitadel/client/models/project_service_project_grant_field_name.rbs +sig/zitadel/client/models/project_service_project_grant_search_filter.rbs +sig/zitadel/client/models/project_service_project_grant_state.rbs +sig/zitadel/client/models/project_service_project_name_filter.rbs +sig/zitadel/client/models/project_service_project_organization_id_filter.rbs +sig/zitadel/client/models/project_service_project_role.rbs +sig/zitadel/client/models/project_service_project_role_display_name_filter.rbs +sig/zitadel/client/models/project_service_project_role_field_name.rbs +sig/zitadel/client/models/project_service_project_role_key_filter.rbs +sig/zitadel/client/models/project_service_project_role_search_filter.rbs +sig/zitadel/client/models/project_service_project_search_filter.rbs +sig/zitadel/client/models/project_service_project_state.rbs +sig/zitadel/client/models/project_service_remove_project_role_request.rbs +sig/zitadel/client/models/project_service_remove_project_role_response.rbs +sig/zitadel/client/models/project_service_text_filter_method.rbs +sig/zitadel/client/models/project_service_type.rbs +sig/zitadel/client/models/project_service_update_project_grant_request.rbs +sig/zitadel/client/models/project_service_update_project_grant_response.rbs +sig/zitadel/client/models/project_service_update_project_request.rbs +sig/zitadel/client/models/project_service_update_project_response.rbs +sig/zitadel/client/models/project_service_update_project_role_request.rbs +sig/zitadel/client/models/project_service_update_project_role_response.rbs +sig/zitadel/client/models/saml_service_any.rbs +sig/zitadel/client/models/saml_service_authorization_error.rbs +sig/zitadel/client/models/saml_service_connect_error.rbs +sig/zitadel/client/models/saml_service_create_response_request.rbs +sig/zitadel/client/models/saml_service_create_response_response.rbs +sig/zitadel/client/models/saml_service_details.rbs +sig/zitadel/client/models/saml_service_error_reason.rbs +sig/zitadel/client/models/saml_service_get_saml_request_request.rbs +sig/zitadel/client/models/saml_service_get_saml_request_response.rbs +sig/zitadel/client/models/saml_service_post_response.rbs +sig/zitadel/client/models/saml_service_saml_request.rbs +sig/zitadel/client/models/saml_service_session.rbs +sig/zitadel/client/models/session_service_any.rbs +sig/zitadel/client/models/session_service_challenges.rbs +sig/zitadel/client/models/session_service_check_idp_intent.rbs +sig/zitadel/client/models/session_service_check_otp.rbs +sig/zitadel/client/models/session_service_check_password.rbs +sig/zitadel/client/models/session_service_check_recovery_code.rbs +sig/zitadel/client/models/session_service_check_totp.rbs +sig/zitadel/client/models/session_service_check_user.rbs +sig/zitadel/client/models/session_service_check_web_auth_n.rbs +sig/zitadel/client/models/session_service_checks.rbs +sig/zitadel/client/models/session_service_connect_error.rbs +sig/zitadel/client/models/session_service_create_session_request.rbs +sig/zitadel/client/models/session_service_create_session_response.rbs +sig/zitadel/client/models/session_service_creation_date_query.rbs +sig/zitadel/client/models/session_service_creator_query.rbs +sig/zitadel/client/models/session_service_delete_session_request.rbs +sig/zitadel/client/models/session_service_delete_session_response.rbs +sig/zitadel/client/models/session_service_details.rbs +sig/zitadel/client/models/session_service_expiration_date_query.rbs +sig/zitadel/client/models/session_service_factors.rbs +sig/zitadel/client/models/session_service_get_session_request.rbs +sig/zitadel/client/models/session_service_get_session_response.rbs +sig/zitadel/client/models/session_service_header_values.rbs +sig/zitadel/client/models/session_service_ids_query.rbs +sig/zitadel/client/models/session_service_intent_factor.rbs +sig/zitadel/client/models/session_service_list_details.rbs +sig/zitadel/client/models/session_service_list_query.rbs +sig/zitadel/client/models/session_service_list_sessions_request.rbs +sig/zitadel/client/models/session_service_list_sessions_response.rbs +sig/zitadel/client/models/session_service_otp_email.rbs +sig/zitadel/client/models/session_service_otp_factor.rbs +sig/zitadel/client/models/session_service_otpsms.rbs +sig/zitadel/client/models/session_service_password_factor.rbs +sig/zitadel/client/models/session_service_recovery_code_factor.rbs +sig/zitadel/client/models/session_service_request_challenges.rbs +sig/zitadel/client/models/session_service_search_query.rbs +sig/zitadel/client/models/session_service_send_code.rbs +sig/zitadel/client/models/session_service_session.rbs +sig/zitadel/client/models/session_service_session_field_name.rbs +sig/zitadel/client/models/session_service_set_session_request.rbs +sig/zitadel/client/models/session_service_set_session_response.rbs +sig/zitadel/client/models/session_service_timestamp_query_method.rbs +sig/zitadel/client/models/session_service_totp_factor.rbs +sig/zitadel/client/models/session_service_user_agent.rbs +sig/zitadel/client/models/session_service_user_agent_query.rbs +sig/zitadel/client/models/session_service_user_factor.rbs +sig/zitadel/client/models/session_service_user_id_query.rbs +sig/zitadel/client/models/session_service_user_verification_requirement.rbs +sig/zitadel/client/models/session_service_web_auth_n.rbs +sig/zitadel/client/models/session_service_web_auth_n_factor.rbs +sig/zitadel/client/models/settings_service_any.rbs +sig/zitadel/client/models/settings_service_auto_linking_option.rbs +sig/zitadel/client/models/settings_service_branding_settings.rbs +sig/zitadel/client/models/settings_service_connect_error.rbs +sig/zitadel/client/models/settings_service_details.rbs +sig/zitadel/client/models/settings_service_domain_settings.rbs +sig/zitadel/client/models/settings_service_embedded_iframe_settings.rbs +sig/zitadel/client/models/settings_service_get_active_identity_providers_request.rbs +sig/zitadel/client/models/settings_service_get_active_identity_providers_response.rbs +sig/zitadel/client/models/settings_service_get_branding_settings_request.rbs +sig/zitadel/client/models/settings_service_get_branding_settings_response.rbs +sig/zitadel/client/models/settings_service_get_domain_settings_request.rbs +sig/zitadel/client/models/settings_service_get_domain_settings_response.rbs +sig/zitadel/client/models/settings_service_get_general_settings_response.rbs +sig/zitadel/client/models/settings_service_get_hosted_login_translation_request.rbs +sig/zitadel/client/models/settings_service_get_hosted_login_translation_response.rbs +sig/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rbs +sig/zitadel/client/models/settings_service_get_legal_and_support_settings_response.rbs +sig/zitadel/client/models/settings_service_get_lockout_settings_request.rbs +sig/zitadel/client/models/settings_service_get_lockout_settings_response.rbs +sig/zitadel/client/models/settings_service_get_login_settings_request.rbs +sig/zitadel/client/models/settings_service_get_login_settings_response.rbs +sig/zitadel/client/models/settings_service_get_password_complexity_settings_request.rbs +sig/zitadel/client/models/settings_service_get_password_complexity_settings_response.rbs +sig/zitadel/client/models/settings_service_get_password_expiry_settings_request.rbs +sig/zitadel/client/models/settings_service_get_password_expiry_settings_response.rbs +sig/zitadel/client/models/settings_service_get_security_settings_response.rbs +sig/zitadel/client/models/settings_service_identity_provider.rbs +sig/zitadel/client/models/settings_service_identity_provider_type.rbs +sig/zitadel/client/models/settings_service_legal_and_support_settings.rbs +sig/zitadel/client/models/settings_service_list_details.rbs +sig/zitadel/client/models/settings_service_lockout_settings.rbs +sig/zitadel/client/models/settings_service_login_settings.rbs +sig/zitadel/client/models/settings_service_multi_factor_type.rbs +sig/zitadel/client/models/settings_service_options.rbs +sig/zitadel/client/models/settings_service_passkeys_type.rbs +sig/zitadel/client/models/settings_service_password_complexity_settings.rbs +sig/zitadel/client/models/settings_service_password_expiry_settings.rbs +sig/zitadel/client/models/settings_service_request_context.rbs +sig/zitadel/client/models/settings_service_resource_owner_type.rbs +sig/zitadel/client/models/settings_service_second_factor_type.rbs +sig/zitadel/client/models/settings_service_security_settings.rbs +sig/zitadel/client/models/settings_service_set_hosted_login_translation_request.rbs +sig/zitadel/client/models/settings_service_set_hosted_login_translation_response.rbs +sig/zitadel/client/models/settings_service_set_security_settings_request.rbs +sig/zitadel/client/models/settings_service_set_security_settings_response.rbs +sig/zitadel/client/models/settings_service_theme.rbs +sig/zitadel/client/models/settings_service_theme_mode.rbs +sig/zitadel/client/models/user_service_access_token_type.rbs +sig/zitadel/client/models/user_service_add_human_user_request.rbs +sig/zitadel/client/models/user_service_add_human_user_response.rbs +sig/zitadel/client/models/user_service_add_idp_link_request.rbs +sig/zitadel/client/models/user_service_add_idp_link_response.rbs +sig/zitadel/client/models/user_service_add_key_request.rbs +sig/zitadel/client/models/user_service_add_key_response.rbs +sig/zitadel/client/models/user_service_add_otp_email_request.rbs +sig/zitadel/client/models/user_service_add_otp_email_response.rbs +sig/zitadel/client/models/user_service_add_otpsms_request.rbs +sig/zitadel/client/models/user_service_add_otpsms_response.rbs +sig/zitadel/client/models/user_service_add_personal_access_token_request.rbs +sig/zitadel/client/models/user_service_add_personal_access_token_response.rbs +sig/zitadel/client/models/user_service_add_secret_request.rbs +sig/zitadel/client/models/user_service_add_secret_response.rbs +sig/zitadel/client/models/user_service_and_query.rbs +sig/zitadel/client/models/user_service_any.rbs +sig/zitadel/client/models/user_service_auth_factor.rbs +sig/zitadel/client/models/user_service_auth_factor_state.rbs +sig/zitadel/client/models/user_service_auth_factor_u2_f.rbs +sig/zitadel/client/models/user_service_auth_factors.rbs +sig/zitadel/client/models/user_service_authentication_method_type.rbs +sig/zitadel/client/models/user_service_byte_filter_method.rbs +sig/zitadel/client/models/user_service_connect_error.rbs +sig/zitadel/client/models/user_service_create_invite_code_request.rbs +sig/zitadel/client/models/user_service_create_invite_code_response.rbs +sig/zitadel/client/models/user_service_create_passkey_registration_link_request.rbs +sig/zitadel/client/models/user_service_create_passkey_registration_link_response.rbs +sig/zitadel/client/models/user_service_create_user_request.rbs +sig/zitadel/client/models/user_service_create_user_response.rbs +sig/zitadel/client/models/user_service_deactivate_user_request.rbs +sig/zitadel/client/models/user_service_deactivate_user_response.rbs +sig/zitadel/client/models/user_service_delete_user_metadata_request.rbs +sig/zitadel/client/models/user_service_delete_user_metadata_response.rbs +sig/zitadel/client/models/user_service_delete_user_request.rbs +sig/zitadel/client/models/user_service_delete_user_response.rbs +sig/zitadel/client/models/user_service_details.rbs +sig/zitadel/client/models/user_service_display_name_query.rbs +sig/zitadel/client/models/user_service_domain_query.rbs +sig/zitadel/client/models/user_service_email_query.rbs +sig/zitadel/client/models/user_service_first_name_query.rbs +sig/zitadel/client/models/user_service_form_data.rbs +sig/zitadel/client/models/user_service_gender.rbs +sig/zitadel/client/models/user_service_generate_recovery_codes_request.rbs +sig/zitadel/client/models/user_service_generate_recovery_codes_response.rbs +sig/zitadel/client/models/user_service_get_user_by_id_request.rbs +sig/zitadel/client/models/user_service_get_user_by_id_response.rbs +sig/zitadel/client/models/user_service_hashed_password.rbs +sig/zitadel/client/models/user_service_human.rbs +sig/zitadel/client/models/user_service_human_email.rbs +sig/zitadel/client/models/user_service_human_mfa_init_skipped_request.rbs +sig/zitadel/client/models/user_service_human_mfa_init_skipped_response.rbs +sig/zitadel/client/models/user_service_human_phone.rbs +sig/zitadel/client/models/user_service_human_profile.rbs +sig/zitadel/client/models/user_service_human_user.rbs +sig/zitadel/client/models/user_service_id_filter.rbs +sig/zitadel/client/models/user_service_idp_information.rbs +sig/zitadel/client/models/user_service_idp_intent.rbs +sig/zitadel/client/models/user_service_idp_link.rbs +sig/zitadel/client/models/user_service_idpldap_access_information.rbs +sig/zitadel/client/models/user_service_idpo_auth_access_information.rbs +sig/zitadel/client/models/user_service_idpsaml_access_information.rbs +sig/zitadel/client/models/user_service_in_user_emails_query.rbs +sig/zitadel/client/models/user_service_in_user_id_query.rbs +sig/zitadel/client/models/user_service_key.rbs +sig/zitadel/client/models/user_service_key_field_name.rbs +sig/zitadel/client/models/user_service_keys_search_filter.rbs +sig/zitadel/client/models/user_service_last_name_query.rbs +sig/zitadel/client/models/user_service_ldap_credentials.rbs +sig/zitadel/client/models/user_service_list_authentication_factors_request.rbs +sig/zitadel/client/models/user_service_list_authentication_factors_response.rbs +sig/zitadel/client/models/user_service_list_authentication_method_types_request.rbs +sig/zitadel/client/models/user_service_list_authentication_method_types_response.rbs +sig/zitadel/client/models/user_service_list_details.rbs +sig/zitadel/client/models/user_service_list_idp_links_request.rbs +sig/zitadel/client/models/user_service_list_idp_links_response.rbs +sig/zitadel/client/models/user_service_list_keys_request.rbs +sig/zitadel/client/models/user_service_list_keys_response.rbs +sig/zitadel/client/models/user_service_list_passkeys_request.rbs +sig/zitadel/client/models/user_service_list_passkeys_response.rbs +sig/zitadel/client/models/user_service_list_personal_access_tokens_request.rbs +sig/zitadel/client/models/user_service_list_personal_access_tokens_response.rbs +sig/zitadel/client/models/user_service_list_query.rbs +sig/zitadel/client/models/user_service_list_user_metadata_request.rbs +sig/zitadel/client/models/user_service_list_user_metadata_response.rbs +sig/zitadel/client/models/user_service_list_users_request.rbs +sig/zitadel/client/models/user_service_list_users_response.rbs +sig/zitadel/client/models/user_service_lock_user_request.rbs +sig/zitadel/client/models/user_service_lock_user_response.rbs +sig/zitadel/client/models/user_service_login_name_query.rbs +sig/zitadel/client/models/user_service_machine.rbs +sig/zitadel/client/models/user_service_machine_user.rbs +sig/zitadel/client/models/user_service_metadata.rbs +sig/zitadel/client/models/user_service_metadata_key_filter.rbs +sig/zitadel/client/models/user_service_metadata_search_filter.rbs +sig/zitadel/client/models/user_service_metadata_value_filter.rbs +sig/zitadel/client/models/user_service_nick_name_query.rbs +sig/zitadel/client/models/user_service_not_query.rbs +sig/zitadel/client/models/user_service_notification_type.rbs +sig/zitadel/client/models/user_service_or_query.rbs +sig/zitadel/client/models/user_service_organization.rbs +sig/zitadel/client/models/user_service_organization_id_query.rbs +sig/zitadel/client/models/user_service_pagination_request.rbs +sig/zitadel/client/models/user_service_pagination_response.rbs +sig/zitadel/client/models/user_service_passkey.rbs +sig/zitadel/client/models/user_service_passkey_authenticator.rbs +sig/zitadel/client/models/user_service_passkey_registration_code.rbs +sig/zitadel/client/models/user_service_password.rbs +sig/zitadel/client/models/user_service_password_reset_request.rbs +sig/zitadel/client/models/user_service_password_reset_response.rbs +sig/zitadel/client/models/user_service_personal_access_token.rbs +sig/zitadel/client/models/user_service_personal_access_token_field_name.rbs +sig/zitadel/client/models/user_service_personal_access_tokens_search_filter.rbs +sig/zitadel/client/models/user_service_phone_query.rbs +sig/zitadel/client/models/user_service_profile.rbs +sig/zitadel/client/models/user_service_reactivate_user_request.rbs +sig/zitadel/client/models/user_service_reactivate_user_response.rbs +sig/zitadel/client/models/user_service_redirect_urls.rbs +sig/zitadel/client/models/user_service_register_passkey_request.rbs +sig/zitadel/client/models/user_service_register_passkey_response.rbs +sig/zitadel/client/models/user_service_register_totp_request.rbs +sig/zitadel/client/models/user_service_register_totp_response.rbs +sig/zitadel/client/models/user_service_register_u2_f_request.rbs +sig/zitadel/client/models/user_service_register_u2_f_response.rbs +sig/zitadel/client/models/user_service_remove_idp_link_request.rbs +sig/zitadel/client/models/user_service_remove_idp_link_response.rbs +sig/zitadel/client/models/user_service_remove_key_request.rbs +sig/zitadel/client/models/user_service_remove_key_response.rbs +sig/zitadel/client/models/user_service_remove_otp_email_request.rbs +sig/zitadel/client/models/user_service_remove_otp_email_response.rbs +sig/zitadel/client/models/user_service_remove_otpsms_request.rbs +sig/zitadel/client/models/user_service_remove_otpsms_response.rbs +sig/zitadel/client/models/user_service_remove_passkey_request.rbs +sig/zitadel/client/models/user_service_remove_passkey_response.rbs +sig/zitadel/client/models/user_service_remove_personal_access_token_request.rbs +sig/zitadel/client/models/user_service_remove_personal_access_token_response.rbs +sig/zitadel/client/models/user_service_remove_phone_request.rbs +sig/zitadel/client/models/user_service_remove_phone_response.rbs +sig/zitadel/client/models/user_service_remove_recovery_codes_request.rbs +sig/zitadel/client/models/user_service_remove_recovery_codes_response.rbs +sig/zitadel/client/models/user_service_remove_secret_request.rbs +sig/zitadel/client/models/user_service_remove_secret_response.rbs +sig/zitadel/client/models/user_service_remove_totp_request.rbs +sig/zitadel/client/models/user_service_remove_totp_response.rbs +sig/zitadel/client/models/user_service_remove_u2_f_request.rbs +sig/zitadel/client/models/user_service_remove_u2_f_response.rbs +sig/zitadel/client/models/user_service_resend_email_code_request.rbs +sig/zitadel/client/models/user_service_resend_email_code_response.rbs +sig/zitadel/client/models/user_service_resend_invite_code_request.rbs +sig/zitadel/client/models/user_service_resend_invite_code_response.rbs +sig/zitadel/client/models/user_service_resend_phone_code_request.rbs +sig/zitadel/client/models/user_service_resend_phone_code_response.rbs +sig/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rbs +sig/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rbs +sig/zitadel/client/models/user_service_search_query.rbs +sig/zitadel/client/models/user_service_send_email_code_request.rbs +sig/zitadel/client/models/user_service_send_email_code_response.rbs +sig/zitadel/client/models/user_service_send_email_verification_code.rbs +sig/zitadel/client/models/user_service_send_invite_code.rbs +sig/zitadel/client/models/user_service_send_passkey_registration_link.rbs +sig/zitadel/client/models/user_service_send_password_reset_link.rbs +sig/zitadel/client/models/user_service_set_email_request.rbs +sig/zitadel/client/models/user_service_set_email_response.rbs +sig/zitadel/client/models/user_service_set_human_email.rbs +sig/zitadel/client/models/user_service_set_human_phone.rbs +sig/zitadel/client/models/user_service_set_human_profile.rbs +sig/zitadel/client/models/user_service_set_metadata_entry.rbs +sig/zitadel/client/models/user_service_set_password.rbs +sig/zitadel/client/models/user_service_set_password_request.rbs +sig/zitadel/client/models/user_service_set_password_response.rbs +sig/zitadel/client/models/user_service_set_phone_request.rbs +sig/zitadel/client/models/user_service_set_phone_response.rbs +sig/zitadel/client/models/user_service_set_user_metadata_request.rbs +sig/zitadel/client/models/user_service_set_user_metadata_response.rbs +sig/zitadel/client/models/user_service_start_identity_provider_intent_request.rbs +sig/zitadel/client/models/user_service_start_identity_provider_intent_response.rbs +sig/zitadel/client/models/user_service_state_query.rbs +sig/zitadel/client/models/user_service_text_filter_method.rbs +sig/zitadel/client/models/user_service_text_query_method.rbs +sig/zitadel/client/models/user_service_timestamp_filter.rbs +sig/zitadel/client/models/user_service_timestamp_filter_method.rbs +sig/zitadel/client/models/user_service_type.rbs +sig/zitadel/client/models/user_service_type_query.rbs +sig/zitadel/client/models/user_service_unlock_user_request.rbs +sig/zitadel/client/models/user_service_unlock_user_response.rbs +sig/zitadel/client/models/user_service_update_human_user_request.rbs +sig/zitadel/client/models/user_service_update_human_user_response.rbs +sig/zitadel/client/models/user_service_update_user_request.rbs +sig/zitadel/client/models/user_service_update_user_response.rbs +sig/zitadel/client/models/user_service_user.rbs +sig/zitadel/client/models/user_service_user_field_name.rbs +sig/zitadel/client/models/user_service_user_name_query.rbs +sig/zitadel/client/models/user_service_user_state.rbs +sig/zitadel/client/models/user_service_verify_email_request.rbs +sig/zitadel/client/models/user_service_verify_email_response.rbs +sig/zitadel/client/models/user_service_verify_invite_code_request.rbs +sig/zitadel/client/models/user_service_verify_invite_code_response.rbs +sig/zitadel/client/models/user_service_verify_passkey_registration_request.rbs +sig/zitadel/client/models/user_service_verify_passkey_registration_response.rbs +sig/zitadel/client/models/user_service_verify_phone_request.rbs +sig/zitadel/client/models/user_service_verify_phone_response.rbs +sig/zitadel/client/models/user_service_verify_totp_registration_request.rbs +sig/zitadel/client/models/user_service_verify_totp_registration_response.rbs +sig/zitadel/client/models/user_service_verify_u2_f_registration_request.rbs +sig/zitadel/client/models/user_service_verify_u2_f_registration_response.rbs +sig/zitadel/client/models/web_key_service_activate_web_key_request.rbs +sig/zitadel/client/models/web_key_service_activate_web_key_response.rbs +sig/zitadel/client/models/web_key_service_any.rbs +sig/zitadel/client/models/web_key_service_connect_error.rbs +sig/zitadel/client/models/web_key_service_create_web_key_request.rbs +sig/zitadel/client/models/web_key_service_create_web_key_response.rbs +sig/zitadel/client/models/web_key_service_delete_web_key_request.rbs +sig/zitadel/client/models/web_key_service_delete_web_key_response.rbs +sig/zitadel/client/models/web_key_service_ecdsa.rbs +sig/zitadel/client/models/web_key_service_ecdsa_curve.rbs +sig/zitadel/client/models/web_key_service_list_web_keys_response.rbs +sig/zitadel/client/models/web_key_service_rsa.rbs +sig/zitadel/client/models/web_key_service_rsa_bits.rbs +sig/zitadel/client/models/web_key_service_rsa_hasher.rbs +sig/zitadel/client/models/web_key_service_state.rbs +sig/zitadel/client/models/web_key_service_web_key.rbs +test/configuration_test.rb +test/default_api_client_unit_test.rb +test/header_selector_test.rb +test/trace_context_util_test.rb +test/transport_options_test.rb +test/value_serializer_test.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 00000000..e465da43 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/.rubocop.yml b/.rubocop.yml index 07506c54..9289f05f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,26 +1,4 @@ -plugins: - - rubocop-minitest - - rubocop-rake - AllCops: - Exclude: - - 'lib/zitadel/client/models/**/*' - - 'lib/zitadel/client/api/**/*' - - 'vendor/**/*' + TargetRubyVersion: 3.4 NewCops: enable - TargetRubyVersion: 3.0 - -Layout/LineLength: - Max: 130 - -Style/StringLiterals: - EnforcedStyle: single_quotes - -Metrics/AbcSize: - Exclude: - - 'test/**/*' - -Metrics/BlockLength: - Max: 100 - Exclude: - - 'spec/**/*' + SuggestExtensions: false diff --git a/.yardopts b/.yardopts new file mode 100644 index 00000000..8f8f5a1a --- /dev/null +++ b/.yardopts @@ -0,0 +1 @@ +lib/**/*.rb diff --git a/Gemfile b/Gemfile index f5d3b745..a5be6469 100644 --- a/Gemfile +++ b/Gemfile @@ -2,30 +2,51 @@ source 'https://rubygems.org' +ruby '>= 3.4' + +# Pull in the gem's runtime dependencies (dry-struct, faraday, jwt, zeitwerk, +# warning, ...) from the gemspec so the library and its hand-written +# Zeitwerk entrypoint load without duplicating the dependency list here. gemspec -gem 'oauth2', '>= 2.0.12' -gem 'typhoeus' -gem 'warning' -gem 'zeitwerk' +# Pinned to the version bundled with the Ruby base image so bundler resolves +# it to the precompiled default gem instead of compiling a newer one from +# source — bigdecimal is a C extension with no musl build and would otherwise +# fail on the toolchain-free Alpine base. +gem 'bigdecimal', '3.1.8' + +gem 'dry-struct', '~> 1.6' +gem 'dry-types', '~> 1.7' +gem 'faraday', '~> 2.0' +gem 'faraday-follow_redirects', '~> 0.3' +gem 'iso8601', '~> 0.13' +gem 'tod', '~> 3.1' -group :development do - gem 'rbs' - gem 'rubocop', require: false - gem 'rubocop-minitest', require: false - gem 'rubocop-rake', require: false - gem 'steep', '~> 1.7.0', require: false +group :development, :test do + gem 'better_coverage', '~> 1.1' + gem 'docker-api', '~> 2.2' + gem 'dotenv', '~> 3.1' + gem 'minitest', '~> 5.0' + gem 'minitest-hooks', '~> 1.5' + gem 'minitest-reporters', '~> 1.8' + gem 'rake', '~> 13.4' + gem 'rubocop', '~> 1.87', require: false + gem 'rubocop-minitest', '~> 0.39', require: false + gem 'rubocop-rake', '~> 0.7', require: false + gem 'simplecov', '~> 0.22', require: false + gem 'simplecov-cobertura', '~> 3.1', require: false + gem 'steep', '~> 2.0', require: false + gem 'testcontainers', '~> 0.2' + gem 'yard', '~> 0.9', require: false end -group :test do - gem 'better_coverage' - gem 'dotenv' - gem 'minitest' - gem 'minitest-hooks' - gem 'minitest-reporters' - gem 'rake' - gem 'securerandom' - gem 'simplecov', require: false - gem 'simplecov-cobertura', require: false - gem 'testcontainers' +# Optional response-decompression backends. Both are C-extension gems with no +# precompiled musl build and do not compile cleanly on Alpine even with a +# toolchain, so they are excluded from the default install (the test image +# sets BUNDLE_WITHOUT=optional). The client requires them under begin/rescue +# and only advertises br/zstd in Accept-Encoding when the constant is defined, +# so omitting them is safe; consumers opt in on a glibc platform. +group :optional do + gem 'brotli', '~> 0.5' + gem 'zstd-ruby', '~> 1.5' end diff --git a/Gemfile.lock b/Gemfile.lock index d5391639..3aa8b10b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,70 +1,73 @@ PATH remote: . specs: - zitadel-client (4.1.1) - cgi (>= 0.1) - date (>= 3.0) - logger (>= 1.4) - net-http (>= 0.1) - oauth2 (~> 2.0) - tempfile (>= 0.1) - time (>= 0.1) - typhoeus (~> 1.0, >= 1.0.1) - uri (>= 0.10) - warning (~> 1.5.0) + zitadel-client (0.0.1) + dry-struct (~> 1.6) + dry-types (~> 1.7) + faraday (~> 2.0) + faraday-follow_redirects (~> 0.3) + iso8601 (~> 0.13) + jwt (~> 3.0) + tod (~> 3.1) + warning (~> 1.5) zeitwerk (~> 2.5) GEM remote: https://rubygems.org/ specs: - activesupport (8.1.2.1) - base64 - bigdecimal - concurrent-ruby (~> 1.0, >= 1.3.1) - connection_pool (>= 2.2.5) - drb - i18n (>= 1.6, < 2) - json - logger (>= 1.4.2) - minitest (>= 5.1) - securerandom (>= 0.3) - tzinfo (~> 2.0, >= 2.0.5) - uri (>= 0.13.1) ansi (1.6.0) ast (2.4.3) base64 (0.3.0) better_coverage (1.1.1) minitest-reporters (~> 1.8) simplecov (~> 0.22) - bigdecimal (4.0.1) + bigdecimal (3.1.8) + brotli (0.8.0) builder (3.3.0) - cgi (0.5.1) concurrent-ruby (1.3.6) - connection_pool (3.0.2) csv (3.3.5) - date (3.5.1) docile (1.4.1) docker-api (2.4.0) excon (>= 0.64.0) multi_json - dotenv (3.1.8) - drb (2.2.3) - ethon (0.16.0) - ffi (>= 1.15.0) - excon (1.2.5) + dotenv (3.2.0) + dry-core (1.2.0) + concurrent-ruby (~> 1.0) + logger + zeitwerk (~> 2.6) + dry-inflector (1.3.1) + dry-logic (1.6.0) + bigdecimal + concurrent-ruby (~> 1.0) + dry-core (~> 1.1) + zeitwerk (~> 2.6) + dry-struct (1.8.1) + dry-core (~> 1.1) + dry-types (~> 1.8, >= 1.8.2) + ice_nine (~> 0.11) + zeitwerk (~> 2.6) + dry-types (1.9.1) + bigdecimal (>= 3.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.0) + dry-inflector (~> 1.0) + dry-logic (~> 1.4) + zeitwerk (~> 2.6) + excon (1.5.0) logger faraday (2.14.2) faraday-net_http (>= 2.0, < 3.5) json logger + faraday-follow_redirects (0.5.0) + faraday (>= 1, < 3) faraday-net_http (3.4.2) net-http (~> 0.5) ffi (1.17.3) ffi (1.17.3-arm64-darwin) fileutils (1.7.3) - hashie (5.0.0) - i18n (1.14.8) - concurrent-ruby (~> 1.0) + ice_nine (0.11.2) + iso8601 (0.13.0) json (2.19.5) jwt (3.2.0) base64 @@ -74,9 +77,7 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - minitest (6.0.3) - drb (~> 2.0) - prism (~> 1.5) + minitest (5.27.0) minitest-hooks (1.5.2) minitest (> 5.3) minitest-reporters (1.8.0) @@ -84,49 +85,41 @@ GEM builder minitest (>= 5.0, < 7) ruby-progressbar - multi_json (1.17.0) - multi_xml (0.6.0) + multi_json (1.21.1) net-http (0.9.1) uri (>= 0.11.1) - oauth2 (2.0.12) - faraday (>= 0.17.3, < 4.0) - jwt (>= 1.0, < 4.0) - logger (~> 1.2) - multi_xml (~> 0.5) - rack (>= 1.2, < 4) - snaky_hash (~> 2.0, >= 2.0.3) - version_gem (>= 1.1.8, < 3) parallel (1.27.0) parser (3.3.8.0) ast (~> 2.4.1) racc prism (1.9.0) racc (1.8.1) - rack (3.2.6) rainbow (3.1.1) - rake (13.3.0) + rake (13.4.2) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbs (3.6.1) + rbs (4.0.2) logger + prism (>= 1.6.0) + tsort regexp_parser (2.10.0) rexml (3.4.4) - rubocop (1.78.0) + rubocop (1.87.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) - parallel (~> 1.10) + parallel (>= 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.45.1, < 2.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.46.0) + rubocop-ast (1.49.1) parser (>= 3.3.7.2) - prism (~> 1.4) - rubocop-minitest (0.38.1) + prism (~> 1.7) + rubocop-minitest (0.39.1) lint_roller (~> 1.1) rubocop (>= 1.75.0, < 2.0) rubocop-ast (>= 1.38.0, < 2.0) @@ -144,69 +137,71 @@ GEM simplecov (~> 0.19) simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) - snaky_hash (2.0.3) - hashie (>= 0.1.0, < 6) - version_gem (>= 1.1.8, < 3) - steep (1.7.1) - activesupport (>= 5.1) + steep (2.0.0) concurrent-ruby (>= 1.1.10) csv (>= 3.0.9) fileutils (>= 1.1.0) json (>= 2.1.0) - language_server-protocol (>= 3.15, < 4.0) + language_server-protocol (>= 3.17.0.4, < 4.0) listen (~> 3.0) logger (>= 1.3.0) - parser (>= 3.1) + parser (>= 3.2) + prism (>= 0.25.0) rainbow (>= 2.2.2, < 4.0) - rbs (>= 3.5.0.pre) + rbs (~> 4.0) securerandom (>= 0.1) strscan (>= 1.0.0) - terminal-table (>= 2, < 4) + terminal-table (>= 2, < 5) + uri (>= 0.12.0) strscan (3.1.5) - tempfile (0.3.1) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) testcontainers (0.2.0) testcontainers-core (= 0.2.0) testcontainers-core (0.2.0) docker-api (~> 2.2) - time (0.4.2) - date - typhoeus (1.4.1) - ethon (>= 0.9.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) + tod (3.1.2) + tsort (0.2.0) unicode-display_width (2.6.0) uri (1.1.1) - version_gem (1.1.8) - warning (1.5.0) + warning (1.6.0) + yard (0.9.44) zeitwerk (2.6.18) + zstd-ruby (1.5.7.1) PLATFORMS arm64-darwin-23 ruby DEPENDENCIES - better_coverage - dotenv - minitest - minitest-hooks - minitest-reporters - oauth2 (>= 2.0.12) - rake - rbs - rubocop - rubocop-minitest - rubocop-rake - securerandom - simplecov - simplecov-cobertura - steep (~> 1.7.0) - testcontainers - typhoeus - warning - zeitwerk + better_coverage (~> 1.1) + bigdecimal (= 3.1.8) + brotli (~> 0.5) + docker-api (~> 2.2) + dotenv (~> 3.1) + dry-struct (~> 1.6) + dry-types (~> 1.7) + faraday (~> 2.0) + faraday-follow_redirects (~> 0.3) + iso8601 (~> 0.13) + minitest (~> 5.0) + minitest-hooks (~> 1.5) + minitest-reporters (~> 1.8) + rake (~> 13.4) + rubocop (~> 1.87) + rubocop-minitest (~> 0.39) + rubocop-rake (~> 0.7) + simplecov (~> 0.22) + simplecov-cobertura (~> 3.1) + steep (~> 2.0) + testcontainers (~> 0.2) + tod (~> 3.1) + yard (~> 0.9) zitadel-client! + zstd-ruby (~> 1.5) + +RUBY VERSION + ruby 4.0.1 BUNDLED WITH 4.0.3 diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..16ef8a76 --- /dev/null +++ b/Makefile @@ -0,0 +1,63 @@ +.PHONY: install build test lint format typecheck docs clean generate prune + +install: + bundle install --quiet + +build: install + +test: install + bundle exec rake test + +lint: install + bundle exec rubocop --format simple --fail-fast + +format: install + bundle exec rubocop -A + +typecheck: install + bundle exec steep check + +docs: install + bundle exec yard doc --output-dir .out/docs --fail-on-warning + +clean: + rm -rf .bundle vendor doc .out .yardoc + +# --- Code generation (self-contained: regenerate, prune orphans, then format) --- +GENERATOR ?= ruby-plus +IMAGE ?= openapi-generator-plus:enhanced +SPEC_DIR ?= ../sdk/spec +VERSION ?= v4.11.0 +NORMALIZER ?= NORMALIZER_CLASS=io.github.mridang.codegen.AdvancedOpenAPINormalizer,GARBAGE_COLLECT_COMPONENTS=1,STRIP_PARAMS=Connect-Protocol-Version|Connect-Timeout-Ms,CLEAN_EMPTY_REQUEST_BODIES=Tag,ONLY_ALLOW_JSON=1 + +REPO := $(notdir $(CURDIR)) + +generate: + docker run --rm \ + -v "$(CURDIR):/sdk/out" \ + -v "$(abspath $(SPEC_DIR)):/sdk/spec:ro" \ + -v "$(CURDIR)/proc.yml:/sdk/proc.yml:ro" \ + --user "$$(id -u):$$(id -g)" \ + $(IMAGE) generate \ + --input-spec=/sdk/spec/client/$(VERSION)/index.json \ + --generator-name=$(GENERATOR) \ + --output=/sdk/out \ + --git-user-id=zitadel --git-repo-id=$(REPO) --git-host=github.com \ + --config=/sdk/proc.yml \ + --openapi-normalizer "$(NORMALIZER)" + @$(MAKE) --no-print-directory prune + @$(MAKE) --no-print-directory format + +prune: + @test -f .openapi-generator/FILES || { echo "prune: no FILES manifest, skipping"; exit 0; } + @tmp=$$(mktemp -d); \ + git ls-files | sort > "$$tmp/tracked"; \ + sed 's#^\./##' .openapi-generator/FILES | sort -u > "$$tmp/generated"; \ + awk 'NR==FNR { gen[tolower($$0)]=1; next } !(tolower($$0) in gen)' \ + "$$tmp/generated" "$$tmp/tracked" > "$$tmp/orphans"; \ + git -c core.excludesFile="$(CURDIR)/.openapi-generator-ignore" \ + check-ignore --no-index --stdin < "$$tmp/orphans" 2>/dev/null | sort -u > "$$tmp/keep" || true; \ + comm -23 "$$tmp/orphans" "$$tmp/keep" > "$$tmp/delete"; \ + echo "prune: deleting $$(wc -l < "$$tmp/delete" | tr -d ' ') orphaned files the generator no longer produces"; \ + xargs -r rm -f < "$$tmp/delete"; \ + rm -rf "$$tmp" diff --git a/README.md b/README.md index 4f7a64d5..9374e050 100644 --- a/README.md +++ b/README.md @@ -78,23 +78,28 @@ JSON file. This process creates a secure token. require 'zitadel-client' require 'securerandom' -client = Zitadel::Client::Zitadel.with_private_key("https://example.us1.zitadel.cloud", "path/to/jwt-key.json") +client = Zitadel::Client::Zitadel.with_authenticator( + Zitadel::Client::Auth::WebTokenAuthenticator.from_json( + "https://example.us1.zitadel.cloud", + "path/to/jwt-key.json" + ) +) begin - response = client.users.add_human_user( - Zitadel::Client::UserServiceAddHumanUserRequest.new( + response = client.user_service.add_human_user( + Zitadel::Client::Models::UserServiceAddHumanUserRequest.new( username: SecureRandom.hex, - profile: Zitadel::Client::UserServiceSetHumanProfile.new( + profile: Zitadel::Client::Models::UserServiceSetHumanProfile.new( given_name: 'John', family_name: 'Doe' ), - email: Zitadel::Client::UserServiceSetHumanEmail.new( + email: Zitadel::Client::Models::UserServiceSetHumanEmail.new( email: "john.doe@example.com" ) ) ) puts "User created: #{response}" -rescue StandardError => e +rescue Zitadel::Client::ApiError => e puts "Error: #{e.message}" end ``` @@ -121,23 +126,29 @@ which is then used to authenticate. require 'zitadel-client' require 'securerandom' -client = Zitadel::Client::Zitadel.with_client_credentials("https://example.us1.zitadel.cloud", "id", "secret") +client = Zitadel::Client::Zitadel.with_authenticator( + Zitadel::Client::Auth::ClientCredentialsAuthenticator.builder( + "https://example.us1.zitadel.cloud", + "id", + "secret" + ).build +) begin - response = client.users.add_human_user( - Zitadel::Client::UserServiceAddHumanUserRequest.new( + response = client.user_service.add_human_user( + Zitadel::Client::Models::UserServiceAddHumanUserRequest.new( username: SecureRandom.hex, - profile: Zitadel::Client::UserServiceSetHumanProfile.new( + profile: Zitadel::Client::Models::UserServiceSetHumanProfile.new( given_name: 'John', family_name: 'Doe' ), - email: Zitadel::Client::UserServiceSetHumanEmail.new( + email: Zitadel::Client::Models::UserServiceSetHumanEmail.new( email: "john.doe@example.com" ) ) ) puts "User created: #{response}" -rescue StandardError => e +rescue Zitadel::Client::ApiError => e puts "Error: #{e.message}" end ``` @@ -164,23 +175,28 @@ authenticate without exchanging credentials every time. require 'zitadel-client' require 'securerandom' -client = Zitadel::Client::Zitadel.with_access_token("https://example.us1.zitadel.cloud", "token") +client = Zitadel::Client::Zitadel.with_authenticator( + Zitadel::Client::Auth::PersonalAccessTokenAuthenticator.new( + "https://example.us1.zitadel.cloud", + "token" + ) +) begin - response = client.users.add_human_user( - Zitadel::Client::UserServiceAddHumanUserRequest.new( + response = client.user_service.add_human_user( + Zitadel::Client::Models::UserServiceAddHumanUserRequest.new( username: SecureRandom.hex, - profile: Zitadel::Client::UserServiceSetHumanProfile.new( + profile: Zitadel::Client::Models::UserServiceSetHumanProfile.new( given_name: 'John', family_name: 'Doe' ), - email: Zitadel::Client::UserServiceSetHumanEmail.new( + email: Zitadel::Client::Models::UserServiceSetHumanEmail.new( email: "john.doe@example.com" ) ) ) puts "User created: #{response}" -rescue StandardError => e +rescue Zitadel::Client::ApiError => e puts "Error: #{e.message}" end ``` @@ -198,12 +214,12 @@ and debugging purposes. You can enable debug logging by setting `debugging` to `true` via the configuration block when initializing the `Zitadel` client: ```ruby -zitadel = Zitadel::Client::Zitadel.with_access_token( - 'your-zitadel-base-url', - 'your-valid-token' -) do |config| - config.debugging = true -end +zitadel = Zitadel::Client::Zitadel.with_authenticator( + Zitadel::Client::Auth::PersonalAccessTokenAuthenticator.new( + 'your-zitadel-base-url', + 'your-valid-token' + ) +) ``` When enabled, the SDK will log additional information, such as HTTP request @@ -221,13 +237,15 @@ In development or testing environments with self-signed certificates, you can disable TLS verification entirely: ```ruby -options = Zitadel::Client::TransportOptions.new(insecure: true) - -zitadel = Zitadel::Client::Zitadel.with_client_credentials( - 'https://your-instance.zitadel.cloud', - 'client-id', - 'client-secret', - transport_options: options +options = Zitadel::Client::TransportOptions.builder.verify_ssl(false).build + +zitadel = Zitadel::Client::Zitadel.with_authenticator( + Zitadel::Client::Auth::ClientCredentialsAuthenticator.builder( + 'https://your-instance.zitadel.cloud', + 'client-id', + 'client-secret' + ).build, + options ) ``` @@ -237,13 +255,15 @@ If your Zitadel instance uses a certificate signed by a private CA, you can provide the path to the CA certificate in PEM format: ```ruby -options = Zitadel::Client::TransportOptions.new(ca_cert_path: '/path/to/ca.pem') - -zitadel = Zitadel::Client::Zitadel.with_client_credentials( - 'https://your-instance.zitadel.cloud', - 'client-id', - 'client-secret', - transport_options: options +options = Zitadel::Client::TransportOptions.builder.ca_cert_path('/path/to/ca.pem').build + +zitadel = Zitadel::Client::Zitadel.with_authenticator( + Zitadel::Client::Auth::ClientCredentialsAuthenticator.builder( + 'https://your-instance.zitadel.cloud', + 'client-id', + 'client-secret' + ).build, + options ) ``` @@ -253,15 +273,17 @@ You can attach default headers to every outgoing request. This is useful for custom routing or tracing headers: ```ruby -options = Zitadel::Client::TransportOptions.new( - default_headers: { 'X-Custom-Header' => 'my-value' } -) - -zitadel = Zitadel::Client::Zitadel.with_client_credentials( - 'https://your-instance.zitadel.cloud', - 'client-id', - 'client-secret', - transport_options: options +options = Zitadel::Client::TransportOptions.builder + .default_headers({ 'X-Custom-Header' => 'my-value' }) + .build + +zitadel = Zitadel::Client::Zitadel.with_authenticator( + Zitadel::Client::Auth::ClientCredentialsAuthenticator.builder( + 'https://your-instance.zitadel.cloud', + 'client-id', + 'client-secret' + ).build, + options ) ``` @@ -272,13 +294,15 @@ specify the proxy URL. To authenticate with the proxy, embed the credentials directly in the URL: ```ruby -options = Zitadel::Client::TransportOptions.new(proxy_url: 'http://user:pass@proxy:8080') - -zitadel = Zitadel::Client::Zitadel.with_client_credentials( - 'https://your-instance.zitadel.cloud', - 'client-id', - 'client-secret', - transport_options: options +options = Zitadel::Client::TransportOptions.builder.proxy('http://user:pass@proxy:8080').build + +zitadel = Zitadel::Client::Zitadel.with_authenticator( + Zitadel::Client::Auth::ClientCredentialsAuthenticator.builder( + 'https://your-instance.zitadel.cloud', + 'client-id', + 'client-secret' + ).build, + options ) ``` diff --git a/SKILLS.md b/SKILLS.md new file mode 100644 index 00000000..94df8b95 --- /dev/null +++ b/SKILLS.md @@ -0,0 +1,126 @@ +# Zitadel SDK SDK - AI Agent Reference + +## Installation + +Add to your `Gemfile`: + +```ruby +gem 'zitadel-client' +``` + +Then run: + +```bash +bundle install +``` + +## Quick Start + +```ruby +require 'zitadel-client' + +client = Zitadel::Client::Zitadel.with_token('https://api.example.com', 'your-token') +``` + +## Authentication + +All authentication is handled via `Authenticator` implementations passed to the client constructor. + +### Bearer Token + +```ruby +authenticator = Zitadel::Client::Auth::BearerAuthenticator.new('https://api.example.com', 'your-token') +client = Zitadel::Client::Zitadel.new(authenticator) +``` + +## Servers + +If the OpenAPI spec defines multiple servers, the generated `Zitadel::Client::Servers` module exposes each as a `ServerConfiguration` constant (e.g., `SERVER_0`, `SERVER_1`, ...) plus an `ALL` array. Pass the desired server's URL to the client: + +```ruby +client = Zitadel::Client::Zitadel.with_token(Zitadel::Client::Servers::SERVER_0.url, 'your-token') +``` + +## Testing + +The `Authenticator` interface is the seam for tests: substitute a fake authenticator that returns a known header map, and assert your code calls the API the way you expect. + +```ruby +fake_authenticator = Class.new do + def get_auth_headers(request) = { 'Authorization' => 'Bearer test-token' } + def host = 'https://api.example.com' +end.new + +client = Zitadel::Client::Zitadel.new(fake_authenticator) +``` + +## Error Handling + +All API errors inherit from `ApiError`. The error hierarchy is: + +- `ApiError` (base) + - `ClientError` (4xx) + - `BadRequestError` (400) + - `UnauthorizedError` (401) + - `ForbiddenError` (403) + - `NotFoundError` (404) + - `ConflictError` (409) + - `UnprocessableEntityError` (422) + - `ServerError` (5xx) + - `InternalServerError` (500) + +```ruby +begin + result = client.pet_api.get_pet_by_id(pet_id) +rescue Zitadel::Client::Errors::NotFoundError => e + puts "Not found: #{e.message}" +rescue Zitadel::Client::Errors::ClientError => e + puts "Client error #{e.status_code}: #{e.message}" +rescue Zitadel::Client::Errors::ServerError => e + puts "Server error: #{e.message}" +rescue Zitadel::Client::Errors::ApiError => e + puts "API error: #{e.message}" +end +``` + +## Configuration + +### Custom Transport Options + +```ruby +transport = Zitadel::Client::TransportOptions.builder + .proxy('http://proxy:3128') + .timeout(5000) + .build + +client = Zitadel::Client::Zitadel.new(authenticator, transport) +``` + +## API Methods + +Each API group is exposed as a typed attribute on the client (e.g., `client.pet_api`). API classes have methods that correspond to OpenAPI operations, accepting typed request parameters and returning typed response models. + +## Models + +Models are generated as Ruby classes under the `Zitadel::Client::Models` namespace. + +```ruby +pet = Zitadel::Client::Models::Pet.new(name: 'Fido', status: 'available') +``` + +## Binary / File Uploads + +File upload parameters accept `File` objects or `IO`-like objects. Binary response bodies are returned as `String` with binary encoding. + +## Comment Style + +Use `#` comments on their own line. Never place inline comments on the same line as code. + +```good +# This explains the logic +x = 1 +``` + +```bad +x = 1 # This explains the logic +``` diff --git a/Steepfile b/Steepfile index a39c0190..308a7dc2 100644 --- a/Steepfile +++ b/Steepfile @@ -2,9 +2,11 @@ target :app do check 'lib' + check 'spec' + check 'test' signature 'sig' - library 'json', 'time', 'date', 'uri', 'pathname', 'net-http', 'tempfile', 'openssl' + library 'json', 'time', 'date', 'uri', 'pathname', 'net-http', 'tempfile', 'openssl', 'securerandom', 'logger' ignore 'lib/zitadel/client/models' ignore 'lib/zitadel/client/api' diff --git a/devbox.json b/devbox.json index 3b581872..ce8a5960 100644 --- a/devbox.json +++ b/devbox.json @@ -2,15 +2,14 @@ "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.10.7/.schema/devbox.schema.json", "packages": [ "ruby@4.0", - "lefthook@latest", - "clang@latest" + "clang@latest", + "github:mridang/nixpkgs#qodana" ], "env": { "BUNDLE_PATH": "./vendor/bundle" }, "shell": { "init_hook": [ - "lefthook install", "bundle install --quiet" ], "scripts": { diff --git a/devbox.lock b/devbox.lock index 92a16d78..9eefe776 100644 --- a/devbox.lock +++ b/devbox.lock @@ -49,54 +49,6 @@ } } }, - "lefthook@latest": { - "last_modified": "2025-05-16T20:19:48Z", - "resolved": "github:NixOS/nixpkgs/12a55407652e04dcf2309436eb06fef0d3713ef3#lefthook", - "source": "devbox-search", - "version": "1.11.12", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/kilfcgmnvx98lzr85mbbxrfa9px5879m-lefthook-1.11.12", - "default": true - } - ], - "store_path": "/nix/store/kilfcgmnvx98lzr85mbbxrfa9px5879m-lefthook-1.11.12" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/pvxs97fc0ba492bciazlqnh5ak0lcgiq-lefthook-1.11.12", - "default": true - } - ], - "store_path": "/nix/store/pvxs97fc0ba492bciazlqnh5ak0lcgiq-lefthook-1.11.12" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/9lrdwi4flvhkvyk6ipb2b8hikyhrr1gq-lefthook-1.11.12", - "default": true - } - ], - "store_path": "/nix/store/9lrdwi4flvhkvyk6ipb2b8hikyhrr1gq-lefthook-1.11.12" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/mpdpmidc3fpv6xnwkblwmnykgb8483sm-lefthook-1.11.12", - "default": true - } - ], - "store_path": "/nix/store/mpdpmidc3fpv6xnwkblwmnykgb8483sm-lefthook-1.11.12" - } - } - }, "ruby@4.0": { "last_modified": "2026-02-23T15:40:43Z", "plugin_version": "0.0.2", diff --git a/etc/docker-compose.yaml b/etc/docker-compose.yaml index de7731a3..9cb09c76 100644 --- a/etc/docker-compose.yaml +++ b/etc/docker-compose.yaml @@ -1,3 +1,4 @@ +name: zitadel-ruby services: db: image: postgres:17-alpine @@ -69,7 +70,7 @@ services: - './example-zitadel-secrets.yaml:/example-zitadel-secrets.yaml:ro' - './zitadel_output:/var/zitadel_output:rw' ports: - - "8099:8080" + - "8080" healthcheck: test: [ "CMD", "/app/zitadel", "ready", diff --git a/lib/zitadel-client.rb b/lib/zitadel-client.rb new file mode 100644 index 00000000..17d10adf --- /dev/null +++ b/lib/zitadel-client.rb @@ -0,0 +1,11 @@ +# rubocop:disable Naming/FileName -- gem-name entrypoint: `require 'zitadel-client'` +# frozen_string_literal: true + +# Gem entrypoint matching the gem name (`zitadel-client`), so that +# `require 'zitadel-client'` works. The filename must carry the gem's hyphen, +# which is why Naming/FileName is disabled above (the only place this is done). +# +# Loading is delegated to the Zeitwerk autoloader in zitadel_client.rb; this is +# the single source of truth for wiring the SDK's constant tree. +require_relative 'zitadel_client' +# rubocop:enable Naming/FileName diff --git a/lib/zitadel/client/api/.openapi b/lib/zitadel/client/api/.openapi deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/zitadel/client/api/action_service_api.rb b/lib/zitadel/client/api/action_service_api.rb index 22c52b05..54d09ac0 100644 --- a/lib/zitadel/client/api/action_service_api.rb +++ b/lib/zitadel/client/api/action_service_api.rb @@ -1,892 +1,817 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class ActionServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # ActionServiceApi provides methods for the ActionService API group. + class ActionServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Activate Public Key - # Activates the public key for payload encryption. The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`. Activating a new key will deactivate the current active key. Only one key can be active at a time. The active key is indicated in the `kid` header in the JWE token sent to the target. Activating a key that is already active is a no-op. Required permission: - `action.target.write` - # @param action_service_activate_public_key_request [ActionServiceActivatePublicKeyRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceActivatePublicKeyResponse] - def activate_public_key(action_service_activate_public_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.activate_public_key ...' # MODIFIED - end - # verify the required parameter 'action_service_activate_public_key_request' is set - if @api_client.config.client_side_validation && action_service_activate_public_key_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_activate_public_key_request' when calling Api::ActionServiceApi.activate_public_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/ActivatePublicKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Activates the public key for payload encryption. The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`. Activating a new key will deactivate the current active key. Only one key can be active at a time. The active key is indicated in the `kid` header in the JWE token sent to the target. Activating a key that is already active is a no-op. Required permission: - `action.target.write` + # @param action_service_activate_public_key_request [ActionServiceActivatePublicKeyRequest] + + # @return [ActionServiceActivatePublicKeyResponse] + # @raise [ApiError] if fails to make API call + def activate_public_key(action_service_activate_public_key_request) + if action_service_activate_public_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_activate_public_key_request' when calling ActionServiceApi.activate_public_key" + end + + result = activate_public_key_with_http_info(action_service_activate_public_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_activate_public_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceActivatePublicKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.activate_public_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#activate_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_public_key_with_http_info(action_service_activate_public_key_request) + if action_service_activate_public_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_activate_public_key_request' when calling ActionServiceApi.activate_public_key" + end + + path = '/zitadel.action.v2.ActionService/ActivatePublicKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_activate_public_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceActivatePublicKeyResponse', + nil + ) + end # Add Public Key - # Adds a public key to the target for payload encryption. The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`. The public key must be in PEM format and be either an RSA or an EC key. On a successful addition, a key ID is returned which can not only be used to manage the key (activate, remove), but also will be used as the `kid` header in the JWE token sent to the target to indicate which key was used for encryption. Note that newly added keys are inactive by default. You must activate the key to use it for payload encryption. Providing an optional expiration date allows you to set a validity period for the key. After the expiration date, the key will be automatically deactivated and no longer used for payload encryption. Be sure to activate a new key before the current active key expires to avoid interruptions in your target executions. You can have multiple inactive keys for rotation purposes, but only one active key at a time. Required permission: - `action.target.write` - # @param action_service_add_public_key_request [ActionServiceAddPublicKeyRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceAddPublicKeyResponse] - def add_public_key(action_service_add_public_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.add_public_key ...' # MODIFIED - end - # verify the required parameter 'action_service_add_public_key_request' is set - if @api_client.config.client_side_validation && action_service_add_public_key_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_add_public_key_request' when calling Api::ActionServiceApi.add_public_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/AddPublicKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Adds a public key to the target for payload encryption. The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`. The public key must be in PEM format and be either an RSA or an EC key. On a successful addition, a key ID is returned which can not only be used to manage the key (activate, remove), but also will be used as the `kid` header in the JWE token sent to the target to indicate which key was used for encryption. Note that newly added keys are inactive by default. You must activate the key to use it for payload encryption. Providing an optional expiration date allows you to set a validity period for the key. After the expiration date, the key will be automatically deactivated and no longer used for payload encryption. Be sure to activate a new key before the current active key expires to avoid interruptions in your target executions. You can have multiple inactive keys for rotation purposes, but only one active key at a time. Required permission: - `action.target.write` + # @param action_service_add_public_key_request [ActionServiceAddPublicKeyRequest] + + # @return [ActionServiceAddPublicKeyResponse] + # @raise [ApiError] if fails to make API call + def add_public_key(action_service_add_public_key_request) + if action_service_add_public_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_add_public_key_request' when calling ActionServiceApi.add_public_key" + end + + result = add_public_key_with_http_info(action_service_add_public_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_add_public_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceAddPublicKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.add_public_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#add_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_public_key_with_http_info(action_service_add_public_key_request) + if action_service_add_public_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_add_public_key_request' when calling ActionServiceApi.add_public_key" + end + + path = '/zitadel.action.v2.ActionService/AddPublicKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_add_public_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceAddPublicKeyResponse', + nil + ) + end # Create Target - # Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` - # @param action_service_create_target_request [ActionServiceCreateTargetRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceCreateTargetResponse] - def create_target(action_service_create_target_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.create_target ...' # MODIFIED - end - # verify the required parameter 'action_service_create_target_request' is set - if @api_client.config.client_side_validation && action_service_create_target_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_create_target_request' when calling Api::ActionServiceApi.create_target" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/CreateTarget' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` + # @param action_service_create_target_request [ActionServiceCreateTargetRequest] + + # @return [ActionServiceCreateTargetResponse] + # @raise [ApiError] if fails to make API call + def create_target(action_service_create_target_request) + if action_service_create_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_create_target_request' when calling ActionServiceApi.create_target" + end + + result = create_target_with_http_info(action_service_create_target_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_create_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceCreateTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.create_target", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#create_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_target_with_http_info(action_service_create_target_request) + if action_service_create_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_create_target_request' when calling ActionServiceApi.create_target" + end + + path = '/zitadel.action.v2.ActionService/CreateTarget' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_create_target_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceCreateTargetResponse', + nil + ) + end # Deactivate Public Key - # Deactivates the public key for payload encryption. The public key will no longer be used to encrypt payloads sent to the target. Be aware that deactivating the active key will leave the target without an active key. Subsequent calls to the target with payload type `PAYLOAD_TYPE_JWE` will fail until a new key is activated. This endpoint can be used in break glass scenarios to quickly disable a compromised key. Deactivating a key that is already inactive is a no-op. Required permission: - `action.target.write` - # @param action_service_deactivate_public_key_request [ActionServiceDeactivatePublicKeyRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceDeactivatePublicKeyResponse] - def deactivate_public_key(action_service_deactivate_public_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.deactivate_public_key ...' # MODIFIED - end - # verify the required parameter 'action_service_deactivate_public_key_request' is set - if @api_client.config.client_side_validation && action_service_deactivate_public_key_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_deactivate_public_key_request' when calling Api::ActionServiceApi.deactivate_public_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/DeactivatePublicKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deactivates the public key for payload encryption. The public key will no longer be used to encrypt payloads sent to the target. Be aware that deactivating the active key will leave the target without an active key. Subsequent calls to the target with payload type `PAYLOAD_TYPE_JWE` will fail until a new key is activated. This endpoint can be used in break glass scenarios to quickly disable a compromised key. Deactivating a key that is already inactive is a no-op. Required permission: - `action.target.write` + # @param action_service_deactivate_public_key_request [ActionServiceDeactivatePublicKeyRequest] + + # @return [ActionServiceDeactivatePublicKeyResponse] + # @raise [ApiError] if fails to make API call + def deactivate_public_key(action_service_deactivate_public_key_request) + if action_service_deactivate_public_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_deactivate_public_key_request' when calling ActionServiceApi.deactivate_public_key" + end + + result = deactivate_public_key_with_http_info(action_service_deactivate_public_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_deactivate_public_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceDeactivatePublicKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.deactivate_public_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#deactivate_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_public_key_with_http_info(action_service_deactivate_public_key_request) + if action_service_deactivate_public_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_deactivate_public_key_request' when calling ActionServiceApi.deactivate_public_key" + end + + path = '/zitadel.action.v2.ActionService/DeactivatePublicKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_deactivate_public_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceDeactivatePublicKeyResponse', + nil + ) + end # Delete Target - # Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` - # @param action_service_delete_target_request [ActionServiceDeleteTargetRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceDeleteTargetResponse] - def delete_target(action_service_delete_target_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.delete_target ...' # MODIFIED - end - # verify the required parameter 'action_service_delete_target_request' is set - if @api_client.config.client_side_validation && action_service_delete_target_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_delete_target_request' when calling Api::ActionServiceApi.delete_target" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/DeleteTarget' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` + # @param action_service_delete_target_request [ActionServiceDeleteTargetRequest] + + # @return [ActionServiceDeleteTargetResponse] + # @raise [ApiError] if fails to make API call + def delete_target(action_service_delete_target_request) + if action_service_delete_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_delete_target_request' when calling ActionServiceApi.delete_target" + end + + result = delete_target_with_http_info(action_service_delete_target_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_delete_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceDeleteTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.delete_target", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#delete_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_target_with_http_info(action_service_delete_target_request) + if action_service_delete_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_delete_target_request' when calling ActionServiceApi.delete_target" + end + + path = '/zitadel.action.v2.ActionService/DeleteTarget' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_delete_target_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceDeleteTargetResponse', + nil + ) + end # Get Target - # Returns the target identified by the requested ID. Required permission: - `action.target.read` - # @param action_service_get_target_request [ActionServiceGetTargetRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceGetTargetResponse] - def get_target(action_service_get_target_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.get_target ...' # MODIFIED - end - # verify the required parameter 'action_service_get_target_request' is set - if @api_client.config.client_side_validation && action_service_get_target_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_get_target_request' when calling Api::ActionServiceApi.get_target" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/GetTarget' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Returns the target identified by the requested ID. Required permission: - `action.target.read` + # @param action_service_get_target_request [ActionServiceGetTargetRequest] + + # @return [ActionServiceGetTargetResponse] + # @raise [ApiError] if fails to make API call + def get_target(action_service_get_target_request) + if action_service_get_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_get_target_request' when calling ActionServiceApi.get_target" + end + + result = get_target_with_http_info(action_service_get_target_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_get_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceGetTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.get_target", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#get_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_target_with_http_info(action_service_get_target_request) + if action_service_get_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_get_target_request' when calling ActionServiceApi.get_target" + end + + path = '/zitadel.action.v2.ActionService/GetTarget' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_get_target_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceGetTargetResponse', + nil + ) + end # List Execution Functions # List all available functions which can be used as condition for executions. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [ActionServiceListExecutionFunctionsResponse] - def list_execution_functions(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.list_execution_functions ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::ActionServiceApi.list_execution_functions" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/ListExecutionFunctions' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [ActionServiceListExecutionFunctionsResponse] + # @raise [ApiError] if fails to make API call + def list_execution_functions(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling ActionServiceApi.list_execution_functions" + end + + result = list_execution_functions_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceListExecutionFunctionsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.list_execution_functions", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#list_execution_functions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_execution_functions_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling ActionServiceApi.list_execution_functions" + end + + path = '/zitadel.action.v2.ActionService/ListExecutionFunctions' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceListExecutionFunctionsResponse', + nil + ) + end # List Execution Methods # List all available methods which can be used as condition for executions. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [ActionServiceListExecutionMethodsResponse] - def list_execution_methods(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.list_execution_methods ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::ActionServiceApi.list_execution_methods" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/ListExecutionMethods' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [ActionServiceListExecutionMethodsResponse] + # @raise [ApiError] if fails to make API call + def list_execution_methods(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling ActionServiceApi.list_execution_methods" + end + + result = list_execution_methods_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceListExecutionMethodsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.list_execution_methods", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#list_execution_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_execution_methods_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling ActionServiceApi.list_execution_methods" + end + + path = '/zitadel.action.v2.ActionService/ListExecutionMethods' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceListExecutionMethodsResponse', + nil + ) + end # List Execution Services # List all available services which can be used as condition for executions. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [ActionServiceListExecutionServicesResponse] - def list_execution_services(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.list_execution_services ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::ActionServiceApi.list_execution_services" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/ListExecutionServices' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [ActionServiceListExecutionServicesResponse] + # @raise [ApiError] if fails to make API call + def list_execution_services(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling ActionServiceApi.list_execution_services" + end + + result = list_execution_services_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceListExecutionServicesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.list_execution_services", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#list_execution_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_execution_services_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling ActionServiceApi.list_execution_services" + end + + path = '/zitadel.action.v2.ActionService/ListExecutionServices' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceListExecutionServicesResponse', + nil + ) + end # List Executions - # List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` - # @param action_service_list_executions_request [ActionServiceListExecutionsRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceListExecutionsResponse] - def list_executions(action_service_list_executions_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.list_executions ...' # MODIFIED - end - # verify the required parameter 'action_service_list_executions_request' is set - if @api_client.config.client_side_validation && action_service_list_executions_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_list_executions_request' when calling Api::ActionServiceApi.list_executions" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/ListExecutions' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` + # @param action_service_list_executions_request [ActionServiceListExecutionsRequest] + + # @return [ActionServiceListExecutionsResponse] + # @raise [ApiError] if fails to make API call + def list_executions(action_service_list_executions_request) + if action_service_list_executions_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_list_executions_request' when calling ActionServiceApi.list_executions" + end + + result = list_executions_with_http_info(action_service_list_executions_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_list_executions_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceListExecutionsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.list_executions", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#list_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_executions_with_http_info(action_service_list_executions_request) + if action_service_list_executions_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_list_executions_request' when calling ActionServiceApi.list_executions" + end + + path = '/zitadel.action.v2.ActionService/ListExecutions' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_list_executions_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceListExecutionsResponse', + nil + ) + end # List Public Keys - # Lists all public keys of a target. The response includes which key is active and the key's expiration dates. This allows you to manage key rotations and ensure that your target always has an active key for payload encryption. Required permission: - `action.target.read` - # @param action_service_list_public_keys_request [ActionServiceListPublicKeysRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceListPublicKeysResponse] - def list_public_keys(action_service_list_public_keys_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.list_public_keys ...' # MODIFIED - end - # verify the required parameter 'action_service_list_public_keys_request' is set - if @api_client.config.client_side_validation && action_service_list_public_keys_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_list_public_keys_request' when calling Api::ActionServiceApi.list_public_keys" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/ListPublicKeys' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Lists all public keys of a target. The response includes which key is active and the key's expiration dates. This allows you to manage key rotations and ensure that your target always has an active key for payload encryption. Required permission: - `action.target.read` + # @param action_service_list_public_keys_request [ActionServiceListPublicKeysRequest] + + # @return [ActionServiceListPublicKeysResponse] + # @raise [ApiError] if fails to make API call + def list_public_keys(action_service_list_public_keys_request) + if action_service_list_public_keys_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_list_public_keys_request' when calling ActionServiceApi.list_public_keys" + end + + result = list_public_keys_with_http_info(action_service_list_public_keys_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_list_public_keys_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceListPublicKeysResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.list_public_keys", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#list_public_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_public_keys_with_http_info(action_service_list_public_keys_request) + if action_service_list_public_keys_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_list_public_keys_request' when calling ActionServiceApi.list_public_keys" + end + + path = '/zitadel.action.v2.ActionService/ListPublicKeys' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_list_public_keys_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceListPublicKeysResponse', + nil + ) + end # List targets - # List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` - # @param action_service_list_targets_request [ActionServiceListTargetsRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceListTargetsResponse] - def list_targets(action_service_list_targets_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.list_targets ...' # MODIFIED - end - # verify the required parameter 'action_service_list_targets_request' is set - if @api_client.config.client_side_validation && action_service_list_targets_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_list_targets_request' when calling Api::ActionServiceApi.list_targets" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/ListTargets' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` + # @param action_service_list_targets_request [ActionServiceListTargetsRequest] + + # @return [ActionServiceListTargetsResponse] + # @raise [ApiError] if fails to make API call + def list_targets(action_service_list_targets_request) + if action_service_list_targets_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_list_targets_request' when calling ActionServiceApi.list_targets" + end + + result = list_targets_with_http_info(action_service_list_targets_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_list_targets_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceListTargetsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.list_targets", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#list_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_targets_with_http_info(action_service_list_targets_request) + if action_service_list_targets_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_list_targets_request' when calling ActionServiceApi.list_targets" + end + + path = '/zitadel.action.v2.ActionService/ListTargets' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_list_targets_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceListTargetsResponse', + nil + ) + end # Remove Public Key - # Removes the public key from the target. This is a permanent action and can not be undone. Note that you can only remove inactive keys. Attempting to remove an active key will result in an error. For break glass scenarios, deactivate the key first and then remove it. Removing a non-existing key is a no-op. Required permission: - `action.target.write` - # @param action_service_remove_public_key_request [ActionServiceRemovePublicKeyRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceRemovePublicKeyResponse] - def remove_public_key(action_service_remove_public_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.remove_public_key ...' # MODIFIED - end - # verify the required parameter 'action_service_remove_public_key_request' is set - if @api_client.config.client_side_validation && action_service_remove_public_key_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_remove_public_key_request' when calling Api::ActionServiceApi.remove_public_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/RemovePublicKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Removes the public key from the target. This is a permanent action and can not be undone. Note that you can only remove inactive keys. Attempting to remove an active key will result in an error. For break glass scenarios, deactivate the key first and then remove it. Removing a non-existing key is a no-op. Required permission: - `action.target.write` + # @param action_service_remove_public_key_request [ActionServiceRemovePublicKeyRequest] + + # @return [ActionServiceRemovePublicKeyResponse] + # @raise [ApiError] if fails to make API call + def remove_public_key(action_service_remove_public_key_request) + if action_service_remove_public_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_remove_public_key_request' when calling ActionServiceApi.remove_public_key" + end + + result = remove_public_key_with_http_info(action_service_remove_public_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_remove_public_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceRemovePublicKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.remove_public_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#remove_public_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_public_key_with_http_info(action_service_remove_public_key_request) + if action_service_remove_public_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_remove_public_key_request' when calling ActionServiceApi.remove_public_key" + end + + path = '/zitadel.action.v2.ActionService/RemovePublicKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_remove_public_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceRemovePublicKeyResponse', + nil + ) + end # Set Execution - # Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` - # @param action_service_set_execution_request [ActionServiceSetExecutionRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceSetExecutionResponse] - def set_execution(action_service_set_execution_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.set_execution ...' # MODIFIED - end - # verify the required parameter 'action_service_set_execution_request' is set - if @api_client.config.client_side_validation && action_service_set_execution_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_set_execution_request' when calling Api::ActionServiceApi.set_execution" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/SetExecution' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` + # @param action_service_set_execution_request [ActionServiceSetExecutionRequest] + + # @return [ActionServiceSetExecutionResponse] + # @raise [ApiError] if fails to make API call + def set_execution(action_service_set_execution_request) + if action_service_set_execution_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_set_execution_request' when calling ActionServiceApi.set_execution" + end + + result = set_execution_with_http_info(action_service_set_execution_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_set_execution_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceSetExecutionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.set_execution", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#set_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_execution_with_http_info(action_service_set_execution_request) + if action_service_set_execution_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_set_execution_request' when calling ActionServiceApi.set_execution" + end + + path = '/zitadel.action.v2.ActionService/SetExecution' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_set_execution_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceSetExecutionResponse', + nil + ) + end # Update Target - # Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` - # @param action_service_update_target_request [ActionServiceUpdateTargetRequest] - # @param [Hash] opts the optional parameters - # @return [ActionServiceUpdateTargetResponse] - def update_target(action_service_update_target_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ActionServiceApi.update_target ...' # MODIFIED - end - # verify the required parameter 'action_service_update_target_request' is set - if @api_client.config.client_side_validation && action_service_update_target_request.nil? - fail ArgumentError, "Missing the required parameter 'action_service_update_target_request' when calling Api::ActionServiceApi.update_target" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2.ActionService/UpdateTarget' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` + # @param action_service_update_target_request [ActionServiceUpdateTargetRequest] + + # @return [ActionServiceUpdateTargetResponse] + # @raise [ApiError] if fails to make API call + def update_target(action_service_update_target_request) + if action_service_update_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_update_target_request' when calling ActionServiceApi.update_target" + end + + result = update_target_with_http_info(action_service_update_target_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(action_service_update_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'ActionServiceUpdateTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ActionServiceApi.update_target", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ActionServiceApi#update_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_target_with_http_info(action_service_update_target_request) + if action_service_update_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'action_service_update_target_request' when calling ActionServiceApi.update_target" + end + + path = '/zitadel.action.v2.ActionService/UpdateTarget' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = action_service_update_target_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ActionServiceUpdateTargetResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/application_service_api.rb b/lib/zitadel/client/api/application_service_api.rb index 66efd1f6..1ccdc4ce 100644 --- a/lib/zitadel/client/api/application_service_api.rb +++ b/lib/zitadel/client/api/application_service_api.rb @@ -1,718 +1,658 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class ApplicationServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # ApplicationServiceApi provides methods for the ApplicationService API group. + class ApplicationServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Create Application # Create an application. The application can be OIDC, API or SAML type, based on the input. Required permissions: - project.app.write - # @param application_service_create_application_request [ApplicationServiceCreateApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceCreateApplicationResponse] - def create_application(application_service_create_application_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.create_application ...' # MODIFIED - end - # verify the required parameter 'application_service_create_application_request' is set - if @api_client.config.client_side_validation && application_service_create_application_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_create_application_request' when calling Api::ApplicationServiceApi.create_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/CreateApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_create_application_request [ApplicationServiceCreateApplicationRequest] + + # @return [ApplicationServiceCreateApplicationResponse] + # @raise [ApiError] if fails to make API call + def create_application(application_service_create_application_request) + if application_service_create_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_create_application_request' when calling ApplicationServiceApi.create_application" + end + + result = create_application_with_http_info(application_service_create_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_create_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceCreateApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.create_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#create_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_application_with_http_info(application_service_create_application_request) + if application_service_create_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_create_application_request' when calling ApplicationServiceApi.create_application" + end + + path = '/zitadel.application.v2.ApplicationService/CreateApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_create_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceCreateApplicationResponse', + nil + ) + end # Create Application Key - # Create a new application key, which is used to authorize an API application. Key details are returned in the response. They must be stored safely, as it will not be possible to retrieve them again. Required permissions: - `project.app.write` - # @param application_service_create_application_key_request [ApplicationServiceCreateApplicationKeyRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceCreateApplicationKeyResponse] - def create_application_key(application_service_create_application_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.create_application_key ...' # MODIFIED - end - # verify the required parameter 'application_service_create_application_key_request' is set - if @api_client.config.client_side_validation && application_service_create_application_key_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_create_application_key_request' when calling Api::ApplicationServiceApi.create_application_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/CreateApplicationKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Create a new application key, which is used to authorize an API application. Key details are returned in the response. They must be stored safely, as it will not be possible to retrieve them again. Required permissions: - `project.app.write` + # @param application_service_create_application_key_request [ApplicationServiceCreateApplicationKeyRequest] + + # @return [ApplicationServiceCreateApplicationKeyResponse] + # @raise [ApiError] if fails to make API call + def create_application_key(application_service_create_application_key_request) + if application_service_create_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_create_application_key_request' when calling ApplicationServiceApi.create_application_key" + end + + result = create_application_key_with_http_info(application_service_create_application_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_create_application_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceCreateApplicationKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.create_application_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#create_application_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_application_key_with_http_info(application_service_create_application_key_request) + if application_service_create_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_create_application_key_request' when calling ApplicationServiceApi.create_application_key" + end + + path = '/zitadel.application.v2.ApplicationService/CreateApplicationKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_create_application_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceCreateApplicationKeyResponse', + nil + ) + end # Deactivate Application # Deactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write - # @param application_service_deactivate_application_request [ApplicationServiceDeactivateApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceDeactivateApplicationResponse] - def deactivate_application(application_service_deactivate_application_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.deactivate_application ...' # MODIFIED - end - # verify the required parameter 'application_service_deactivate_application_request' is set - if @api_client.config.client_side_validation && application_service_deactivate_application_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_deactivate_application_request' when calling Api::ApplicationServiceApi.deactivate_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/DeactivateApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_deactivate_application_request [ApplicationServiceDeactivateApplicationRequest] + + # @return [ApplicationServiceDeactivateApplicationResponse] + # @raise [ApiError] if fails to make API call + def deactivate_application(application_service_deactivate_application_request) + if application_service_deactivate_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_deactivate_application_request' when calling ApplicationServiceApi.deactivate_application" + end + + result = deactivate_application_with_http_info(application_service_deactivate_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_deactivate_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceDeactivateApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.deactivate_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#deactivate_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_application_with_http_info(application_service_deactivate_application_request) + if application_service_deactivate_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_deactivate_application_request' when calling ApplicationServiceApi.deactivate_application" + end + + path = '/zitadel.application.v2.ApplicationService/DeactivateApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_deactivate_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceDeactivateApplicationResponse', + nil + ) + end # Delete Application # Deletes the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.delete - # @param application_service_delete_application_request [ApplicationServiceDeleteApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceDeleteApplicationResponse] - def delete_application(application_service_delete_application_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.delete_application ...' # MODIFIED - end - # verify the required parameter 'application_service_delete_application_request' is set - if @api_client.config.client_side_validation && application_service_delete_application_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_delete_application_request' when calling Api::ApplicationServiceApi.delete_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/DeleteApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_delete_application_request [ApplicationServiceDeleteApplicationRequest] + + # @return [ApplicationServiceDeleteApplicationResponse] + # @raise [ApiError] if fails to make API call + def delete_application(application_service_delete_application_request) + if application_service_delete_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_delete_application_request' when calling ApplicationServiceApi.delete_application" + end + + result = delete_application_with_http_info(application_service_delete_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_delete_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceDeleteApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.delete_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#delete_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_application_with_http_info(application_service_delete_application_request) + if application_service_delete_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_delete_application_request' when calling ApplicationServiceApi.delete_application" + end + + path = '/zitadel.application.v2.ApplicationService/DeleteApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_delete_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceDeleteApplicationResponse', + nil + ) + end # Delete Application Key - # Deletes an application key matching the provided ID. Organization ID is not mandatory, but helps with filtering/performance. The deletion time is returned in response message. Required permissions: - `project.app.write` - # @param application_service_delete_application_key_request [ApplicationServiceDeleteApplicationKeyRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceDeleteApplicationKeyResponse] - def delete_application_key(application_service_delete_application_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.delete_application_key ...' # MODIFIED - end - # verify the required parameter 'application_service_delete_application_key_request' is set - if @api_client.config.client_side_validation && application_service_delete_application_key_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_delete_application_key_request' when calling Api::ApplicationServiceApi.delete_application_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/DeleteApplicationKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deletes an application key matching the provided ID. Organization ID is not mandatory, but helps with filtering/performance. The deletion time is returned in response message. Required permissions: - `project.app.write` + # @param application_service_delete_application_key_request [ApplicationServiceDeleteApplicationKeyRequest] + + # @return [ApplicationServiceDeleteApplicationKeyResponse] + # @raise [ApiError] if fails to make API call + def delete_application_key(application_service_delete_application_key_request) + if application_service_delete_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_delete_application_key_request' when calling ApplicationServiceApi.delete_application_key" + end + + result = delete_application_key_with_http_info(application_service_delete_application_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_delete_application_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceDeleteApplicationKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.delete_application_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#delete_application_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_application_key_with_http_info(application_service_delete_application_key_request) + if application_service_delete_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_delete_application_key_request' when calling ApplicationServiceApi.delete_application_key" + end + + path = '/zitadel.application.v2.ApplicationService/DeleteApplicationKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_delete_application_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceDeleteApplicationKeyResponse', + nil + ) + end # Generate Client Secret # Generates the client secret of an API or OIDC application that belongs to the input project. Required permissions: - project.app.write - # @param application_service_generate_client_secret_request [ApplicationServiceGenerateClientSecretRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceGenerateClientSecretResponse] - def generate_client_secret(application_service_generate_client_secret_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.generate_client_secret ...' # MODIFIED - end - # verify the required parameter 'application_service_generate_client_secret_request' is set - if @api_client.config.client_side_validation && application_service_generate_client_secret_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_generate_client_secret_request' when calling Api::ApplicationServiceApi.generate_client_secret" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/GenerateClientSecret' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_generate_client_secret_request [ApplicationServiceGenerateClientSecretRequest] + + # @return [ApplicationServiceGenerateClientSecretResponse] + # @raise [ApiError] if fails to make API call + def generate_client_secret(application_service_generate_client_secret_request) + if application_service_generate_client_secret_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_generate_client_secret_request' when calling ApplicationServiceApi.generate_client_secret" + end + + result = generate_client_secret_with_http_info(application_service_generate_client_secret_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_generate_client_secret_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceGenerateClientSecretResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.generate_client_secret", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#generate_client_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def generate_client_secret_with_http_info(application_service_generate_client_secret_request) + if application_service_generate_client_secret_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_generate_client_secret_request' when calling ApplicationServiceApi.generate_client_secret" + end + + path = '/zitadel.application.v2.ApplicationService/GenerateClientSecret' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_generate_client_secret_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceGenerateClientSecretResponse', + nil + ) + end # Get Application # Retrieves the application matching the provided ID. Required permissions: - project.app.read - # @param application_service_get_application_request [ApplicationServiceGetApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceGetApplicationResponse] - def get_application(application_service_get_application_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.get_application ...' # MODIFIED - end - # verify the required parameter 'application_service_get_application_request' is set - if @api_client.config.client_side_validation && application_service_get_application_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_get_application_request' when calling Api::ApplicationServiceApi.get_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/GetApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_get_application_request [ApplicationServiceGetApplicationRequest] + + # @return [ApplicationServiceGetApplicationResponse] + # @raise [ApiError] if fails to make API call + def get_application(application_service_get_application_request) + if application_service_get_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_get_application_request' when calling ApplicationServiceApi.get_application" + end + + result = get_application_with_http_info(application_service_get_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_get_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceGetApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.get_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#get_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_application_with_http_info(application_service_get_application_request) + if application_service_get_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_get_application_request' when calling ApplicationServiceApi.get_application" + end + + path = '/zitadel.application.v2.ApplicationService/GetApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_get_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceGetApplicationResponse', + nil + ) + end # Get Application Key # Retrieves the application key matching the provided ID. Specifying a project, organization and application ID is optional but help with filtering/performance. Required permissions: - project.app.read - # @param application_service_get_application_key_request [ApplicationServiceGetApplicationKeyRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceGetApplicationKeyResponse] - def get_application_key(application_service_get_application_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.get_application_key ...' # MODIFIED - end - # verify the required parameter 'application_service_get_application_key_request' is set - if @api_client.config.client_side_validation && application_service_get_application_key_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_get_application_key_request' when calling Api::ApplicationServiceApi.get_application_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/GetApplicationKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_get_application_key_request [ApplicationServiceGetApplicationKeyRequest] + + # @return [ApplicationServiceGetApplicationKeyResponse] + # @raise [ApiError] if fails to make API call + def get_application_key(application_service_get_application_key_request) + if application_service_get_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_get_application_key_request' when calling ApplicationServiceApi.get_application_key" + end + + result = get_application_key_with_http_info(application_service_get_application_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_get_application_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceGetApplicationKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.get_application_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#get_application_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_application_key_with_http_info(application_service_get_application_key_request) + if application_service_get_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_get_application_key_request' when calling ApplicationServiceApi.get_application_key" + end + + path = '/zitadel.application.v2.ApplicationService/GetApplicationKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_get_application_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceGetApplicationKeyResponse', + nil + ) + end # List Application Keys # Returns a list of application keys matching the input parameters. The result can be sorted by id, aggregate, creation date, expiration date, resource owner or type. It can also be filtered by application, project or organization ID. Required permissions: - project.app.read - # @param application_service_list_application_keys_request [ApplicationServiceListApplicationKeysRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceListApplicationKeysResponse] - def list_application_keys(application_service_list_application_keys_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.list_application_keys ...' # MODIFIED - end - # verify the required parameter 'application_service_list_application_keys_request' is set - if @api_client.config.client_side_validation && application_service_list_application_keys_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_list_application_keys_request' when calling Api::ApplicationServiceApi.list_application_keys" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/ListApplicationKeys' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_list_application_keys_request [ApplicationServiceListApplicationKeysRequest] + + # @return [ApplicationServiceListApplicationKeysResponse] + # @raise [ApiError] if fails to make API call + def list_application_keys(application_service_list_application_keys_request) + if application_service_list_application_keys_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_list_application_keys_request' when calling ApplicationServiceApi.list_application_keys" + end + + result = list_application_keys_with_http_info(application_service_list_application_keys_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_list_application_keys_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceListApplicationKeysResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.list_application_keys", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#list_application_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_application_keys_with_http_info(application_service_list_application_keys_request) + if application_service_list_application_keys_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_list_application_keys_request' when calling ApplicationServiceApi.list_application_keys" + end + + path = '/zitadel.application.v2.ApplicationService/ListApplicationKeys' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_list_application_keys_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceListApplicationKeysResponse', + nil + ) + end # List Applications # Returns a list of applications matching the input parameters. The results can be filtered by project, state, type and name. It can be sorted by id, name, creation date, change date or state. Required permissions: - project.app.read - # @param application_service_list_applications_request [ApplicationServiceListApplicationsRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceListApplicationsResponse] - def list_applications(application_service_list_applications_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.list_applications ...' # MODIFIED - end - # verify the required parameter 'application_service_list_applications_request' is set - if @api_client.config.client_side_validation && application_service_list_applications_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_list_applications_request' when calling Api::ApplicationServiceApi.list_applications" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/ListApplications' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_list_applications_request [ApplicationServiceListApplicationsRequest] + + # @return [ApplicationServiceListApplicationsResponse] + # @raise [ApiError] if fails to make API call + def list_applications(application_service_list_applications_request) + if application_service_list_applications_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_list_applications_request' when calling ApplicationServiceApi.list_applications" + end + + result = list_applications_with_http_info(application_service_list_applications_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_list_applications_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceListApplicationsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.list_applications", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#list_applications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_applications_with_http_info(application_service_list_applications_request) + if application_service_list_applications_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_list_applications_request' when calling ApplicationServiceApi.list_applications" + end + + path = '/zitadel.application.v2.ApplicationService/ListApplications' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_list_applications_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceListApplicationsResponse', + nil + ) + end # Reactivate Application # Reactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write - # @param application_service_reactivate_application_request [ApplicationServiceReactivateApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceReactivateApplicationResponse] - def reactivate_application(application_service_reactivate_application_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.reactivate_application ...' # MODIFIED - end - # verify the required parameter 'application_service_reactivate_application_request' is set - if @api_client.config.client_side_validation && application_service_reactivate_application_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_reactivate_application_request' when calling Api::ApplicationServiceApi.reactivate_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/ReactivateApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_reactivate_application_request [ApplicationServiceReactivateApplicationRequest] + + # @return [ApplicationServiceReactivateApplicationResponse] + # @raise [ApiError] if fails to make API call + def reactivate_application(application_service_reactivate_application_request) + if application_service_reactivate_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_reactivate_application_request' when calling ApplicationServiceApi.reactivate_application" + end + + result = reactivate_application_with_http_info(application_service_reactivate_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_reactivate_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceReactivateApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.reactivate_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#reactivate_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reactivate_application_with_http_info(application_service_reactivate_application_request) + if application_service_reactivate_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_reactivate_application_request' when calling ApplicationServiceApi.reactivate_application" + end + + path = '/zitadel.application.v2.ApplicationService/ReactivateApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_reactivate_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceReactivateApplicationResponse', + nil + ) + end # Update Application # Changes the configuration of an OIDC, API or SAML type application, as well as the application name, based on the input provided. Required permissions: - project.app.write - # @param application_service_update_application_request [ApplicationServiceUpdateApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationServiceUpdateApplicationResponse] - def update_application(application_service_update_application_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ApplicationServiceApi.update_application ...' # MODIFIED - end - # verify the required parameter 'application_service_update_application_request' is set - if @api_client.config.client_side_validation && application_service_update_application_request.nil? - fail ArgumentError, "Missing the required parameter 'application_service_update_application_request' when calling Api::ApplicationServiceApi.update_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.application.v2.ApplicationService/UpdateApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param application_service_update_application_request [ApplicationServiceUpdateApplicationRequest] + + # @return [ApplicationServiceUpdateApplicationResponse] + # @raise [ApiError] if fails to make API call + def update_application(application_service_update_application_request) + if application_service_update_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_update_application_request' when calling ApplicationServiceApi.update_application" + end + + result = update_application_with_http_info(application_service_update_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_service_update_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationServiceUpdateApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ApplicationServiceApi.update_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ApplicationServiceApi#update_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_application_with_http_info(application_service_update_application_request) + if application_service_update_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'application_service_update_application_request' when calling ApplicationServiceApi.update_application" + end + + path = '/zitadel.application.v2.ApplicationService/UpdateApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = application_service_update_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ApplicationServiceUpdateApplicationResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/authorization_service_api.rb b/lib/zitadel/client/api/authorization_service_api.rb index 91811945..4f112800 100644 --- a/lib/zitadel/client/api/authorization_service_api.rb +++ b/lib/zitadel/client/api/authorization_service_api.rb @@ -1,370 +1,340 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class AuthorizationServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # AuthorizationServiceApi provides methods for the AuthorizationService API group. + class AuthorizationServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Activate Authorization - # ActivateAuthorization activates an existing but inactive authorization. In case the authorization is already active, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was activated by the request. Required permissions: - \"user.grant.write\" - # @param authorization_service_activate_authorization_request [AuthorizationServiceActivateAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [AuthorizationServiceActivateAuthorizationResponse] - def activate_authorization(authorization_service_activate_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::AuthorizationServiceApi.activate_authorization ...' # MODIFIED - end - # verify the required parameter 'authorization_service_activate_authorization_request' is set - if @api_client.config.client_side_validation && authorization_service_activate_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'authorization_service_activate_authorization_request' when calling Api::AuthorizationServiceApi.activate_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2.AuthorizationService/ActivateAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # ActivateAuthorization activates an existing but inactive authorization. In case the authorization is already active, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was activated by the request. Required permissions: - \"user.grant.write\" + # @param authorization_service_activate_authorization_request [AuthorizationServiceActivateAuthorizationRequest] + + # @return [AuthorizationServiceActivateAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def activate_authorization(authorization_service_activate_authorization_request) + if authorization_service_activate_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_activate_authorization_request' when calling AuthorizationServiceApi.activate_authorization" + end + + result = activate_authorization_with_http_info(authorization_service_activate_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_service_activate_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'AuthorizationServiceActivateAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::AuthorizationServiceApi.activate_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::AuthorizationServiceApi#activate_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_authorization_with_http_info(authorization_service_activate_authorization_request) + if authorization_service_activate_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_activate_authorization_request' when calling AuthorizationServiceApi.activate_authorization" + end + + path = '/zitadel.authorization.v2.AuthorizationService/ActivateAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = authorization_service_activate_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'AuthorizationServiceActivateAuthorizationResponse', + nil + ) + end # Create Authorization - # CreateAuthorization creates a new authorization for a user in an owned or granted project. Required permissions: - \"user.grant.write\" - # @param authorization_service_create_authorization_request [AuthorizationServiceCreateAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [AuthorizationServiceCreateAuthorizationResponse] - def create_authorization(authorization_service_create_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::AuthorizationServiceApi.create_authorization ...' # MODIFIED - end - # verify the required parameter 'authorization_service_create_authorization_request' is set - if @api_client.config.client_side_validation && authorization_service_create_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'authorization_service_create_authorization_request' when calling Api::AuthorizationServiceApi.create_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2.AuthorizationService/CreateAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # CreateAuthorization creates a new authorization for a user in an owned or granted project. Required permissions: - \"user.grant.write\" + # @param authorization_service_create_authorization_request [AuthorizationServiceCreateAuthorizationRequest] + + # @return [AuthorizationServiceCreateAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def create_authorization(authorization_service_create_authorization_request) + if authorization_service_create_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_create_authorization_request' when calling AuthorizationServiceApi.create_authorization" + end + + result = create_authorization_with_http_info(authorization_service_create_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_service_create_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'AuthorizationServiceCreateAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::AuthorizationServiceApi.create_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::AuthorizationServiceApi#create_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_authorization_with_http_info(authorization_service_create_authorization_request) + if authorization_service_create_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_create_authorization_request' when calling AuthorizationServiceApi.create_authorization" + end + + path = '/zitadel.authorization.v2.AuthorizationService/CreateAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = authorization_service_create_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'AuthorizationServiceCreateAuthorizationResponse', + nil + ) + end # Deactivate Authorization - # DeactivateAuthorization deactivates an existing and active authorization. In case the authorization is already inactive, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was deactivated by the request. Required permissions: - \"user.grant.write\" - # @param authorization_service_deactivate_authorization_request [AuthorizationServiceDeactivateAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [AuthorizationServiceDeactivateAuthorizationResponse] - def deactivate_authorization(authorization_service_deactivate_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::AuthorizationServiceApi.deactivate_authorization ...' # MODIFIED - end - # verify the required parameter 'authorization_service_deactivate_authorization_request' is set - if @api_client.config.client_side_validation && authorization_service_deactivate_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'authorization_service_deactivate_authorization_request' when calling Api::AuthorizationServiceApi.deactivate_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2.AuthorizationService/DeactivateAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # DeactivateAuthorization deactivates an existing and active authorization. In case the authorization is already inactive, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was deactivated by the request. Required permissions: - \"user.grant.write\" + # @param authorization_service_deactivate_authorization_request [AuthorizationServiceDeactivateAuthorizationRequest] + + # @return [AuthorizationServiceDeactivateAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def deactivate_authorization(authorization_service_deactivate_authorization_request) + if authorization_service_deactivate_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_deactivate_authorization_request' when calling AuthorizationServiceApi.deactivate_authorization" + end + + result = deactivate_authorization_with_http_info(authorization_service_deactivate_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_service_deactivate_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'AuthorizationServiceDeactivateAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::AuthorizationServiceApi.deactivate_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::AuthorizationServiceApi#deactivate_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_authorization_with_http_info(authorization_service_deactivate_authorization_request) + if authorization_service_deactivate_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_deactivate_authorization_request' when calling AuthorizationServiceApi.deactivate_authorization" + end + + path = '/zitadel.authorization.v2.AuthorizationService/DeactivateAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = authorization_service_deactivate_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'AuthorizationServiceDeactivateAuthorizationResponse', + nil + ) + end # Delete Authorization - # DeleteAuthorization deletes the authorization. In case the authorization is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the authorization was deleted by the request. Required permissions: - \"user.grant.delete\" - # @param authorization_service_delete_authorization_request [AuthorizationServiceDeleteAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [AuthorizationServiceDeleteAuthorizationResponse] - def delete_authorization(authorization_service_delete_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::AuthorizationServiceApi.delete_authorization ...' # MODIFIED - end - # verify the required parameter 'authorization_service_delete_authorization_request' is set - if @api_client.config.client_side_validation && authorization_service_delete_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'authorization_service_delete_authorization_request' when calling Api::AuthorizationServiceApi.delete_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2.AuthorizationService/DeleteAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # DeleteAuthorization deletes the authorization. In case the authorization is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the authorization was deleted by the request. Required permissions: - \"user.grant.delete\" + # @param authorization_service_delete_authorization_request [AuthorizationServiceDeleteAuthorizationRequest] + + # @return [AuthorizationServiceDeleteAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def delete_authorization(authorization_service_delete_authorization_request) + if authorization_service_delete_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_delete_authorization_request' when calling AuthorizationServiceApi.delete_authorization" + end + + result = delete_authorization_with_http_info(authorization_service_delete_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_service_delete_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'AuthorizationServiceDeleteAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::AuthorizationServiceApi.delete_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::AuthorizationServiceApi#delete_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_authorization_with_http_info(authorization_service_delete_authorization_request) + if authorization_service_delete_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_delete_authorization_request' when calling AuthorizationServiceApi.delete_authorization" + end + + path = '/zitadel.authorization.v2.AuthorizationService/DeleteAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = authorization_service_delete_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'AuthorizationServiceDeleteAuthorizationResponse', + nil + ) + end # List Authorizations - # ListAuthorizations returns all authorizations matching the request and necessary permissions. Required permissions: - \"user.grant.read\" - no permissions required for listing own authorizations - # @param authorization_service_list_authorizations_request [AuthorizationServiceListAuthorizationsRequest] - # @param [Hash] opts the optional parameters - # @return [AuthorizationServiceListAuthorizationsResponse] - def list_authorizations(authorization_service_list_authorizations_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::AuthorizationServiceApi.list_authorizations ...' # MODIFIED - end - # verify the required parameter 'authorization_service_list_authorizations_request' is set - if @api_client.config.client_side_validation && authorization_service_list_authorizations_request.nil? - fail ArgumentError, "Missing the required parameter 'authorization_service_list_authorizations_request' when calling Api::AuthorizationServiceApi.list_authorizations" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2.AuthorizationService/ListAuthorizations' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # ListAuthorizations returns all authorizations matching the request and necessary permissions. Required permissions: - \"user.grant.read\" - no permissions required for listing own authorizations + # @param authorization_service_list_authorizations_request [AuthorizationServiceListAuthorizationsRequest] + + # @return [AuthorizationServiceListAuthorizationsResponse] + # @raise [ApiError] if fails to make API call + def list_authorizations(authorization_service_list_authorizations_request) + if authorization_service_list_authorizations_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_list_authorizations_request' when calling AuthorizationServiceApi.list_authorizations" + end + + result = list_authorizations_with_http_info(authorization_service_list_authorizations_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_service_list_authorizations_request) - - # return_type - return_type = opts[:debug_return_type] || 'AuthorizationServiceListAuthorizationsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::AuthorizationServiceApi.list_authorizations", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::AuthorizationServiceApi#list_authorizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_authorizations_with_http_info(authorization_service_list_authorizations_request) + if authorization_service_list_authorizations_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_list_authorizations_request' when calling AuthorizationServiceApi.list_authorizations" + end + + path = '/zitadel.authorization.v2.AuthorizationService/ListAuthorizations' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = authorization_service_list_authorizations_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'AuthorizationServiceListAuthorizationsResponse', + nil + ) + end # Update Authorization - # UpdateAuthorization updates the authorization. Note that any role keys previously granted to the user and not present in the request will be revoked. Required permissions: - \"user.grant.write\" - # @param authorization_service_update_authorization_request [AuthorizationServiceUpdateAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [AuthorizationServiceUpdateAuthorizationResponse] - def update_authorization(authorization_service_update_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::AuthorizationServiceApi.update_authorization ...' # MODIFIED - end - # verify the required parameter 'authorization_service_update_authorization_request' is set - if @api_client.config.client_side_validation && authorization_service_update_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'authorization_service_update_authorization_request' when calling Api::AuthorizationServiceApi.update_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2.AuthorizationService/UpdateAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # UpdateAuthorization updates the authorization. Note that any role keys previously granted to the user and not present in the request will be revoked. Required permissions: - \"user.grant.write\" + # @param authorization_service_update_authorization_request [AuthorizationServiceUpdateAuthorizationRequest] + + # @return [AuthorizationServiceUpdateAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def update_authorization(authorization_service_update_authorization_request) + if authorization_service_update_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_update_authorization_request' when calling AuthorizationServiceApi.update_authorization" + end + + result = update_authorization_with_http_info(authorization_service_update_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(authorization_service_update_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'AuthorizationServiceUpdateAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::AuthorizationServiceApi.update_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::AuthorizationServiceApi#update_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_authorization_with_http_info(authorization_service_update_authorization_request) + if authorization_service_update_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'authorization_service_update_authorization_request' when calling AuthorizationServiceApi.update_authorization" + end + + path = '/zitadel.authorization.v2.AuthorizationService/UpdateAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = authorization_service_update_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'AuthorizationServiceUpdateAuthorizationResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/base_api.rb b/lib/zitadel/client/api/base_api.rb new file mode 100644 index 00000000..6feb9425 --- /dev/null +++ b/lib/zitadel/client/api/base_api.rb @@ -0,0 +1,242 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'uri' +require 'cgi' +require 'json' +require 'base64' +require 'stringio' + +require 'zitadel/client/object_serializer' + +# :nodoc: +module Zitadel::Client + module Api + # Base class for all API classes. Provides the invoke_api method that + # handles URL construction, header selection, body serialization, request + # dispatch, and response deserialization. + class BaseApi + # @return [Configuration] + attr_reader :config + + # Create an API instance. + # + # @param api_client [ApiClient, nil] the HTTP transport client + # @param config [Configuration] API-level configuration (base URL and default headers) + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + @config = config + @api_client = api_client || ::Zitadel::Client::DefaultApiClient.new + @header_selector = ::Zitadel::Client::HeaderSelector.new + @authenticator = authenticator + end + + protected + + def invoke_api_for_result( + method, path, query_params, header_params, body, + accepts, content_type, return_type, auth = nil + ) + url = if path.start_with?('http://', 'https://') + path + else + # Strip trailing slash from baseUrl when path starts with + # `/` so baseUrl='https://x/' + path='/y' produces + # 'https://x/y', not 'https://x//y' which most servers + # route to 404. Matches Java/C#/Go/Swift/Dart/Kotlin + # which collapse via URI parsers. + base = path.start_with?('/') ? @config.base_url.sub(%r{/+\z}, '') : @config.base_url + "#{base}#{path}" + end + + effective_auth = auth || @authenticator + effective_auth&.query_params&.each { |k, v| query_params[k] = v } + + query_string = build_query_string(query_params) + url = "#{url}?#{query_string}" unless query_string.empty? + + is_multipart = content_type == 'multipart/form-data' + selected = @header_selector.select_headers(accepts, content_type || '', is_multipart) + # @type var headers: Hash[String, String] + headers = @config.default_headers.dup + headers['Accept'] = selected['Accept'] if selected['Accept'] + headers['Content-Type'] = selected['Content-Type'] if selected['Content-Type'] + headers.merge!(header_params) + headers.merge!(effective_auth.auth_headers) if effective_auth + cookies = effective_auth&.cookie_params || {} + unless cookies.empty? + # RFC 6265 — don't URL-encode cookie name/value; most cookie + # parsers don't URL-decode, so `=` (base64 padding) would + # arrive as literal `%3D` and break JWT/session cookies. + # Validate and pass through raw instead. + cookie_str = cookies.map do |k, v| + name = k.to_s + value = v.to_s + unless name.match?(/\A[A-Za-z0-9!#$%&'*+\-.^_`|~]+\z/) + raise ArgumentError, "Cookie name '#{name}' contains characters forbidden by RFC 6265" + end + unless value.match?(/\A[!\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*\z/) + raise ArgumentError, "Cookie value for '#{name}' contains characters forbidden by RFC 6265" + end + "#{name}=#{value}" + end.join('; ') + existing = headers['Cookie'] + headers['Cookie'] = existing ? "#{existing}; #{cookie_str}" : cookie_str + end + ::Zitadel::Client::TraceContextUtil.inject_trace_context(headers) + serialized_body = serialize_body(body, content_type) + headers.delete('Content-Type') if serialized_body.nil? + response = @api_client.send_request(method, url, headers, serialized_body) + throw_api_error(response) if response.status_code < 200 || response.status_code >= 300 + + data = nil + if return_type && response.body && !response.body.empty? + # @type var resp_content_type: String? + ct_pair = response.headers.find { |k, _| k.downcase == 'content-type' } + resp_content_type = ct_pair ? ct_pair.last.split(';').first.strip : nil + data = if binary_return_type?(return_type) + # Binary return types (File) must never be JSON-deserialized, + # even when content negotiation makes the server label the + # raw bytes `application/json`. Detect by the target return + # type, not the response Content-Type. The transport + # base64-encodes the body for binary content types and leaves + # text content types (including JSON) as a decoded string, so + # recover the raw bytes accordingly before wrapping. + raw_bytes = if text_response_content_type?(resp_content_type) + response.body + else + Base64.strict_decode64(response.body) + end + StringIO.new(raw_bytes) + elsif !resp_content_type || @header_selector.json_mime?(resp_content_type) + ::Zitadel::Client::ObjectSerializer.deserialize(response.body, return_type) + else + response.body + end + end + + ::Zitadel::Client::ApiResult.new( + status_code: response.status_code, + data: data, + raw_body: response.body, + headers: response.headers + ) + end + + def invoke_api( + method, path, query_params, header_params, body, + accepts, content_type, return_type, auth = nil + ) + invoke_api_for_result( + method, path, query_params, header_params, body, + accepts, content_type, return_type, auth + ).data + end + + private + + # Attempts to parse the response body as JSON so that structured error + # data (e.g. from a +default+ response schema) is available via + # {ApiError#error_body}. + def throw_api_error(response) + code = response.status_code + msg = "API returned status code #{code}" + body = response.body + + parsed = nil + if body && !body.empty? + begin + parsed = JSON.parse(body) + rescue JSON::ParserError + nil + end + end + + err_opts = { message: msg, response_body: body, response_headers: response.headers, error_body: parsed } + + if code >= 400 && code < 500 + raise case code + when 400 then ::Zitadel::Client::Errors::BadRequestError.new(**err_opts) + when 401 then ::Zitadel::Client::Errors::UnauthorizedError.new(**err_opts) + when 403 then ::Zitadel::Client::Errors::ForbiddenError.new(**err_opts) + when 404 then ::Zitadel::Client::Errors::NotFoundError.new(**err_opts) + when 409 then ::Zitadel::Client::Errors::ConflictError.new(**err_opts) + when 422 then ::Zitadel::Client::Errors::UnprocessableEntityError.new(**err_opts) + else ::Zitadel::Client::Errors::ClientError.new(status_code: code, **err_opts) + end + end + if code >= 500 + raise case code + when 500 then ::Zitadel::Client::Errors::InternalServerError.new(**err_opts) + else ::Zitadel::Client::Errors::ServerError.new(status_code: code, **err_opts) + end + end + raise ::Zitadel::Client::ApiError.new(status_code: code, **err_opts) + end + + def build_query_string(query_params) + pairs = query_params.compact.flat_map do |k, v| + encoded_key = CGI.escape(k.to_s) + if v.is_a?(Array) + next [] if v.empty? + + v.map do |val| + "#{encoded_key}=#{CGI.escape(::Zitadel::Client::ObjectSerializer.to_query_value(val))}" + end + else + encoded_val = CGI.escape(::Zitadel::Client::ObjectSerializer.to_query_value(v)) + "#{encoded_key}=#{encoded_val}" + end + end + pairs.join('&') + end + + def serialize_body(body, content_type) + return nil if body.nil? + + if content_type == 'multipart/form-data' + body + elsif content_type&.start_with?('image/') || + content_type == 'application/octet-stream' + body.respond_to?(:read) ? body.read : body + elsif content_type == 'text/plain' + body.to_s + elsif content_type == 'application/x-www-form-urlencoded' + URI.encode_www_form(body) + else + ::Zitadel::Client::ObjectSerializer.serialize(body) + end + end + + # Whether the operation's target return type denotes raw binary data + # (an OpenAPI `string`/`binary` schema), which the generator maps to + # +File+. Such responses must be returned as raw bytes rather than being + # JSON-deserialized. + def binary_return_type?(return_type) + return_type == 'File' + end + + # Mirror of the transport's text/binary content-type classification. + # The transport keeps text content types (including JSON) as a decoded + # string and base64-encodes everything else, so binary return-type + # handling must apply the same rule to recover the raw bytes. + def text_response_content_type?(content_type) + return true if content_type.nil? + + media_type = content_type.split(';').first.to_s.strip.downcase + return true if media_type.empty? + return true if media_type.start_with?('text/') + + %w[application/json application/xml application/javascript].include?(media_type) || + media_type.end_with?('+json') || + media_type.end_with?('+xml') + end + end + end +end diff --git a/lib/zitadel/client/api/beta_action_service_api.rb b/lib/zitadel/client/api/beta_action_service_api.rb index ec0686fd..ee54c7f2 100644 --- a/lib/zitadel/client/api/beta_action_service_api.rb +++ b/lib/zitadel/client/api/beta_action_service_api.rb @@ -1,602 +1,552 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaActionServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaActionServiceApi provides methods for the BetaActionService API group. + class BetaActionServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Create Target - # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` - # @param beta_action_service_create_target_request [BetaActionServiceCreateTargetRequest] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceCreateTargetResponse] - def create_target(beta_action_service_create_target_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.create_target ...' # MODIFIED - end - # verify the required parameter 'beta_action_service_create_target_request' is set - if @api_client.config.client_side_validation && beta_action_service_create_target_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_action_service_create_target_request' when calling Api::BetaActionServiceApi.create_target" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/CreateTarget' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` + # @param beta_action_service_create_target_request [BetaActionServiceCreateTargetRequest] + + # @return [BetaActionServiceCreateTargetResponse] + # @raise [ApiError] if fails to make API call + def create_target(beta_action_service_create_target_request) + if beta_action_service_create_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_create_target_request' when calling BetaActionServiceApi.create_target" + end + + result = create_target_with_http_info(beta_action_service_create_target_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_action_service_create_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceCreateTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.create_target", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#create_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_target_with_http_info(beta_action_service_create_target_request) + if beta_action_service_create_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_create_target_request' when calling BetaActionServiceApi.create_target" + end + + path = '/zitadel.action.v2beta.ActionService/CreateTarget' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_action_service_create_target_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceCreateTargetResponse', + nil + ) + end # Delete Target - # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` - # @param beta_action_service_delete_target_request [BetaActionServiceDeleteTargetRequest] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceDeleteTargetResponse] - def delete_target(beta_action_service_delete_target_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.delete_target ...' # MODIFIED - end - # verify the required parameter 'beta_action_service_delete_target_request' is set - if @api_client.config.client_side_validation && beta_action_service_delete_target_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_action_service_delete_target_request' when calling Api::BetaActionServiceApi.delete_target" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/DeleteTarget' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` + # @param beta_action_service_delete_target_request [BetaActionServiceDeleteTargetRequest] + + # @return [BetaActionServiceDeleteTargetResponse] + # @raise [ApiError] if fails to make API call + def delete_target(beta_action_service_delete_target_request) + if beta_action_service_delete_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_delete_target_request' when calling BetaActionServiceApi.delete_target" + end + + result = delete_target_with_http_info(beta_action_service_delete_target_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_action_service_delete_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceDeleteTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.delete_target", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#delete_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_target_with_http_info(beta_action_service_delete_target_request) + if beta_action_service_delete_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_delete_target_request' when calling BetaActionServiceApi.delete_target" + end + + path = '/zitadel.action.v2beta.ActionService/DeleteTarget' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_action_service_delete_target_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceDeleteTargetResponse', + nil + ) + end # Get Target - # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the target identified by the requested ID. Required permission: - `action.target.read` - # @param beta_action_service_get_target_request [BetaActionServiceGetTargetRequest] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceGetTargetResponse] - def get_target(beta_action_service_get_target_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.get_target ...' # MODIFIED - end - # verify the required parameter 'beta_action_service_get_target_request' is set - if @api_client.config.client_side_validation && beta_action_service_get_target_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_action_service_get_target_request' when calling Api::BetaActionServiceApi.get_target" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/GetTarget' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the target identified by the requested ID. Required permission: - `action.target.read` + # @param beta_action_service_get_target_request [BetaActionServiceGetTargetRequest] + + # @return [BetaActionServiceGetTargetResponse] + # @raise [ApiError] if fails to make API call + def get_target(beta_action_service_get_target_request) + if beta_action_service_get_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_get_target_request' when calling BetaActionServiceApi.get_target" + end + + result = get_target_with_http_info(beta_action_service_get_target_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_action_service_get_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceGetTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.get_target", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#get_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_target_with_http_info(beta_action_service_get_target_request) + if beta_action_service_get_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_get_target_request' when calling BetaActionServiceApi.get_target" + end + + path = '/zitadel.action.v2beta.ActionService/GetTarget' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_action_service_get_target_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceGetTargetResponse', + nil + ) + end # List Execution Functions # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all available functions which can be used as condition for executions. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceListExecutionFunctionsResponse] - def list_execution_functions(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_execution_functions ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaActionServiceApi.list_execution_functions" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/ListExecutionFunctions' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [BetaActionServiceListExecutionFunctionsResponse] + # @raise [ApiError] if fails to make API call + def list_execution_functions(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaActionServiceApi.list_execution_functions" + end + + result = list_execution_functions_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceListExecutionFunctionsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.list_execution_functions", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#list_execution_functions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_execution_functions_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaActionServiceApi.list_execution_functions" + end + + path = '/zitadel.action.v2beta.ActionService/ListExecutionFunctions' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceListExecutionFunctionsResponse', + nil + ) + end # List Execution Methods # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all available methods which can be used as condition for executions. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceListExecutionMethodsResponse] - def list_execution_methods(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_execution_methods ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaActionServiceApi.list_execution_methods" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/ListExecutionMethods' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [BetaActionServiceListExecutionMethodsResponse] + # @raise [ApiError] if fails to make API call + def list_execution_methods(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaActionServiceApi.list_execution_methods" + end + + result = list_execution_methods_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceListExecutionMethodsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.list_execution_methods", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#list_execution_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_execution_methods_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaActionServiceApi.list_execution_methods" + end + + path = '/zitadel.action.v2beta.ActionService/ListExecutionMethods' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceListExecutionMethodsResponse', + nil + ) + end # List Execution Services # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all available services which can be used as condition for executions. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceListExecutionServicesResponse] - def list_execution_services(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_execution_services ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaActionServiceApi.list_execution_services" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/ListExecutionServices' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [BetaActionServiceListExecutionServicesResponse] + # @raise [ApiError] if fails to make API call + def list_execution_services(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaActionServiceApi.list_execution_services" + end + + result = list_execution_services_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceListExecutionServicesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.list_execution_services", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#list_execution_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_execution_services_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaActionServiceApi.list_execution_services" + end + + path = '/zitadel.action.v2beta.ActionService/ListExecutionServices' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceListExecutionServicesResponse', + nil + ) + end # List Executions - # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` - # @param beta_action_service_list_executions_request [BetaActionServiceListExecutionsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceListExecutionsResponse] - def list_executions(beta_action_service_list_executions_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_executions ...' # MODIFIED - end - # verify the required parameter 'beta_action_service_list_executions_request' is set - if @api_client.config.client_side_validation && beta_action_service_list_executions_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_action_service_list_executions_request' when calling Api::BetaActionServiceApi.list_executions" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/ListExecutions' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` + # @param beta_action_service_list_executions_request [BetaActionServiceListExecutionsRequest] + + # @return [BetaActionServiceListExecutionsResponse] + # @raise [ApiError] if fails to make API call + def list_executions(beta_action_service_list_executions_request) + if beta_action_service_list_executions_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_list_executions_request' when calling BetaActionServiceApi.list_executions" + end + + result = list_executions_with_http_info(beta_action_service_list_executions_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_action_service_list_executions_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceListExecutionsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.list_executions", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#list_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_executions_with_http_info(beta_action_service_list_executions_request) + if beta_action_service_list_executions_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_list_executions_request' when calling BetaActionServiceApi.list_executions" + end + + path = '/zitadel.action.v2beta.ActionService/ListExecutions' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_action_service_list_executions_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceListExecutionsResponse', + nil + ) + end # List targets - # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` - # @param beta_action_service_list_targets_request [BetaActionServiceListTargetsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceListTargetsResponse] - def list_targets(beta_action_service_list_targets_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.list_targets ...' # MODIFIED - end - # verify the required parameter 'beta_action_service_list_targets_request' is set - if @api_client.config.client_side_validation && beta_action_service_list_targets_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_action_service_list_targets_request' when calling Api::BetaActionServiceApi.list_targets" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/ListTargets' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` + # @param beta_action_service_list_targets_request [BetaActionServiceListTargetsRequest] + + # @return [BetaActionServiceListTargetsResponse] + # @raise [ApiError] if fails to make API call + def list_targets(beta_action_service_list_targets_request) + if beta_action_service_list_targets_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_list_targets_request' when calling BetaActionServiceApi.list_targets" + end + + result = list_targets_with_http_info(beta_action_service_list_targets_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_action_service_list_targets_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceListTargetsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.list_targets", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#list_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_targets_with_http_info(beta_action_service_list_targets_request) + if beta_action_service_list_targets_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_list_targets_request' when calling BetaActionServiceApi.list_targets" + end + + path = '/zitadel.action.v2beta.ActionService/ListTargets' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_action_service_list_targets_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceListTargetsResponse', + nil + ) + end # Set Execution - # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` - # @param beta_action_service_set_execution_request [BetaActionServiceSetExecutionRequest] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceSetExecutionResponse] - def set_execution(beta_action_service_set_execution_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.set_execution ...' # MODIFIED - end - # verify the required parameter 'beta_action_service_set_execution_request' is set - if @api_client.config.client_side_validation && beta_action_service_set_execution_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_action_service_set_execution_request' when calling Api::BetaActionServiceApi.set_execution" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/SetExecution' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` + # @param beta_action_service_set_execution_request [BetaActionServiceSetExecutionRequest] + + # @return [BetaActionServiceSetExecutionResponse] + # @raise [ApiError] if fails to make API call + def set_execution(beta_action_service_set_execution_request) + if beta_action_service_set_execution_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_set_execution_request' when calling BetaActionServiceApi.set_execution" + end + + result = set_execution_with_http_info(beta_action_service_set_execution_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_action_service_set_execution_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceSetExecutionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.set_execution", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#set_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_execution_with_http_info(beta_action_service_set_execution_request) + if beta_action_service_set_execution_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_set_execution_request' when calling BetaActionServiceApi.set_execution" + end + + path = '/zitadel.action.v2beta.ActionService/SetExecution' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_action_service_set_execution_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceSetExecutionResponse', + nil + ) + end # Update Target - # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` - # @param beta_action_service_update_target_request [BetaActionServiceUpdateTargetRequest] - # @param [Hash] opts the optional parameters - # @return [BetaActionServiceUpdateTargetResponse] - def update_target(beta_action_service_update_target_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaActionServiceApi.update_target ...' # MODIFIED - end - # verify the required parameter 'beta_action_service_update_target_request' is set - if @api_client.config.client_side_validation && beta_action_service_update_target_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_action_service_update_target_request' when calling Api::BetaActionServiceApi.update_target" # MODIFIED - end - # resource path - local_var_path = '/zitadel.action.v2beta.ActionService/UpdateTarget' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` + # @param beta_action_service_update_target_request [BetaActionServiceUpdateTargetRequest] + + # @return [BetaActionServiceUpdateTargetResponse] + # @raise [ApiError] if fails to make API call + def update_target(beta_action_service_update_target_request) + if beta_action_service_update_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_update_target_request' when calling BetaActionServiceApi.update_target" + end + + result = update_target_with_http_info(beta_action_service_update_target_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_action_service_update_target_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaActionServiceUpdateTargetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaActionServiceApi.update_target", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaActionServiceApi#update_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_target_with_http_info(beta_action_service_update_target_request) + if beta_action_service_update_target_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_action_service_update_target_request' when calling BetaActionServiceApi.update_target" + end + + path = '/zitadel.action.v2beta.ActionService/UpdateTarget' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_action_service_update_target_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaActionServiceUpdateTargetResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_app_service_api.rb b/lib/zitadel/client/api/beta_app_service_api.rb index 378afb85..55b46028 100644 --- a/lib/zitadel/client/api/beta_app_service_api.rb +++ b/lib/zitadel/client/api/beta_app_service_api.rb @@ -1,718 +1,658 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaAppServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaAppServiceApi provides methods for the BetaAppService API group. + class BetaAppServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Create Application # Deprecated: use [application service v2 CreateApplication](apis/resources/application_service_v2/application-service-create-application.api.mdx) instead. Create an application. The application can be OIDC, API or SAML type, based on the input. Required permissions: - project.app.write - # @param beta_app_service_create_application_request [BetaAppServiceCreateApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceCreateApplicationResponse] - def create_application(beta_app_service_create_application_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.create_application ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_create_application_request' is set - if @api_client.config.client_side_validation && beta_app_service_create_application_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_create_application_request' when calling Api::BetaAppServiceApi.create_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/CreateApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_create_application_request [BetaAppServiceCreateApplicationRequest] + + # @return [BetaAppServiceCreateApplicationResponse] + # @raise [ApiError] if fails to make API call + def create_application(beta_app_service_create_application_request) + if beta_app_service_create_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_create_application_request' when calling BetaAppServiceApi.create_application" + end + + result = create_application_with_http_info(beta_app_service_create_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_create_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceCreateApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.create_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#create_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_application_with_http_info(beta_app_service_create_application_request) + if beta_app_service_create_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_create_application_request' when calling BetaAppServiceApi.create_application" + end + + path = '/zitadel.app.v2beta.AppService/CreateApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_create_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceCreateApplicationResponse', + nil + ) + end # Create Application Key - # Deprecated: use [application service v2 CreateApplicationKey](apis/resources/application_service_v2/application-service-create-application-key.api.mdx) instead. Create a new application key, which is used to authorize an API application. Key details are returned in the response. They must be stored safely, as it will not be possible to retrieve them again. Required permissions: - `project.app.write` - # @param beta_app_service_create_application_key_request [BetaAppServiceCreateApplicationKeyRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceCreateApplicationKeyResponse] - def create_application_key(beta_app_service_create_application_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.create_application_key ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_create_application_key_request' is set - if @api_client.config.client_side_validation && beta_app_service_create_application_key_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_create_application_key_request' when calling Api::BetaAppServiceApi.create_application_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/CreateApplicationKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: use [application service v2 CreateApplicationKey](apis/resources/application_service_v2/application-service-create-application-key.api.mdx) instead. Create a new application key, which is used to authorize an API application. Key details are returned in the response. They must be stored safely, as it will not be possible to retrieve them again. Required permissions: - `project.app.write` + # @param beta_app_service_create_application_key_request [BetaAppServiceCreateApplicationKeyRequest] + + # @return [BetaAppServiceCreateApplicationKeyResponse] + # @raise [ApiError] if fails to make API call + def create_application_key(beta_app_service_create_application_key_request) + if beta_app_service_create_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_create_application_key_request' when calling BetaAppServiceApi.create_application_key" + end + + result = create_application_key_with_http_info(beta_app_service_create_application_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_create_application_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceCreateApplicationKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.create_application_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#create_application_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_application_key_with_http_info(beta_app_service_create_application_key_request) + if beta_app_service_create_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_create_application_key_request' when calling BetaAppServiceApi.create_application_key" + end + + path = '/zitadel.app.v2beta.AppService/CreateApplicationKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_create_application_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceCreateApplicationKeyResponse', + nil + ) + end # Deactivate Application # Deprecated: use [application service v2 DeactivateApplication](apis/resources/application_service_v2/application-service-deactivate-application.api.mdx) instead. Deactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write - # @param beta_app_service_deactivate_application_request [BetaAppServiceDeactivateApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceDeactivateApplicationResponse] - def deactivate_application(beta_app_service_deactivate_application_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.deactivate_application ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_deactivate_application_request' is set - if @api_client.config.client_side_validation && beta_app_service_deactivate_application_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_deactivate_application_request' when calling Api::BetaAppServiceApi.deactivate_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/DeactivateApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_deactivate_application_request [BetaAppServiceDeactivateApplicationRequest] + + # @return [BetaAppServiceDeactivateApplicationResponse] + # @raise [ApiError] if fails to make API call + def deactivate_application(beta_app_service_deactivate_application_request) + if beta_app_service_deactivate_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_deactivate_application_request' when calling BetaAppServiceApi.deactivate_application" + end + + result = deactivate_application_with_http_info(beta_app_service_deactivate_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_deactivate_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceDeactivateApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.deactivate_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#deactivate_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_application_with_http_info(beta_app_service_deactivate_application_request) + if beta_app_service_deactivate_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_deactivate_application_request' when calling BetaAppServiceApi.deactivate_application" + end + + path = '/zitadel.app.v2beta.AppService/DeactivateApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_deactivate_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceDeactivateApplicationResponse', + nil + ) + end # Delete Application # Deprecated: use [application service v2 DeleteApplication](apis/resources/application_service_v2/application-service-delete-application.api.mdx) instead. Deletes the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.delete - # @param beta_app_service_delete_application_request [BetaAppServiceDeleteApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceDeleteApplicationResponse] - def delete_application(beta_app_service_delete_application_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.delete_application ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_delete_application_request' is set - if @api_client.config.client_side_validation && beta_app_service_delete_application_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_delete_application_request' when calling Api::BetaAppServiceApi.delete_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/DeleteApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_delete_application_request [BetaAppServiceDeleteApplicationRequest] + + # @return [BetaAppServiceDeleteApplicationResponse] + # @raise [ApiError] if fails to make API call + def delete_application(beta_app_service_delete_application_request) + if beta_app_service_delete_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_delete_application_request' when calling BetaAppServiceApi.delete_application" + end + + result = delete_application_with_http_info(beta_app_service_delete_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_delete_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceDeleteApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.delete_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#delete_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_application_with_http_info(beta_app_service_delete_application_request) + if beta_app_service_delete_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_delete_application_request' when calling BetaAppServiceApi.delete_application" + end + + path = '/zitadel.app.v2beta.AppService/DeleteApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_delete_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceDeleteApplicationResponse', + nil + ) + end # Delete Application Key - # Deprecated: use [application service v2 DeleteApplicationKey](apis/resources/application_service_v2/application-service-delete-application-key.api.mdx) instead. Deletes an application key matching the provided ID. Organization ID is not mandatory, but helps with filtering/performance. The deletion time is returned in response message. Required permissions: - `project.app.write` - # @param beta_app_service_delete_application_key_request [BetaAppServiceDeleteApplicationKeyRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceDeleteApplicationKeyResponse] - def delete_application_key(beta_app_service_delete_application_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.delete_application_key ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_delete_application_key_request' is set - if @api_client.config.client_side_validation && beta_app_service_delete_application_key_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_delete_application_key_request' when calling Api::BetaAppServiceApi.delete_application_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/DeleteApplicationKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: use [application service v2 DeleteApplicationKey](apis/resources/application_service_v2/application-service-delete-application-key.api.mdx) instead. Deletes an application key matching the provided ID. Organization ID is not mandatory, but helps with filtering/performance. The deletion time is returned in response message. Required permissions: - `project.app.write` + # @param beta_app_service_delete_application_key_request [BetaAppServiceDeleteApplicationKeyRequest] + + # @return [BetaAppServiceDeleteApplicationKeyResponse] + # @raise [ApiError] if fails to make API call + def delete_application_key(beta_app_service_delete_application_key_request) + if beta_app_service_delete_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_delete_application_key_request' when calling BetaAppServiceApi.delete_application_key" + end + + result = delete_application_key_with_http_info(beta_app_service_delete_application_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_delete_application_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceDeleteApplicationKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.delete_application_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#delete_application_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_application_key_with_http_info(beta_app_service_delete_application_key_request) + if beta_app_service_delete_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_delete_application_key_request' when calling BetaAppServiceApi.delete_application_key" + end + + path = '/zitadel.app.v2beta.AppService/DeleteApplicationKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_delete_application_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceDeleteApplicationKeyResponse', + nil + ) + end # Get Application # Deprecated: use [application service v2 GetApplication](apis/resources/application_service_v2/application-service-get-application.api.mdx) instead. Retrieves the application matching the provided ID. Required permissions: - project.app.read - # @param beta_app_service_get_application_request [BetaAppServiceGetApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceGetApplicationResponse] - def get_application(beta_app_service_get_application_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.get_application ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_get_application_request' is set - if @api_client.config.client_side_validation && beta_app_service_get_application_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_get_application_request' when calling Api::BetaAppServiceApi.get_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/GetApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_get_application_request [BetaAppServiceGetApplicationRequest] + + # @return [BetaAppServiceGetApplicationResponse] + # @raise [ApiError] if fails to make API call + def get_application(beta_app_service_get_application_request) + if beta_app_service_get_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_get_application_request' when calling BetaAppServiceApi.get_application" + end + + result = get_application_with_http_info(beta_app_service_get_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_get_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceGetApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.get_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#get_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_application_with_http_info(beta_app_service_get_application_request) + if beta_app_service_get_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_get_application_request' when calling BetaAppServiceApi.get_application" + end + + path = '/zitadel.app.v2beta.AppService/GetApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_get_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceGetApplicationResponse', + nil + ) + end # Get Application Key # Deprecated: use [application service v2 GetApplicationKey](apis/resources/application_service_v2/application-service-get-application-key.api.mdx) instead. Retrieves the application key matching the provided ID. Specifying a project, organization and app ID is optional but help with filtering/performance. Required permissions: - project.app.read - # @param beta_app_service_get_application_key_request [BetaAppServiceGetApplicationKeyRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceGetApplicationKeyResponse] - def get_application_key(beta_app_service_get_application_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.get_application_key ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_get_application_key_request' is set - if @api_client.config.client_side_validation && beta_app_service_get_application_key_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_get_application_key_request' when calling Api::BetaAppServiceApi.get_application_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/GetApplicationKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_get_application_key_request [BetaAppServiceGetApplicationKeyRequest] + + # @return [BetaAppServiceGetApplicationKeyResponse] + # @raise [ApiError] if fails to make API call + def get_application_key(beta_app_service_get_application_key_request) + if beta_app_service_get_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_get_application_key_request' when calling BetaAppServiceApi.get_application_key" + end + + result = get_application_key_with_http_info(beta_app_service_get_application_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_get_application_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceGetApplicationKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.get_application_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#get_application_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_application_key_with_http_info(beta_app_service_get_application_key_request) + if beta_app_service_get_application_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_get_application_key_request' when calling BetaAppServiceApi.get_application_key" + end + + path = '/zitadel.app.v2beta.AppService/GetApplicationKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_get_application_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceGetApplicationKeyResponse', + nil + ) + end # List Application Keys # Deprecated: use [application service v2 ListApplicationKeys](apis/resources/application_service_v2/application-service-list-application-keys.api.mdx) instead. Returns a list of application keys matching the input parameters. The result can be sorted by id, aggregate, creation date, expiration date, resource owner or type. It can also be filtered by app, project or organization ID. Required permissions: - project.app.read - # @param beta_app_service_list_application_keys_request [BetaAppServiceListApplicationKeysRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceListApplicationKeysResponse] - def list_application_keys(beta_app_service_list_application_keys_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.list_application_keys ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_list_application_keys_request' is set - if @api_client.config.client_side_validation && beta_app_service_list_application_keys_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_list_application_keys_request' when calling Api::BetaAppServiceApi.list_application_keys" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/ListApplicationKeys' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_list_application_keys_request [BetaAppServiceListApplicationKeysRequest] + + # @return [BetaAppServiceListApplicationKeysResponse] + # @raise [ApiError] if fails to make API call + def list_application_keys(beta_app_service_list_application_keys_request) + if beta_app_service_list_application_keys_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_list_application_keys_request' when calling BetaAppServiceApi.list_application_keys" + end + + result = list_application_keys_with_http_info(beta_app_service_list_application_keys_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_list_application_keys_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceListApplicationKeysResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.list_application_keys", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#list_application_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_application_keys_with_http_info(beta_app_service_list_application_keys_request) + if beta_app_service_list_application_keys_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_list_application_keys_request' when calling BetaAppServiceApi.list_application_keys" + end + + path = '/zitadel.app.v2beta.AppService/ListApplicationKeys' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_list_application_keys_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceListApplicationKeysResponse', + nil + ) + end # List Applications # Deprecated: use [application service v2 ListApplications](apis/resources/application_service_v2/application-service-list-applications.api.mdx) instead. Returns a list of applications matching the input parameters that belong to the provided project. The result can be sorted by app id, name, creation date, change date or state. It can also be filtered by app state, app type and app name. Required permissions: - project.app.read - # @param beta_app_service_list_applications_request [BetaAppServiceListApplicationsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceListApplicationsResponse] - def list_applications(beta_app_service_list_applications_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.list_applications ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_list_applications_request' is set - if @api_client.config.client_side_validation && beta_app_service_list_applications_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_list_applications_request' when calling Api::BetaAppServiceApi.list_applications" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/ListApplications' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_list_applications_request [BetaAppServiceListApplicationsRequest] + + # @return [BetaAppServiceListApplicationsResponse] + # @raise [ApiError] if fails to make API call + def list_applications(beta_app_service_list_applications_request) + if beta_app_service_list_applications_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_list_applications_request' when calling BetaAppServiceApi.list_applications" + end + + result = list_applications_with_http_info(beta_app_service_list_applications_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_list_applications_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceListApplicationsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.list_applications", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#list_applications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_applications_with_http_info(beta_app_service_list_applications_request) + if beta_app_service_list_applications_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_list_applications_request' when calling BetaAppServiceApi.list_applications" + end + + path = '/zitadel.app.v2beta.AppService/ListApplications' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_list_applications_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceListApplicationsResponse', + nil + ) + end # Reactivate Application # Deprecated: use [application service v2 ReactivateApplication](apis/resources/application_service_v2/application-service-reactivate-application.api.mdx) instead. Reactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write - # @param beta_app_service_reactivate_application_request [BetaAppServiceReactivateApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceReactivateApplicationResponse] - def reactivate_application(beta_app_service_reactivate_application_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.reactivate_application ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_reactivate_application_request' is set - if @api_client.config.client_side_validation && beta_app_service_reactivate_application_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_reactivate_application_request' when calling Api::BetaAppServiceApi.reactivate_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/ReactivateApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_reactivate_application_request [BetaAppServiceReactivateApplicationRequest] + + # @return [BetaAppServiceReactivateApplicationResponse] + # @raise [ApiError] if fails to make API call + def reactivate_application(beta_app_service_reactivate_application_request) + if beta_app_service_reactivate_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_reactivate_application_request' when calling BetaAppServiceApi.reactivate_application" + end + + result = reactivate_application_with_http_info(beta_app_service_reactivate_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_reactivate_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceReactivateApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.reactivate_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#reactivate_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reactivate_application_with_http_info(beta_app_service_reactivate_application_request) + if beta_app_service_reactivate_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_reactivate_application_request' when calling BetaAppServiceApi.reactivate_application" + end + + path = '/zitadel.app.v2beta.AppService/ReactivateApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_reactivate_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceReactivateApplicationResponse', + nil + ) + end # Regenerate Client Secret # Deprecated: use [application service v2 GenerateClientSecret](apis/resources/application_service_v2/application-service-generate-client-secret.api.mdx) instead. Regenerates the client secret of an API or OIDC application that belongs to the input project. Required permissions: - project.app.write - # @param beta_app_service_regenerate_client_secret_request [BetaAppServiceRegenerateClientSecretRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceRegenerateClientSecretResponse] - def regenerate_client_secret(beta_app_service_regenerate_client_secret_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.regenerate_client_secret ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_regenerate_client_secret_request' is set - if @api_client.config.client_side_validation && beta_app_service_regenerate_client_secret_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_regenerate_client_secret_request' when calling Api::BetaAppServiceApi.regenerate_client_secret" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/RegenerateClientSecret' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_regenerate_client_secret_request [BetaAppServiceRegenerateClientSecretRequest] + + # @return [BetaAppServiceRegenerateClientSecretResponse] + # @raise [ApiError] if fails to make API call + def regenerate_client_secret(beta_app_service_regenerate_client_secret_request) + if beta_app_service_regenerate_client_secret_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_regenerate_client_secret_request' when calling BetaAppServiceApi.regenerate_client_secret" + end + + result = regenerate_client_secret_with_http_info(beta_app_service_regenerate_client_secret_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_regenerate_client_secret_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceRegenerateClientSecretResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.regenerate_client_secret", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#regenerate_client_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def regenerate_client_secret_with_http_info(beta_app_service_regenerate_client_secret_request) + if beta_app_service_regenerate_client_secret_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_regenerate_client_secret_request' when calling BetaAppServiceApi.regenerate_client_secret" + end + + path = '/zitadel.app.v2beta.AppService/RegenerateClientSecret' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_regenerate_client_secret_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceRegenerateClientSecretResponse', + nil + ) + end # Update Application # Deprecated: use [application service v2 UpdateApplication](apis/resources/application_service_v2/zitadel-app-v-2-application-service-update-application.api.mdx) instead. Changes the configuration of an OIDC, API or SAML type application, as well as the application name, based on the input provided. Required permissions: - project.app.write - # @param beta_app_service_update_application_request [BetaAppServiceUpdateApplicationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAppServiceUpdateApplicationResponse] - def update_application(beta_app_service_update_application_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAppServiceApi.update_application ...' # MODIFIED - end - # verify the required parameter 'beta_app_service_update_application_request' is set - if @api_client.config.client_side_validation && beta_app_service_update_application_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_app_service_update_application_request' when calling Api::BetaAppServiceApi.update_application" # MODIFIED - end - # resource path - local_var_path = '/zitadel.app.v2beta.AppService/UpdateApplication' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_app_service_update_application_request [BetaAppServiceUpdateApplicationRequest] + + # @return [BetaAppServiceUpdateApplicationResponse] + # @raise [ApiError] if fails to make API call + def update_application(beta_app_service_update_application_request) + if beta_app_service_update_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_update_application_request' when calling BetaAppServiceApi.update_application" + end + + result = update_application_with_http_info(beta_app_service_update_application_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_app_service_update_application_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAppServiceUpdateApplicationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAppServiceApi.update_application", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAppServiceApi#update_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_application_with_http_info(beta_app_service_update_application_request) + if beta_app_service_update_application_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_app_service_update_application_request' when calling BetaAppServiceApi.update_application" + end + + path = '/zitadel.app.v2beta.AppService/UpdateApplication' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_app_service_update_application_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAppServiceUpdateApplicationResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_authorization_service_api.rb b/lib/zitadel/client/api/beta_authorization_service_api.rb index 3ec39df4..849b2f63 100644 --- a/lib/zitadel/client/api/beta_authorization_service_api.rb +++ b/lib/zitadel/client/api/beta_authorization_service_api.rb @@ -1,370 +1,340 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaAuthorizationServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaAuthorizationServiceApi provides methods for the BetaAuthorizationService API group. + class BetaAuthorizationServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Activate Authorization - # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. ActivateAuthorization activates an existing but inactive authorization. In case the authorization is already active, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was activated by the request. Required permissions: - \"user.grant.write\" - # @param beta_authorization_service_activate_authorization_request [BetaAuthorizationServiceActivateAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAuthorizationServiceActivateAuthorizationResponse] - def activate_authorization(beta_authorization_service_activate_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAuthorizationServiceApi.activate_authorization ...' # MODIFIED - end - # verify the required parameter 'beta_authorization_service_activate_authorization_request' is set - if @api_client.config.client_side_validation && beta_authorization_service_activate_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_authorization_service_activate_authorization_request' when calling Api::BetaAuthorizationServiceApi.activate_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2beta.AuthorizationService/ActivateAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. ActivateAuthorization activates an existing but inactive authorization. In case the authorization is already active, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was activated by the request. Required permissions: - \"user.grant.write\" + # @param beta_authorization_service_activate_authorization_request [BetaAuthorizationServiceActivateAuthorizationRequest] + + # @return [BetaAuthorizationServiceActivateAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def activate_authorization(beta_authorization_service_activate_authorization_request) + if beta_authorization_service_activate_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_activate_authorization_request' when calling BetaAuthorizationServiceApi.activate_authorization" + end + + result = activate_authorization_with_http_info(beta_authorization_service_activate_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_authorization_service_activate_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAuthorizationServiceActivateAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAuthorizationServiceApi.activate_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAuthorizationServiceApi#activate_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_authorization_with_http_info(beta_authorization_service_activate_authorization_request) + if beta_authorization_service_activate_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_activate_authorization_request' when calling BetaAuthorizationServiceApi.activate_authorization" + end + + path = '/zitadel.authorization.v2beta.AuthorizationService/ActivateAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_authorization_service_activate_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAuthorizationServiceActivateAuthorizationResponse', + nil + ) + end # Create Authorization - # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. CreateAuthorization creates a new authorization for a user in an owned or granted project. Required permissions: - \"user.grant.write\" - # @param beta_authorization_service_create_authorization_request [BetaAuthorizationServiceCreateAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAuthorizationServiceCreateAuthorizationResponse] - def create_authorization(beta_authorization_service_create_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAuthorizationServiceApi.create_authorization ...' # MODIFIED - end - # verify the required parameter 'beta_authorization_service_create_authorization_request' is set - if @api_client.config.client_side_validation && beta_authorization_service_create_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_authorization_service_create_authorization_request' when calling Api::BetaAuthorizationServiceApi.create_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2beta.AuthorizationService/CreateAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. CreateAuthorization creates a new authorization for a user in an owned or granted project. Required permissions: - \"user.grant.write\" + # @param beta_authorization_service_create_authorization_request [BetaAuthorizationServiceCreateAuthorizationRequest] + + # @return [BetaAuthorizationServiceCreateAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def create_authorization(beta_authorization_service_create_authorization_request) + if beta_authorization_service_create_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_create_authorization_request' when calling BetaAuthorizationServiceApi.create_authorization" + end + + result = create_authorization_with_http_info(beta_authorization_service_create_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_authorization_service_create_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAuthorizationServiceCreateAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAuthorizationServiceApi.create_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAuthorizationServiceApi#create_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_authorization_with_http_info(beta_authorization_service_create_authorization_request) + if beta_authorization_service_create_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_create_authorization_request' when calling BetaAuthorizationServiceApi.create_authorization" + end + + path = '/zitadel.authorization.v2beta.AuthorizationService/CreateAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_authorization_service_create_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAuthorizationServiceCreateAuthorizationResponse', + nil + ) + end # Deactivate Authorization - # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. DeactivateAuthorization deactivates an existing and active authorization. In case the authorization is already inactive, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was deactivated by the request. Required permissions: - \"user.grant.write\" - # @param beta_authorization_service_deactivate_authorization_request [BetaAuthorizationServiceDeactivateAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAuthorizationServiceDeactivateAuthorizationResponse] - def deactivate_authorization(beta_authorization_service_deactivate_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAuthorizationServiceApi.deactivate_authorization ...' # MODIFIED - end - # verify the required parameter 'beta_authorization_service_deactivate_authorization_request' is set - if @api_client.config.client_side_validation && beta_authorization_service_deactivate_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_authorization_service_deactivate_authorization_request' when calling Api::BetaAuthorizationServiceApi.deactivate_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2beta.AuthorizationService/DeactivateAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. DeactivateAuthorization deactivates an existing and active authorization. In case the authorization is already inactive, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was deactivated by the request. Required permissions: - \"user.grant.write\" + # @param beta_authorization_service_deactivate_authorization_request [BetaAuthorizationServiceDeactivateAuthorizationRequest] + + # @return [BetaAuthorizationServiceDeactivateAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def deactivate_authorization(beta_authorization_service_deactivate_authorization_request) + if beta_authorization_service_deactivate_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_deactivate_authorization_request' when calling BetaAuthorizationServiceApi.deactivate_authorization" + end + + result = deactivate_authorization_with_http_info(beta_authorization_service_deactivate_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_authorization_service_deactivate_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAuthorizationServiceDeactivateAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAuthorizationServiceApi.deactivate_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAuthorizationServiceApi#deactivate_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_authorization_with_http_info(beta_authorization_service_deactivate_authorization_request) + if beta_authorization_service_deactivate_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_deactivate_authorization_request' when calling BetaAuthorizationServiceApi.deactivate_authorization" + end + + path = '/zitadel.authorization.v2beta.AuthorizationService/DeactivateAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_authorization_service_deactivate_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAuthorizationServiceDeactivateAuthorizationResponse', + nil + ) + end # Delete Authorization - # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. DeleteAuthorization deletes the authorization. In case the authorization is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the authorization was deleted by the request. Required permissions: - \"user.grant.delete\" - # @param beta_authorization_service_delete_authorization_request [BetaAuthorizationServiceDeleteAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAuthorizationServiceDeleteAuthorizationResponse] - def delete_authorization(beta_authorization_service_delete_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAuthorizationServiceApi.delete_authorization ...' # MODIFIED - end - # verify the required parameter 'beta_authorization_service_delete_authorization_request' is set - if @api_client.config.client_side_validation && beta_authorization_service_delete_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_authorization_service_delete_authorization_request' when calling Api::BetaAuthorizationServiceApi.delete_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2beta.AuthorizationService/DeleteAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. DeleteAuthorization deletes the authorization. In case the authorization is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the authorization was deleted by the request. Required permissions: - \"user.grant.delete\" + # @param beta_authorization_service_delete_authorization_request [BetaAuthorizationServiceDeleteAuthorizationRequest] + + # @return [BetaAuthorizationServiceDeleteAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def delete_authorization(beta_authorization_service_delete_authorization_request) + if beta_authorization_service_delete_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_delete_authorization_request' when calling BetaAuthorizationServiceApi.delete_authorization" + end + + result = delete_authorization_with_http_info(beta_authorization_service_delete_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_authorization_service_delete_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAuthorizationServiceDeleteAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAuthorizationServiceApi.delete_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAuthorizationServiceApi#delete_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_authorization_with_http_info(beta_authorization_service_delete_authorization_request) + if beta_authorization_service_delete_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_delete_authorization_request' when calling BetaAuthorizationServiceApi.delete_authorization" + end + + path = '/zitadel.authorization.v2beta.AuthorizationService/DeleteAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_authorization_service_delete_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAuthorizationServiceDeleteAuthorizationResponse', + nil + ) + end # List Authorizations - # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. ListAuthorizations returns all authorizations matching the request and necessary permissions. Required permissions: - \"user.grant.read\" - no permissions required for listing own authorizations - # @param beta_authorization_service_list_authorizations_request [BetaAuthorizationServiceListAuthorizationsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAuthorizationServiceListAuthorizationsResponse] - def list_authorizations(beta_authorization_service_list_authorizations_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAuthorizationServiceApi.list_authorizations ...' # MODIFIED - end - # verify the required parameter 'beta_authorization_service_list_authorizations_request' is set - if @api_client.config.client_side_validation && beta_authorization_service_list_authorizations_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_authorization_service_list_authorizations_request' when calling Api::BetaAuthorizationServiceApi.list_authorizations" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2beta.AuthorizationService/ListAuthorizations' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. ListAuthorizations returns all authorizations matching the request and necessary permissions. Required permissions: - \"user.grant.read\" - no permissions required for listing own authorizations + # @param beta_authorization_service_list_authorizations_request [BetaAuthorizationServiceListAuthorizationsRequest] + + # @return [BetaAuthorizationServiceListAuthorizationsResponse] + # @raise [ApiError] if fails to make API call + def list_authorizations(beta_authorization_service_list_authorizations_request) + if beta_authorization_service_list_authorizations_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_list_authorizations_request' when calling BetaAuthorizationServiceApi.list_authorizations" + end + + result = list_authorizations_with_http_info(beta_authorization_service_list_authorizations_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_authorization_service_list_authorizations_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAuthorizationServiceListAuthorizationsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAuthorizationServiceApi.list_authorizations", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAuthorizationServiceApi#list_authorizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_authorizations_with_http_info(beta_authorization_service_list_authorizations_request) + if beta_authorization_service_list_authorizations_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_list_authorizations_request' when calling BetaAuthorizationServiceApi.list_authorizations" + end + + path = '/zitadel.authorization.v2beta.AuthorizationService/ListAuthorizations' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_authorization_service_list_authorizations_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAuthorizationServiceListAuthorizationsResponse', + nil + ) + end # Update Authorization - # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. UpdateAuthorization updates the authorization. Note that any role keys previously granted to the user and not present in the request will be revoked. Required permissions: - \"user.grant.write\" - # @param beta_authorization_service_update_authorization_request [BetaAuthorizationServiceUpdateAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaAuthorizationServiceUpdateAuthorizationResponse] - def update_authorization(beta_authorization_service_update_authorization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaAuthorizationServiceApi.update_authorization ...' # MODIFIED - end - # verify the required parameter 'beta_authorization_service_update_authorization_request' is set - if @api_client.config.client_side_validation && beta_authorization_service_update_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_authorization_service_update_authorization_request' when calling Api::BetaAuthorizationServiceApi.update_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.authorization.v2beta.AuthorizationService/UpdateAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. UpdateAuthorization updates the authorization. Note that any role keys previously granted to the user and not present in the request will be revoked. Required permissions: - \"user.grant.write\" + # @param beta_authorization_service_update_authorization_request [BetaAuthorizationServiceUpdateAuthorizationRequest] + + # @return [BetaAuthorizationServiceUpdateAuthorizationResponse] + # @raise [ApiError] if fails to make API call + def update_authorization(beta_authorization_service_update_authorization_request) + if beta_authorization_service_update_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_update_authorization_request' when calling BetaAuthorizationServiceApi.update_authorization" + end + + result = update_authorization_with_http_info(beta_authorization_service_update_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_authorization_service_update_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaAuthorizationServiceUpdateAuthorizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaAuthorizationServiceApi.update_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaAuthorizationServiceApi#update_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_authorization_with_http_info(beta_authorization_service_update_authorization_request) + if beta_authorization_service_update_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_authorization_service_update_authorization_request' when calling BetaAuthorizationServiceApi.update_authorization" + end + + path = '/zitadel.authorization.v2beta.AuthorizationService/UpdateAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_authorization_service_update_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaAuthorizationServiceUpdateAuthorizationResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_feature_service_api.rb b/lib/zitadel/client/api/beta_feature_service_api.rb index ccd27f08..0d94998d 100644 --- a/lib/zitadel/client/api/beta_feature_service_api.rb +++ b/lib/zitadel/client/api/beta_feature_service_api.rb @@ -1,706 +1,646 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaFeatureServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaFeatureServiceApi provides methods for the BetaFeatureService API group. + class BetaFeatureServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # GetInstanceFeatures - # @param beta_feature_service_get_instance_features_request [BetaFeatureServiceGetInstanceFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceGetInstanceFeaturesResponse] - def get_instance_features(beta_feature_service_get_instance_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.get_instance_features ...' # MODIFIED - end - # verify the required parameter 'beta_feature_service_get_instance_features_request' is set - if @api_client.config.client_side_validation && beta_feature_service_get_instance_features_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_feature_service_get_instance_features_request' when calling Api::BetaFeatureServiceApi.get_instance_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/GetInstanceFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_feature_service_get_instance_features_request [BetaFeatureServiceGetInstanceFeaturesRequest] + + # @return [BetaFeatureServiceGetInstanceFeaturesResponse] + # @raise [ApiError] if fails to make API call + def get_instance_features(beta_feature_service_get_instance_features_request) + if beta_feature_service_get_instance_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_get_instance_features_request' when calling BetaFeatureServiceApi.get_instance_features" + end + + result = get_instance_features_with_http_info(beta_feature_service_get_instance_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_feature_service_get_instance_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceGetInstanceFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.get_instance_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#get_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_instance_features_with_http_info(beta_feature_service_get_instance_features_request) + if beta_feature_service_get_instance_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_get_instance_features_request' when calling BetaFeatureServiceApi.get_instance_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/GetInstanceFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_feature_service_get_instance_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceGetInstanceFeaturesResponse', + nil + ) + end # GetOrganizationFeatures - # @param beta_feature_service_get_organization_features_request [BetaFeatureServiceGetOrganizationFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceGetOrganizationFeaturesResponse] - def get_organization_features(beta_feature_service_get_organization_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.get_organization_features ...' # MODIFIED - end - # verify the required parameter 'beta_feature_service_get_organization_features_request' is set - if @api_client.config.client_side_validation && beta_feature_service_get_organization_features_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_feature_service_get_organization_features_request' when calling Api::BetaFeatureServiceApi.get_organization_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/GetOrganizationFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_feature_service_get_organization_features_request [BetaFeatureServiceGetOrganizationFeaturesRequest] + + # @return [BetaFeatureServiceGetOrganizationFeaturesResponse] + # @raise [ApiError] if fails to make API call + def get_organization_features(beta_feature_service_get_organization_features_request) + if beta_feature_service_get_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_get_organization_features_request' when calling BetaFeatureServiceApi.get_organization_features" + end + + result = get_organization_features_with_http_info(beta_feature_service_get_organization_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_feature_service_get_organization_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceGetOrganizationFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.get_organization_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#get_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_organization_features_with_http_info(beta_feature_service_get_organization_features_request) + if beta_feature_service_get_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_get_organization_features_request' when calling BetaFeatureServiceApi.get_organization_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/GetOrganizationFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_feature_service_get_organization_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceGetOrganizationFeaturesResponse', + nil + ) + end # GetSystemFeatures - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceGetSystemFeaturesResponse] - def get_system_features(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.get_system_features ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaFeatureServiceApi.get_system_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/GetSystemFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [BetaFeatureServiceGetSystemFeaturesResponse] + # @raise [ApiError] if fails to make API call + def get_system_features(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaFeatureServiceApi.get_system_features" + end + + result = get_system_features_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceGetSystemFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.get_system_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#get_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_system_features_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaFeatureServiceApi.get_system_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/GetSystemFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceGetSystemFeaturesResponse', + nil + ) + end # GetUserFeatures - # @param beta_feature_service_get_user_features_request [BetaFeatureServiceGetUserFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceGetUserFeaturesResponse] - def get_user_features(beta_feature_service_get_user_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.get_user_features ...' # MODIFIED - end - # verify the required parameter 'beta_feature_service_get_user_features_request' is set - if @api_client.config.client_side_validation && beta_feature_service_get_user_features_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_feature_service_get_user_features_request' when calling Api::BetaFeatureServiceApi.get_user_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/GetUserFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_feature_service_get_user_features_request [BetaFeatureServiceGetUserFeaturesRequest] + + # @return [BetaFeatureServiceGetUserFeaturesResponse] + # @raise [ApiError] if fails to make API call + def get_user_features(beta_feature_service_get_user_features_request) + if beta_feature_service_get_user_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_get_user_features_request' when calling BetaFeatureServiceApi.get_user_features" + end + + result = get_user_features_with_http_info(beta_feature_service_get_user_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_feature_service_get_user_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceGetUserFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.get_user_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#get_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_user_features_with_http_info(beta_feature_service_get_user_features_request) + if beta_feature_service_get_user_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_get_user_features_request' when calling BetaFeatureServiceApi.get_user_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/GetUserFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_feature_service_get_user_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceGetUserFeaturesResponse', + nil + ) + end # ResetInstanceFeatures - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceResetInstanceFeaturesResponse] - def reset_instance_features(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.reset_instance_features ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaFeatureServiceApi.reset_instance_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/ResetInstanceFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [BetaFeatureServiceResetInstanceFeaturesResponse] + # @raise [ApiError] if fails to make API call + def reset_instance_features(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaFeatureServiceApi.reset_instance_features" + end + + result = reset_instance_features_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceResetInstanceFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.reset_instance_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#reset_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reset_instance_features_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaFeatureServiceApi.reset_instance_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/ResetInstanceFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceResetInstanceFeaturesResponse', + nil + ) + end # ResetOrganizationFeatures - # @param beta_feature_service_reset_organization_features_request [BetaFeatureServiceResetOrganizationFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceResetOrganizationFeaturesResponse] - def reset_organization_features(beta_feature_service_reset_organization_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.reset_organization_features ...' # MODIFIED - end - # verify the required parameter 'beta_feature_service_reset_organization_features_request' is set - if @api_client.config.client_side_validation && beta_feature_service_reset_organization_features_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_feature_service_reset_organization_features_request' when calling Api::BetaFeatureServiceApi.reset_organization_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/ResetOrganizationFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_feature_service_reset_organization_features_request [BetaFeatureServiceResetOrganizationFeaturesRequest] + + # @return [BetaFeatureServiceResetOrganizationFeaturesResponse] + # @raise [ApiError] if fails to make API call + def reset_organization_features(beta_feature_service_reset_organization_features_request) + if beta_feature_service_reset_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_reset_organization_features_request' when calling BetaFeatureServiceApi.reset_organization_features" + end + + result = reset_organization_features_with_http_info(beta_feature_service_reset_organization_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_feature_service_reset_organization_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceResetOrganizationFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.reset_organization_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#reset_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reset_organization_features_with_http_info(beta_feature_service_reset_organization_features_request) + if beta_feature_service_reset_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_reset_organization_features_request' when calling BetaFeatureServiceApi.reset_organization_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/ResetOrganizationFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_feature_service_reset_organization_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceResetOrganizationFeaturesResponse', + nil + ) + end # ResetSystemFeatures - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceResetSystemFeaturesResponse] - def reset_system_features(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.reset_system_features ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaFeatureServiceApi.reset_system_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/ResetSystemFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [BetaFeatureServiceResetSystemFeaturesResponse] + # @raise [ApiError] if fails to make API call + def reset_system_features(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaFeatureServiceApi.reset_system_features" + end + + result = reset_system_features_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceResetSystemFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.reset_system_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#reset_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reset_system_features_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaFeatureServiceApi.reset_system_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/ResetSystemFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceResetSystemFeaturesResponse', + nil + ) + end # ResetUserFeatures - # @param beta_feature_service_reset_user_features_request [BetaFeatureServiceResetUserFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceResetUserFeaturesResponse] - def reset_user_features(beta_feature_service_reset_user_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.reset_user_features ...' # MODIFIED - end - # verify the required parameter 'beta_feature_service_reset_user_features_request' is set - if @api_client.config.client_side_validation && beta_feature_service_reset_user_features_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_feature_service_reset_user_features_request' when calling Api::BetaFeatureServiceApi.reset_user_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/ResetUserFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_feature_service_reset_user_features_request [BetaFeatureServiceResetUserFeaturesRequest] + + # @return [BetaFeatureServiceResetUserFeaturesResponse] + # @raise [ApiError] if fails to make API call + def reset_user_features(beta_feature_service_reset_user_features_request) + if beta_feature_service_reset_user_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_reset_user_features_request' when calling BetaFeatureServiceApi.reset_user_features" + end + + result = reset_user_features_with_http_info(beta_feature_service_reset_user_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_feature_service_reset_user_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceResetUserFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.reset_user_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#reset_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reset_user_features_with_http_info(beta_feature_service_reset_user_features_request) + if beta_feature_service_reset_user_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_reset_user_features_request' when calling BetaFeatureServiceApi.reset_user_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/ResetUserFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_feature_service_reset_user_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceResetUserFeaturesResponse', + nil + ) + end # SetInstanceFeatures - # @param beta_feature_service_set_instance_features_request [BetaFeatureServiceSetInstanceFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceSetInstanceFeaturesResponse] - def set_instance_features(beta_feature_service_set_instance_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.set_instance_features ...' # MODIFIED - end - # verify the required parameter 'beta_feature_service_set_instance_features_request' is set - if @api_client.config.client_side_validation && beta_feature_service_set_instance_features_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_feature_service_set_instance_features_request' when calling Api::BetaFeatureServiceApi.set_instance_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/SetInstanceFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_feature_service_set_instance_features_request [BetaFeatureServiceSetInstanceFeaturesRequest] + + # @return [BetaFeatureServiceSetInstanceFeaturesResponse] + # @raise [ApiError] if fails to make API call + def set_instance_features(beta_feature_service_set_instance_features_request) + if beta_feature_service_set_instance_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_set_instance_features_request' when calling BetaFeatureServiceApi.set_instance_features" + end + + result = set_instance_features_with_http_info(beta_feature_service_set_instance_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_feature_service_set_instance_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceSetInstanceFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.set_instance_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#set_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_instance_features_with_http_info(beta_feature_service_set_instance_features_request) + if beta_feature_service_set_instance_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_set_instance_features_request' when calling BetaFeatureServiceApi.set_instance_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/SetInstanceFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_feature_service_set_instance_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceSetInstanceFeaturesResponse', + nil + ) + end # SetOrganizationFeatures - # @param beta_feature_service_set_organization_features_request [BetaFeatureServiceSetOrganizationFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceSetOrganizationFeaturesResponse] - def set_organization_features(beta_feature_service_set_organization_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.set_organization_features ...' # MODIFIED - end - # verify the required parameter 'beta_feature_service_set_organization_features_request' is set - if @api_client.config.client_side_validation && beta_feature_service_set_organization_features_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_feature_service_set_organization_features_request' when calling Api::BetaFeatureServiceApi.set_organization_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/SetOrganizationFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_feature_service_set_organization_features_request [BetaFeatureServiceSetOrganizationFeaturesRequest] + + # @return [BetaFeatureServiceSetOrganizationFeaturesResponse] + # @raise [ApiError] if fails to make API call + def set_organization_features(beta_feature_service_set_organization_features_request) + if beta_feature_service_set_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_set_organization_features_request' when calling BetaFeatureServiceApi.set_organization_features" + end + + result = set_organization_features_with_http_info(beta_feature_service_set_organization_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_feature_service_set_organization_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceSetOrganizationFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.set_organization_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#set_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_organization_features_with_http_info(beta_feature_service_set_organization_features_request) + if beta_feature_service_set_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_set_organization_features_request' when calling BetaFeatureServiceApi.set_organization_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/SetOrganizationFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_feature_service_set_organization_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceSetOrganizationFeaturesResponse', + nil + ) + end # SetSystemFeatures - # @param beta_feature_service_set_system_features_request [BetaFeatureServiceSetSystemFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceSetSystemFeaturesResponse] - def set_system_features(beta_feature_service_set_system_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.set_system_features ...' # MODIFIED - end - # verify the required parameter 'beta_feature_service_set_system_features_request' is set - if @api_client.config.client_side_validation && beta_feature_service_set_system_features_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_feature_service_set_system_features_request' when calling Api::BetaFeatureServiceApi.set_system_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/SetSystemFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_feature_service_set_system_features_request [BetaFeatureServiceSetSystemFeaturesRequest] + + # @return [BetaFeatureServiceSetSystemFeaturesResponse] + # @raise [ApiError] if fails to make API call + def set_system_features(beta_feature_service_set_system_features_request) + if beta_feature_service_set_system_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_set_system_features_request' when calling BetaFeatureServiceApi.set_system_features" + end + + result = set_system_features_with_http_info(beta_feature_service_set_system_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_feature_service_set_system_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceSetSystemFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.set_system_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#set_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_system_features_with_http_info(beta_feature_service_set_system_features_request) + if beta_feature_service_set_system_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_set_system_features_request' when calling BetaFeatureServiceApi.set_system_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/SetSystemFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_feature_service_set_system_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceSetSystemFeaturesResponse', + nil + ) + end # SetUserFeatures - # @param beta_feature_service_set_user_feature_request [BetaFeatureServiceSetUserFeatureRequest] - # @param [Hash] opts the optional parameters - # @return [BetaFeatureServiceSetUserFeaturesResponse] - def set_user_features(beta_feature_service_set_user_feature_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaFeatureServiceApi.set_user_features ...' # MODIFIED - end - # verify the required parameter 'beta_feature_service_set_user_feature_request' is set - if @api_client.config.client_side_validation && beta_feature_service_set_user_feature_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_feature_service_set_user_feature_request' when calling Api::BetaFeatureServiceApi.set_user_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2beta.FeatureService/SetUserFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_feature_service_set_user_feature_request [BetaFeatureServiceSetUserFeatureRequest] + + # @return [BetaFeatureServiceSetUserFeaturesResponse] + # @raise [ApiError] if fails to make API call + def set_user_features(beta_feature_service_set_user_feature_request) + if beta_feature_service_set_user_feature_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_set_user_feature_request' when calling BetaFeatureServiceApi.set_user_features" + end + + result = set_user_features_with_http_info(beta_feature_service_set_user_feature_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_feature_service_set_user_feature_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaFeatureServiceSetUserFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaFeatureServiceApi.set_user_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaFeatureServiceApi#set_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_user_features_with_http_info(beta_feature_service_set_user_feature_request) + if beta_feature_service_set_user_feature_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_feature_service_set_user_feature_request' when calling BetaFeatureServiceApi.set_user_features" + end + + path = '/zitadel.feature.v2beta.FeatureService/SetUserFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_feature_service_set_user_feature_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaFeatureServiceSetUserFeaturesResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_instance_service_api.rb b/lib/zitadel/client/api/beta_instance_service_api.rb index 0f289227..8213422a 100644 --- a/lib/zitadel/client/api/beta_instance_service_api.rb +++ b/lib/zitadel/client/api/beta_instance_service_api.rb @@ -1,602 +1,552 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaInstanceServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaInstanceServiceApi provides methods for the BetaInstanceService API group. + class BetaInstanceServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Add Custom Domain - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Adds a custom domain to the instance in context. The instance_id in the input message will be used in the future Required permissions: - `system.domain.write` - # @param beta_instance_service_add_custom_domain_request [BetaInstanceServiceAddCustomDomainRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceAddCustomDomainResponse] - def add_custom_domain(beta_instance_service_add_custom_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.add_custom_domain ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_add_custom_domain_request' is set - if @api_client.config.client_side_validation && beta_instance_service_add_custom_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_add_custom_domain_request' when calling Api::BetaInstanceServiceApi.add_custom_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/AddCustomDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Adds a custom domain to the instance in context. The instance_id in the input message will be used in the future Required permissions: - `system.domain.write` + # @param beta_instance_service_add_custom_domain_request [BetaInstanceServiceAddCustomDomainRequest] + + # @return [BetaInstanceServiceAddCustomDomainResponse] + # @raise [ApiError] if fails to make API call + def add_custom_domain(beta_instance_service_add_custom_domain_request) + if beta_instance_service_add_custom_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_add_custom_domain_request' when calling BetaInstanceServiceApi.add_custom_domain" + end + + result = add_custom_domain_with_http_info(beta_instance_service_add_custom_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_add_custom_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceAddCustomDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.add_custom_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#add_custom_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_custom_domain_with_http_info(beta_instance_service_add_custom_domain_request) + if beta_instance_service_add_custom_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_add_custom_domain_request' when calling BetaInstanceServiceApi.add_custom_domain" + end + + path = '/zitadel.instance.v2beta.InstanceService/AddCustomDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_add_custom_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceAddCustomDomainResponse', + nil + ) + end # Add Trusted Domain - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Adds a trusted domain to the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` - # @param beta_instance_service_add_trusted_domain_request [BetaInstanceServiceAddTrustedDomainRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceAddTrustedDomainResponse] - def add_trusted_domain(beta_instance_service_add_trusted_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.add_trusted_domain ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_add_trusted_domain_request' is set - if @api_client.config.client_side_validation && beta_instance_service_add_trusted_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_add_trusted_domain_request' when calling Api::BetaInstanceServiceApi.add_trusted_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/AddTrustedDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Adds a trusted domain to the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` + # @param beta_instance_service_add_trusted_domain_request [BetaInstanceServiceAddTrustedDomainRequest] + + # @return [BetaInstanceServiceAddTrustedDomainResponse] + # @raise [ApiError] if fails to make API call + def add_trusted_domain(beta_instance_service_add_trusted_domain_request) + if beta_instance_service_add_trusted_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_add_trusted_domain_request' when calling BetaInstanceServiceApi.add_trusted_domain" + end + + result = add_trusted_domain_with_http_info(beta_instance_service_add_trusted_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_add_trusted_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceAddTrustedDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.add_trusted_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#add_trusted_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_trusted_domain_with_http_info(beta_instance_service_add_trusted_domain_request) + if beta_instance_service_add_trusted_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_add_trusted_domain_request' when calling BetaInstanceServiceApi.add_trusted_domain" + end + + path = '/zitadel.instance.v2beta.InstanceService/AddTrustedDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_add_trusted_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceAddTrustedDomainResponse', + nil + ) + end # Delete Instance - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Deletes an instance with the given ID. Required permissions: - `system.instance.delete` - # @param beta_instance_service_delete_instance_request [BetaInstanceServiceDeleteInstanceRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceDeleteInstanceResponse] - def delete_instance(beta_instance_service_delete_instance_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.delete_instance ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_delete_instance_request' is set - if @api_client.config.client_side_validation && beta_instance_service_delete_instance_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_delete_instance_request' when calling Api::BetaInstanceServiceApi.delete_instance" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/DeleteInstance' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Deletes an instance with the given ID. Required permissions: - `system.instance.delete` + # @param beta_instance_service_delete_instance_request [BetaInstanceServiceDeleteInstanceRequest] + + # @return [BetaInstanceServiceDeleteInstanceResponse] + # @raise [ApiError] if fails to make API call + def delete_instance(beta_instance_service_delete_instance_request) + if beta_instance_service_delete_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_delete_instance_request' when calling BetaInstanceServiceApi.delete_instance" + end + + result = delete_instance_with_http_info(beta_instance_service_delete_instance_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_delete_instance_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceDeleteInstanceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.delete_instance", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#delete_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_instance_with_http_info(beta_instance_service_delete_instance_request) + if beta_instance_service_delete_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_delete_instance_request' when calling BetaInstanceServiceApi.delete_instance" + end + + path = '/zitadel.instance.v2beta.InstanceService/DeleteInstance' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_delete_instance_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceDeleteInstanceResponse', + nil + ) + end # Get Instance - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the instance in the current context. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` - # @param beta_instance_service_get_instance_request [BetaInstanceServiceGetInstanceRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceGetInstanceResponse] - def get_instance(beta_instance_service_get_instance_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.get_instance ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_get_instance_request' is set - if @api_client.config.client_side_validation && beta_instance_service_get_instance_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_get_instance_request' when calling Api::BetaInstanceServiceApi.get_instance" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/GetInstance' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the instance in the current context. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` + # @param beta_instance_service_get_instance_request [BetaInstanceServiceGetInstanceRequest] + + # @return [BetaInstanceServiceGetInstanceResponse] + # @raise [ApiError] if fails to make API call + def get_instance(beta_instance_service_get_instance_request) + if beta_instance_service_get_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_get_instance_request' when calling BetaInstanceServiceApi.get_instance" + end + + result = get_instance_with_http_info(beta_instance_service_get_instance_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_get_instance_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceGetInstanceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.get_instance", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#get_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_instance_with_http_info(beta_instance_service_get_instance_request) + if beta_instance_service_get_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_get_instance_request' when calling BetaInstanceServiceApi.get_instance" + end + + path = '/zitadel.instance.v2beta.InstanceService/GetInstance' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_get_instance_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceGetInstanceResponse', + nil + ) + end # List Custom Domains - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists custom domains of the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` - # @param beta_instance_service_list_custom_domains_request [BetaInstanceServiceListCustomDomainsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceListCustomDomainsResponse] - def list_custom_domains(beta_instance_service_list_custom_domains_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.list_custom_domains ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_list_custom_domains_request' is set - if @api_client.config.client_side_validation && beta_instance_service_list_custom_domains_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_list_custom_domains_request' when calling Api::BetaInstanceServiceApi.list_custom_domains" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/ListCustomDomains' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists custom domains of the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` + # @param beta_instance_service_list_custom_domains_request [BetaInstanceServiceListCustomDomainsRequest] + + # @return [BetaInstanceServiceListCustomDomainsResponse] + # @raise [ApiError] if fails to make API call + def list_custom_domains(beta_instance_service_list_custom_domains_request) + if beta_instance_service_list_custom_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_list_custom_domains_request' when calling BetaInstanceServiceApi.list_custom_domains" + end + + result = list_custom_domains_with_http_info(beta_instance_service_list_custom_domains_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_list_custom_domains_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceListCustomDomainsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.list_custom_domains", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#list_custom_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_custom_domains_with_http_info(beta_instance_service_list_custom_domains_request) + if beta_instance_service_list_custom_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_list_custom_domains_request' when calling BetaInstanceServiceApi.list_custom_domains" + end + + path = '/zitadel.instance.v2beta.InstanceService/ListCustomDomains' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_list_custom_domains_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceListCustomDomainsResponse', + nil + ) + end # List Instances - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists instances matching the given query. The query can be used to filter either by instance ID or domain. The request is paginated and returns 100 results by default. Required permissions: - `system.instance.read` - # @param beta_instance_service_list_instances_request [BetaInstanceServiceListInstancesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceListInstancesResponse] - def list_instances(beta_instance_service_list_instances_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.list_instances ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_list_instances_request' is set - if @api_client.config.client_side_validation && beta_instance_service_list_instances_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_list_instances_request' when calling Api::BetaInstanceServiceApi.list_instances" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/ListInstances' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists instances matching the given query. The query can be used to filter either by instance ID or domain. The request is paginated and returns 100 results by default. Required permissions: - `system.instance.read` + # @param beta_instance_service_list_instances_request [BetaInstanceServiceListInstancesRequest] + + # @return [BetaInstanceServiceListInstancesResponse] + # @raise [ApiError] if fails to make API call + def list_instances(beta_instance_service_list_instances_request) + if beta_instance_service_list_instances_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_list_instances_request' when calling BetaInstanceServiceApi.list_instances" + end + + result = list_instances_with_http_info(beta_instance_service_list_instances_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_list_instances_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceListInstancesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.list_instances", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#list_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_instances_with_http_info(beta_instance_service_list_instances_request) + if beta_instance_service_list_instances_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_list_instances_request' when calling BetaInstanceServiceApi.list_instances" + end + + path = '/zitadel.instance.v2beta.InstanceService/ListInstances' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_list_instances_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceListInstancesResponse', + nil + ) + end # List Trusted Domains - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists trusted domains of the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` - # @param beta_instance_service_list_trusted_domains_request [BetaInstanceServiceListTrustedDomainsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceListTrustedDomainsResponse] - def list_trusted_domains(beta_instance_service_list_trusted_domains_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.list_trusted_domains ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_list_trusted_domains_request' is set - if @api_client.config.client_side_validation && beta_instance_service_list_trusted_domains_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_list_trusted_domains_request' when calling Api::BetaInstanceServiceApi.list_trusted_domains" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/ListTrustedDomains' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists trusted domains of the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` + # @param beta_instance_service_list_trusted_domains_request [BetaInstanceServiceListTrustedDomainsRequest] + + # @return [BetaInstanceServiceListTrustedDomainsResponse] + # @raise [ApiError] if fails to make API call + def list_trusted_domains(beta_instance_service_list_trusted_domains_request) + if beta_instance_service_list_trusted_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_list_trusted_domains_request' when calling BetaInstanceServiceApi.list_trusted_domains" + end + + result = list_trusted_domains_with_http_info(beta_instance_service_list_trusted_domains_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_list_trusted_domains_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceListTrustedDomainsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.list_trusted_domains", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#list_trusted_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_trusted_domains_with_http_info(beta_instance_service_list_trusted_domains_request) + if beta_instance_service_list_trusted_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_list_trusted_domains_request' when calling BetaInstanceServiceApi.list_trusted_domains" + end + + path = '/zitadel.instance.v2beta.InstanceService/ListTrustedDomains' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_list_trusted_domains_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceListTrustedDomainsResponse', + nil + ) + end # Remove Custom Domain - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Removes a custom domain from the instance. The instance_id in the input message will be used in the future. Required permissions: - `system.domain.write` - # @param beta_instance_service_remove_custom_domain_request [BetaInstanceServiceRemoveCustomDomainRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceRemoveCustomDomainResponse] - def remove_custom_domain(beta_instance_service_remove_custom_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.remove_custom_domain ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_remove_custom_domain_request' is set - if @api_client.config.client_side_validation && beta_instance_service_remove_custom_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_remove_custom_domain_request' when calling Api::BetaInstanceServiceApi.remove_custom_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/RemoveCustomDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Removes a custom domain from the instance. The instance_id in the input message will be used in the future. Required permissions: - `system.domain.write` + # @param beta_instance_service_remove_custom_domain_request [BetaInstanceServiceRemoveCustomDomainRequest] + + # @return [BetaInstanceServiceRemoveCustomDomainResponse] + # @raise [ApiError] if fails to make API call + def remove_custom_domain(beta_instance_service_remove_custom_domain_request) + if beta_instance_service_remove_custom_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_remove_custom_domain_request' when calling BetaInstanceServiceApi.remove_custom_domain" + end + + result = remove_custom_domain_with_http_info(beta_instance_service_remove_custom_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_remove_custom_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceRemoveCustomDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.remove_custom_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#remove_custom_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_custom_domain_with_http_info(beta_instance_service_remove_custom_domain_request) + if beta_instance_service_remove_custom_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_remove_custom_domain_request' when calling BetaInstanceServiceApi.remove_custom_domain" + end + + path = '/zitadel.instance.v2beta.InstanceService/RemoveCustomDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_remove_custom_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceRemoveCustomDomainResponse', + nil + ) + end # Remove Trusted Domain - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Removes a trusted domain from the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` - # @param beta_instance_service_remove_trusted_domain_request [BetaInstanceServiceRemoveTrustedDomainRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceRemoveTrustedDomainResponse] - def remove_trusted_domain(beta_instance_service_remove_trusted_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.remove_trusted_domain ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_remove_trusted_domain_request' is set - if @api_client.config.client_side_validation && beta_instance_service_remove_trusted_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_remove_trusted_domain_request' when calling Api::BetaInstanceServiceApi.remove_trusted_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/RemoveTrustedDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Removes a trusted domain from the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` + # @param beta_instance_service_remove_trusted_domain_request [BetaInstanceServiceRemoveTrustedDomainRequest] + + # @return [BetaInstanceServiceRemoveTrustedDomainResponse] + # @raise [ApiError] if fails to make API call + def remove_trusted_domain(beta_instance_service_remove_trusted_domain_request) + if beta_instance_service_remove_trusted_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_remove_trusted_domain_request' when calling BetaInstanceServiceApi.remove_trusted_domain" + end + + result = remove_trusted_domain_with_http_info(beta_instance_service_remove_trusted_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_remove_trusted_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceRemoveTrustedDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.remove_trusted_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#remove_trusted_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_trusted_domain_with_http_info(beta_instance_service_remove_trusted_domain_request) + if beta_instance_service_remove_trusted_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_remove_trusted_domain_request' when calling BetaInstanceServiceApi.remove_trusted_domain" + end + + path = '/zitadel.instance.v2beta.InstanceService/RemoveTrustedDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_remove_trusted_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceRemoveTrustedDomainResponse', + nil + ) + end # Update Instance - # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Updates instance in context with the given name. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` - # @param beta_instance_service_update_instance_request [BetaInstanceServiceUpdateInstanceRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInstanceServiceUpdateInstanceResponse] - def update_instance(beta_instance_service_update_instance_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInstanceServiceApi.update_instance ...' # MODIFIED - end - # verify the required parameter 'beta_instance_service_update_instance_request' is set - if @api_client.config.client_side_validation && beta_instance_service_update_instance_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_instance_service_update_instance_request' when calling Api::BetaInstanceServiceApi.update_instance" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2beta.InstanceService/UpdateInstance' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Updates instance in context with the given name. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` + # @param beta_instance_service_update_instance_request [BetaInstanceServiceUpdateInstanceRequest] + + # @return [BetaInstanceServiceUpdateInstanceResponse] + # @raise [ApiError] if fails to make API call + def update_instance(beta_instance_service_update_instance_request) + if beta_instance_service_update_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_update_instance_request' when calling BetaInstanceServiceApi.update_instance" + end + + result = update_instance_with_http_info(beta_instance_service_update_instance_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_instance_service_update_instance_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInstanceServiceUpdateInstanceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInstanceServiceApi.update_instance", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInstanceServiceApi#update_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_instance_with_http_info(beta_instance_service_update_instance_request) + if beta_instance_service_update_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_instance_service_update_instance_request' when calling BetaInstanceServiceApi.update_instance" + end + + path = '/zitadel.instance.v2beta.InstanceService/UpdateInstance' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_instance_service_update_instance_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInstanceServiceUpdateInstanceResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_internal_permission_service_api.rb b/lib/zitadel/client/api/beta_internal_permission_service_api.rb index 406979a2..bc1aa95c 100644 --- a/lib/zitadel/client/api/beta_internal_permission_service_api.rb +++ b/lib/zitadel/client/api/beta_internal_permission_service_api.rb @@ -1,254 +1,234 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaInternalPermissionServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaInternalPermissionServiceApi provides methods for the BetaInternalPermissionService API group. + class BetaInternalPermissionServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # CreateAdministrator grants a administrator role to a user for a specific resource. - # Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Note that the roles are specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators - # @param beta_internal_permission_service_create_administrator_request [BetaInternalPermissionServiceCreateAdministratorRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInternalPermissionServiceCreateAdministratorResponse] - def create_administrator(beta_internal_permission_service_create_administrator_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInternalPermissionServiceApi.create_administrator ...' # MODIFIED - end - # verify the required parameter 'beta_internal_permission_service_create_administrator_request' is set - if @api_client.config.client_side_validation && beta_internal_permission_service_create_administrator_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_internal_permission_service_create_administrator_request' when calling Api::BetaInternalPermissionServiceApi.create_administrator" # MODIFIED - end - # resource path - local_var_path = '/zitadel.internal_permission.v2beta.InternalPermissionService/CreateAdministrator' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Note that the roles are specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + # @param beta_internal_permission_service_create_administrator_request [BetaInternalPermissionServiceCreateAdministratorRequest] + + # @return [BetaInternalPermissionServiceCreateAdministratorResponse] + # @raise [ApiError] if fails to make API call + def create_administrator(beta_internal_permission_service_create_administrator_request) + if beta_internal_permission_service_create_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_internal_permission_service_create_administrator_request' when calling BetaInternalPermissionServiceApi.create_administrator" + end + + result = create_administrator_with_http_info(beta_internal_permission_service_create_administrator_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_internal_permission_service_create_administrator_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInternalPermissionServiceCreateAdministratorResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInternalPermissionServiceApi.create_administrator", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInternalPermissionServiceApi#create_administrator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_administrator_with_http_info(beta_internal_permission_service_create_administrator_request) + if beta_internal_permission_service_create_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_internal_permission_service_create_administrator_request' when calling BetaInternalPermissionServiceApi.create_administrator" + end + + path = '/zitadel.internal_permission.v2beta.InternalPermissionService/CreateAdministrator' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_internal_permission_service_create_administrator_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInternalPermissionServiceCreateAdministratorResponse', + nil + ) + end # DeleteAdministrator revokes a administrator role from a user. - # Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. In case the administrator role is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the administrator role was deleted during the request. Required permissions depend on the resource type: - \"iam.member.delete\" for instance administrators - \"org.member.delete\" for organization administrators - \"project.member.delete\" for project administrators - \"project.grant.member.delete\" for project grant administrators - # @param beta_internal_permission_service_delete_administrator_request [BetaInternalPermissionServiceDeleteAdministratorRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInternalPermissionServiceDeleteAdministratorResponse] - def delete_administrator(beta_internal_permission_service_delete_administrator_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInternalPermissionServiceApi.delete_administrator ...' # MODIFIED - end - # verify the required parameter 'beta_internal_permission_service_delete_administrator_request' is set - if @api_client.config.client_side_validation && beta_internal_permission_service_delete_administrator_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_internal_permission_service_delete_administrator_request' when calling Api::BetaInternalPermissionServiceApi.delete_administrator" # MODIFIED - end - # resource path - local_var_path = '/zitadel.internal_permission.v2beta.InternalPermissionService/DeleteAdministrator' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. In case the administrator role is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the administrator role was deleted during the request. Required permissions depend on the resource type: - \"iam.member.delete\" for instance administrators - \"org.member.delete\" for organization administrators - \"project.member.delete\" for project administrators - \"project.grant.member.delete\" for project grant administrators + # @param beta_internal_permission_service_delete_administrator_request [BetaInternalPermissionServiceDeleteAdministratorRequest] + + # @return [BetaInternalPermissionServiceDeleteAdministratorResponse] + # @raise [ApiError] if fails to make API call + def delete_administrator(beta_internal_permission_service_delete_administrator_request) + if beta_internal_permission_service_delete_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_internal_permission_service_delete_administrator_request' when calling BetaInternalPermissionServiceApi.delete_administrator" + end + + result = delete_administrator_with_http_info(beta_internal_permission_service_delete_administrator_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_internal_permission_service_delete_administrator_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInternalPermissionServiceDeleteAdministratorResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInternalPermissionServiceApi.delete_administrator", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInternalPermissionServiceApi#delete_administrator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_administrator_with_http_info(beta_internal_permission_service_delete_administrator_request) + if beta_internal_permission_service_delete_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_internal_permission_service_delete_administrator_request' when calling BetaInternalPermissionServiceApi.delete_administrator" + end + + path = '/zitadel.internal_permission.v2beta.InternalPermissionService/DeleteAdministrator' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_internal_permission_service_delete_administrator_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInternalPermissionServiceDeleteAdministratorResponse', + nil + ) + end # ListAdministrators returns all administrators and its roles matching the request and necessary permissions. - # Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Required permissions depend on the resource type: - \"iam.member.read\" for instance administrators - \"org.member.read\" for organization administrators - \"project.member.read\" for project administrators - \"project.grant.member.read\" for project grant administrators - no permissions required for listing own administrator roles - # @param beta_internal_permission_service_list_administrators_request [BetaInternalPermissionServiceListAdministratorsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInternalPermissionServiceListAdministratorsResponse] - def list_administrators(beta_internal_permission_service_list_administrators_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInternalPermissionServiceApi.list_administrators ...' # MODIFIED - end - # verify the required parameter 'beta_internal_permission_service_list_administrators_request' is set - if @api_client.config.client_side_validation && beta_internal_permission_service_list_administrators_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_internal_permission_service_list_administrators_request' when calling Api::BetaInternalPermissionServiceApi.list_administrators" # MODIFIED - end - # resource path - local_var_path = '/zitadel.internal_permission.v2beta.InternalPermissionService/ListAdministrators' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Required permissions depend on the resource type: - \"iam.member.read\" for instance administrators - \"org.member.read\" for organization administrators - \"project.member.read\" for project administrators - \"project.grant.member.read\" for project grant administrators - no permissions required for listing own administrator roles + # @param beta_internal_permission_service_list_administrators_request [BetaInternalPermissionServiceListAdministratorsRequest] + + # @return [BetaInternalPermissionServiceListAdministratorsResponse] + # @raise [ApiError] if fails to make API call + def list_administrators(beta_internal_permission_service_list_administrators_request) + if beta_internal_permission_service_list_administrators_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_internal_permission_service_list_administrators_request' when calling BetaInternalPermissionServiceApi.list_administrators" + end + + result = list_administrators_with_http_info(beta_internal_permission_service_list_administrators_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_internal_permission_service_list_administrators_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInternalPermissionServiceListAdministratorsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInternalPermissionServiceApi.list_administrators", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInternalPermissionServiceApi#list_administrators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_administrators_with_http_info(beta_internal_permission_service_list_administrators_request) + if beta_internal_permission_service_list_administrators_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_internal_permission_service_list_administrators_request' when calling BetaInternalPermissionServiceApi.list_administrators" + end + + path = '/zitadel.internal_permission.v2beta.InternalPermissionService/ListAdministrators' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_internal_permission_service_list_administrators_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInternalPermissionServiceListAdministratorsResponse', + nil + ) + end # UpdateAdministrator updates the specific administrator role. - # Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Note that any role previously granted to the user and not present in the request will be revoked. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators - # @param beta_internal_permission_service_update_administrator_request [BetaInternalPermissionServiceUpdateAdministratorRequest] - # @param [Hash] opts the optional parameters - # @return [BetaInternalPermissionServiceUpdateAdministratorResponse] - def update_administrator(beta_internal_permission_service_update_administrator_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaInternalPermissionServiceApi.update_administrator ...' # MODIFIED - end - # verify the required parameter 'beta_internal_permission_service_update_administrator_request' is set - if @api_client.config.client_side_validation && beta_internal_permission_service_update_administrator_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_internal_permission_service_update_administrator_request' when calling Api::BetaInternalPermissionServiceApi.update_administrator" # MODIFIED - end - # resource path - local_var_path = '/zitadel.internal_permission.v2beta.InternalPermissionService/UpdateAdministrator' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Note that any role previously granted to the user and not present in the request will be revoked. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + # @param beta_internal_permission_service_update_administrator_request [BetaInternalPermissionServiceUpdateAdministratorRequest] + + # @return [BetaInternalPermissionServiceUpdateAdministratorResponse] + # @raise [ApiError] if fails to make API call + def update_administrator(beta_internal_permission_service_update_administrator_request) + if beta_internal_permission_service_update_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_internal_permission_service_update_administrator_request' when calling BetaInternalPermissionServiceApi.update_administrator" + end + + result = update_administrator_with_http_info(beta_internal_permission_service_update_administrator_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_internal_permission_service_update_administrator_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaInternalPermissionServiceUpdateAdministratorResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaInternalPermissionServiceApi.update_administrator", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaInternalPermissionServiceApi#update_administrator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_administrator_with_http_info(beta_internal_permission_service_update_administrator_request) + if beta_internal_permission_service_update_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_internal_permission_service_update_administrator_request' when calling BetaInternalPermissionServiceApi.update_administrator" + end + + path = '/zitadel.internal_permission.v2beta.InternalPermissionService/UpdateAdministrator' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_internal_permission_service_update_administrator_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaInternalPermissionServiceUpdateAdministratorResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_o_i_d_c_service_api.rb b/lib/zitadel/client/api/beta_o_i_d_c_service_api.rb deleted file mode 100644 index 04c23478..00000000 --- a/lib/zitadel/client/api/beta_o_i_d_c_service_api.rb +++ /dev/null @@ -1,138 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaOIDCServiceApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Create Callback - # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. - # @param beta_oidc_service_create_callback_request [BetaOIDCServiceCreateCallbackRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOIDCServiceCreateCallbackResponse] - def create_callback(beta_oidc_service_create_callback_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOIDCServiceApi.create_callback ...' # MODIFIED - end - # verify the required parameter 'beta_oidc_service_create_callback_request' is set - if @api_client.config.client_side_validation && beta_oidc_service_create_callback_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_oidc_service_create_callback_request' when calling Api::BetaOIDCServiceApi.create_callback" # MODIFIED - end - # resource path - local_var_path = '/zitadel.oidc.v2beta.OIDCService/CreateCallback' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_oidc_service_create_callback_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOIDCServiceCreateCallbackResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOIDCServiceApi.create_callback", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOIDCServiceApi#create_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end - - # Get AuthRequest - # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. - # @param beta_oidc_service_get_auth_request_request [BetaOIDCServiceGetAuthRequestRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOIDCServiceGetAuthRequestResponse] - def get_auth_request(beta_oidc_service_get_auth_request_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOIDCServiceApi.get_auth_request ...' # MODIFIED - end - # verify the required parameter 'beta_oidc_service_get_auth_request_request' is set - if @api_client.config.client_side_validation && beta_oidc_service_get_auth_request_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_oidc_service_get_auth_request_request' when calling Api::BetaOIDCServiceApi.get_auth_request" # MODIFIED - end - # resource path - local_var_path = '/zitadel.oidc.v2beta.OIDCService/GetAuthRequest' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_oidc_service_get_auth_request_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOIDCServiceGetAuthRequestResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOIDCServiceApi.get_auth_request", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOIDCServiceApi#get_auth_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end - end -end diff --git a/lib/zitadel/client/api/beta_oidc_service_api.rb b/lib/zitadel/client/api/beta_oidc_service_api.rb new file mode 100644 index 00000000..5ffea055 --- /dev/null +++ b/lib/zitadel/client/api/beta_oidc_service_api.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaOIDCServiceApi provides methods for the BetaOIDCService API group. + class BetaOIDCServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end + + # Create Callback + # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. + # @param beta_oidc_service_create_callback_request [BetaOIDCServiceCreateCallbackRequest] + + # @return [BetaOIDCServiceCreateCallbackResponse] + # @raise [ApiError] if fails to make API call + def create_callback(beta_oidc_service_create_callback_request) + if beta_oidc_service_create_callback_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_oidc_service_create_callback_request' when calling BetaOIDCServiceApi.create_callback" + end + + result = create_callback_with_http_info(beta_oidc_service_create_callback_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_callback_with_http_info(beta_oidc_service_create_callback_request) + if beta_oidc_service_create_callback_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_oidc_service_create_callback_request' when calling BetaOIDCServiceApi.create_callback" + end + + path = '/zitadel.oidc.v2beta.OIDCService/CreateCallback' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_oidc_service_create_callback_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOIDCServiceCreateCallbackResponse', + nil + ) + end + + # Get AuthRequest + # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. + # @param beta_oidc_service_get_auth_request_request [BetaOIDCServiceGetAuthRequestRequest] + + # @return [BetaOIDCServiceGetAuthRequestResponse] + # @raise [ApiError] if fails to make API call + def get_auth_request(beta_oidc_service_get_auth_request_request) + if beta_oidc_service_get_auth_request_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_oidc_service_get_auth_request_request' when calling BetaOIDCServiceApi.get_auth_request" + end + + result = get_auth_request_with_http_info(beta_oidc_service_get_auth_request_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_auth_request_with_http_info(beta_oidc_service_get_auth_request_request) + if beta_oidc_service_get_auth_request_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_oidc_service_get_auth_request_request' when calling BetaOIDCServiceApi.get_auth_request" + end + + path = '/zitadel.oidc.v2beta.OIDCService/GetAuthRequest' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_oidc_service_get_auth_request_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOIDCServiceGetAuthRequestResponse', + nil + ) + end + end + end +end diff --git a/lib/zitadel/client/api/beta_organization_service_api.rb b/lib/zitadel/client/api/beta_organization_service_api.rb index 4e4dd93d..ae80e4df 100644 --- a/lib/zitadel/client/api/beta_organization_service_api.rb +++ b/lib/zitadel/client/api/beta_organization_service_api.rb @@ -1,834 +1,764 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaOrganizationServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaOrganizationServiceApi provides methods for the BetaOrganizationService API group. + class BetaOrganizationServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Activate Organization - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again. Required permission: - `org.write` - # @param beta_organization_service_activate_organization_request [BetaOrganizationServiceActivateOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceActivateOrganizationResponse] - def activate_organization(beta_organization_service_activate_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.activate_organization ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_activate_organization_request' is set - if @api_client.config.client_side_validation && beta_organization_service_activate_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_activate_organization_request' when calling Api::BetaOrganizationServiceApi.activate_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/ActivateOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again. Required permission: - `org.write` + # @param beta_organization_service_activate_organization_request [BetaOrganizationServiceActivateOrganizationRequest] + + # @return [BetaOrganizationServiceActivateOrganizationResponse] + # @raise [ApiError] if fails to make API call + def activate_organization(beta_organization_service_activate_organization_request) + if beta_organization_service_activate_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_activate_organization_request' when calling BetaOrganizationServiceApi.activate_organization" + end + + result = activate_organization_with_http_info(beta_organization_service_activate_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_activate_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceActivateOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.activate_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#activate_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_organization_with_http_info(beta_organization_service_activate_organization_request) + if beta_organization_service_activate_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_activate_organization_request' when calling BetaOrganizationServiceApi.activate_organization" + end + + path = '/zitadel.org.v2beta.OrganizationService/ActivateOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_activate_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceActivateOrganizationResponse', + nil + ) + end # Add Organization Domain - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Add a new domain to an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.write` - # @param beta_organization_service_add_organization_domain_request [BetaOrganizationServiceAddOrganizationDomainRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceAddOrganizationDomainResponse] - def add_organization_domain(beta_organization_service_add_organization_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.add_organization_domain ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_add_organization_domain_request' is set - if @api_client.config.client_side_validation && beta_organization_service_add_organization_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_add_organization_domain_request' when calling Api::BetaOrganizationServiceApi.add_organization_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/AddOrganizationDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Add a new domain to an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.write` + # @param beta_organization_service_add_organization_domain_request [BetaOrganizationServiceAddOrganizationDomainRequest] + + # @return [BetaOrganizationServiceAddOrganizationDomainResponse] + # @raise [ApiError] if fails to make API call + def add_organization_domain(beta_organization_service_add_organization_domain_request) + if beta_organization_service_add_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_add_organization_domain_request' when calling BetaOrganizationServiceApi.add_organization_domain" + end + + result = add_organization_domain_with_http_info(beta_organization_service_add_organization_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_add_organization_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceAddOrganizationDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.add_organization_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#add_organization_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_organization_domain_with_http_info(beta_organization_service_add_organization_domain_request) + if beta_organization_service_add_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_add_organization_domain_request' when calling BetaOrganizationServiceApi.add_organization_domain" + end + + path = '/zitadel.org.v2beta.OrganizationService/AddOrganizationDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_add_organization_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceAddOrganizationDomainResponse', + nil + ) + end # Create Organization - # Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. Required permission: - `org.create` Deprecated: Use [AddOrganization](/apis/resources/org_service_v2/organization-service-add-organization.api.mdx) instead to create an organization. - # @param beta_organization_service_create_organization_request [BetaOrganizationServiceCreateOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceCreateOrganizationResponse] - def create_organization(beta_organization_service_create_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.create_organization ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_create_organization_request' is set - if @api_client.config.client_side_validation && beta_organization_service_create_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_create_organization_request' when calling Api::BetaOrganizationServiceApi.create_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/CreateOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. Required permission: - `org.create` Deprecated: Use [AddOrganization](/apis/resources/org_service_v2/organization-service-add-organization.api.mdx) instead to create an organization. + # @param beta_organization_service_create_organization_request [BetaOrganizationServiceCreateOrganizationRequest] + + # @return [BetaOrganizationServiceCreateOrganizationResponse] + # @raise [ApiError] if fails to make API call + def create_organization(beta_organization_service_create_organization_request) + if beta_organization_service_create_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_create_organization_request' when calling BetaOrganizationServiceApi.create_organization" + end + + result = create_organization_with_http_info(beta_organization_service_create_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_create_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceCreateOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.create_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_organization_with_http_info(beta_organization_service_create_organization_request) + if beta_organization_service_create_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_create_organization_request' when calling BetaOrganizationServiceApi.create_organization" + end + + path = '/zitadel.org.v2beta.OrganizationService/CreateOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_create_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceCreateOrganizationResponse', + nil + ) + end # Deactivate Organization - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Sets the state of my organization to deactivated. Users of this organization will not be able to log in. Required permission: - `org.write` - # @param beta_organization_service_deactivate_organization_request [BetaOrganizationServiceDeactivateOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceDeactivateOrganizationResponse] - def deactivate_organization(beta_organization_service_deactivate_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.deactivate_organization ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_deactivate_organization_request' is set - if @api_client.config.client_side_validation && beta_organization_service_deactivate_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_deactivate_organization_request' when calling Api::BetaOrganizationServiceApi.deactivate_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/DeactivateOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Sets the state of my organization to deactivated. Users of this organization will not be able to log in. Required permission: - `org.write` + # @param beta_organization_service_deactivate_organization_request [BetaOrganizationServiceDeactivateOrganizationRequest] + + # @return [BetaOrganizationServiceDeactivateOrganizationResponse] + # @raise [ApiError] if fails to make API call + def deactivate_organization(beta_organization_service_deactivate_organization_request) + if beta_organization_service_deactivate_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_deactivate_organization_request' when calling BetaOrganizationServiceApi.deactivate_organization" + end + + result = deactivate_organization_with_http_info(beta_organization_service_deactivate_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_deactivate_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceDeactivateOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.deactivate_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#deactivate_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_organization_with_http_info(beta_organization_service_deactivate_organization_request) + if beta_organization_service_deactivate_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_deactivate_organization_request' when calling BetaOrganizationServiceApi.deactivate_organization" + end + + path = '/zitadel.org.v2beta.OrganizationService/DeactivateOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_deactivate_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceDeactivateOrganizationResponse', + nil + ) + end # Delete Organization - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in. Required permission: - `org.delete` - # @param beta_organization_service_delete_organization_request [BetaOrganizationServiceDeleteOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceDeleteOrganizationResponse] - def delete_organization(beta_organization_service_delete_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.delete_organization ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_delete_organization_request' is set - if @api_client.config.client_side_validation && beta_organization_service_delete_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_delete_organization_request' when calling Api::BetaOrganizationServiceApi.delete_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/DeleteOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in. Required permission: - `org.delete` + # @param beta_organization_service_delete_organization_request [BetaOrganizationServiceDeleteOrganizationRequest] + + # @return [BetaOrganizationServiceDeleteOrganizationResponse] + # @raise [ApiError] if fails to make API call + def delete_organization(beta_organization_service_delete_organization_request) + if beta_organization_service_delete_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_delete_organization_request' when calling BetaOrganizationServiceApi.delete_organization" + end + + result = delete_organization_with_http_info(beta_organization_service_delete_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_delete_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceDeleteOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.delete_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#delete_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_organization_with_http_info(beta_organization_service_delete_organization_request) + if beta_organization_service_delete_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_delete_organization_request' when calling BetaOrganizationServiceApi.delete_organization" + end + + path = '/zitadel.org.v2beta.OrganizationService/DeleteOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_delete_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceDeleteOrganizationResponse', + nil + ) + end # Delete Organization Domain - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead. Required permission: - `org.write` - # @param beta_organization_service_delete_organization_domain_request [BetaOrganizationServiceDeleteOrganizationDomainRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceDeleteOrganizationDomainResponse] - def delete_organization_domain(beta_organization_service_delete_organization_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.delete_organization_domain ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_delete_organization_domain_request' is set - if @api_client.config.client_side_validation && beta_organization_service_delete_organization_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_delete_organization_domain_request' when calling Api::BetaOrganizationServiceApi.delete_organization_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/DeleteOrganizationDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead. Required permission: - `org.write` + # @param beta_organization_service_delete_organization_domain_request [BetaOrganizationServiceDeleteOrganizationDomainRequest] + + # @return [BetaOrganizationServiceDeleteOrganizationDomainResponse] + # @raise [ApiError] if fails to make API call + def delete_organization_domain(beta_organization_service_delete_organization_domain_request) + if beta_organization_service_delete_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_delete_organization_domain_request' when calling BetaOrganizationServiceApi.delete_organization_domain" + end + + result = delete_organization_domain_with_http_info(beta_organization_service_delete_organization_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_delete_organization_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceDeleteOrganizationDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.delete_organization_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#delete_organization_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_organization_domain_with_http_info(beta_organization_service_delete_organization_domain_request) + if beta_organization_service_delete_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_delete_organization_domain_request' when calling BetaOrganizationServiceApi.delete_organization_domain" + end + + path = '/zitadel.org.v2beta.OrganizationService/DeleteOrganizationDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_delete_organization_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceDeleteOrganizationDomainResponse', + nil + ) + end # Delete Organization Metadata - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Delete metadata objects from an organization with a specific key. Required permission: - `org.write` - # @param beta_organization_service_delete_organization_metadata_request [BetaOrganizationServiceDeleteOrganizationMetadataRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceDeleteOrganizationMetadataResponse] - def delete_organization_metadata(beta_organization_service_delete_organization_metadata_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.delete_organization_metadata ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_delete_organization_metadata_request' is set - if @api_client.config.client_side_validation && beta_organization_service_delete_organization_metadata_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_delete_organization_metadata_request' when calling Api::BetaOrganizationServiceApi.delete_organization_metadata" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/DeleteOrganizationMetadata' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Delete metadata objects from an organization with a specific key. Required permission: - `org.write` + # @param beta_organization_service_delete_organization_metadata_request [BetaOrganizationServiceDeleteOrganizationMetadataRequest] + + # @return [BetaOrganizationServiceDeleteOrganizationMetadataResponse] + # @raise [ApiError] if fails to make API call + def delete_organization_metadata(beta_organization_service_delete_organization_metadata_request) + if beta_organization_service_delete_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_delete_organization_metadata_request' when calling BetaOrganizationServiceApi.delete_organization_metadata" + end + + result = delete_organization_metadata_with_http_info(beta_organization_service_delete_organization_metadata_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_delete_organization_metadata_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceDeleteOrganizationMetadataResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.delete_organization_metadata", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#delete_organization_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_organization_metadata_with_http_info(beta_organization_service_delete_organization_metadata_request) + if beta_organization_service_delete_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_delete_organization_metadata_request' when calling BetaOrganizationServiceApi.delete_organization_metadata" + end + + path = '/zitadel.org.v2beta.OrganizationService/DeleteOrganizationMetadata' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_delete_organization_metadata_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceDeleteOrganizationMetadataResponse', + nil + ) + end # Generate Organization Domain Validation - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Generate a new file to be able to verify your domain with DNS or HTTP challenge. Required permission: - `org.write` - # @param beta_organization_service_generate_organization_domain_validation_request [BetaOrganizationServiceGenerateOrganizationDomainValidationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceGenerateOrganizationDomainValidationResponse] - def generate_organization_domain_validation(beta_organization_service_generate_organization_domain_validation_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.generate_organization_domain_validation ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_generate_organization_domain_validation_request' is set - if @api_client.config.client_side_validation && beta_organization_service_generate_organization_domain_validation_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_generate_organization_domain_validation_request' when calling Api::BetaOrganizationServiceApi.generate_organization_domain_validation" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/GenerateOrganizationDomainValidation' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Generate a new file to be able to verify your domain with DNS or HTTP challenge. Required permission: - `org.write` + # @param beta_organization_service_generate_organization_domain_validation_request [BetaOrganizationServiceGenerateOrganizationDomainValidationRequest] + + # @return [BetaOrganizationServiceGenerateOrganizationDomainValidationResponse] + # @raise [ApiError] if fails to make API call + def generate_organization_domain_validation(beta_organization_service_generate_organization_domain_validation_request) + if beta_organization_service_generate_organization_domain_validation_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_generate_organization_domain_validation_request' when calling BetaOrganizationServiceApi.generate_organization_domain_validation" + end + + result = generate_organization_domain_validation_with_http_info(beta_organization_service_generate_organization_domain_validation_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_generate_organization_domain_validation_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceGenerateOrganizationDomainValidationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.generate_organization_domain_validation", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#generate_organization_domain_validation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def generate_organization_domain_validation_with_http_info(beta_organization_service_generate_organization_domain_validation_request) + if beta_organization_service_generate_organization_domain_validation_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_generate_organization_domain_validation_request' when calling BetaOrganizationServiceApi.generate_organization_domain_validation" + end + + path = '/zitadel.org.v2beta.OrganizationService/GenerateOrganizationDomainValidation' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_generate_organization_domain_validation_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceGenerateOrganizationDomainValidationResponse', + nil + ) + end # List Organization Domains - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.read` - # @param beta_organization_service_list_organization_domains_request [BetaOrganizationServiceListOrganizationDomainsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceListOrganizationDomainsResponse] - def list_organization_domains(beta_organization_service_list_organization_domains_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.list_organization_domains ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_list_organization_domains_request' is set - if @api_client.config.client_side_validation && beta_organization_service_list_organization_domains_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_list_organization_domains_request' when calling Api::BetaOrganizationServiceApi.list_organization_domains" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/ListOrganizationDomains' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.read` + # @param beta_organization_service_list_organization_domains_request [BetaOrganizationServiceListOrganizationDomainsRequest] + + # @return [BetaOrganizationServiceListOrganizationDomainsResponse] + # @raise [ApiError] if fails to make API call + def list_organization_domains(beta_organization_service_list_organization_domains_request) + if beta_organization_service_list_organization_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_list_organization_domains_request' when calling BetaOrganizationServiceApi.list_organization_domains" + end + + result = list_organization_domains_with_http_info(beta_organization_service_list_organization_domains_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_list_organization_domains_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceListOrganizationDomainsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.list_organization_domains", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#list_organization_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_organization_domains_with_http_info(beta_organization_service_list_organization_domains_request) + if beta_organization_service_list_organization_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_list_organization_domains_request' when calling BetaOrganizationServiceApi.list_organization_domains" + end + + path = '/zitadel.org.v2beta.OrganizationService/ListOrganizationDomains' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_list_organization_domains_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceListOrganizationDomainsResponse', + nil + ) + end # List Organization Metadata - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. List metadata of an organization filtered by query. Required permission: - `org.read` - # @param beta_organization_service_list_organization_metadata_request [BetaOrganizationServiceListOrganizationMetadataRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceListOrganizationMetadataResponse] - def list_organization_metadata(beta_organization_service_list_organization_metadata_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.list_organization_metadata ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_list_organization_metadata_request' is set - if @api_client.config.client_side_validation && beta_organization_service_list_organization_metadata_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_list_organization_metadata_request' when calling Api::BetaOrganizationServiceApi.list_organization_metadata" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/ListOrganizationMetadata' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. List metadata of an organization filtered by query. Required permission: - `org.read` + # @param beta_organization_service_list_organization_metadata_request [BetaOrganizationServiceListOrganizationMetadataRequest] + + # @return [BetaOrganizationServiceListOrganizationMetadataResponse] + # @raise [ApiError] if fails to make API call + def list_organization_metadata(beta_organization_service_list_organization_metadata_request) + if beta_organization_service_list_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_list_organization_metadata_request' when calling BetaOrganizationServiceApi.list_organization_metadata" + end + + result = list_organization_metadata_with_http_info(beta_organization_service_list_organization_metadata_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_list_organization_metadata_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceListOrganizationMetadataResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.list_organization_metadata", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#list_organization_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_organization_metadata_with_http_info(beta_organization_service_list_organization_metadata_request) + if beta_organization_service_list_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_list_organization_metadata_request' when calling BetaOrganizationServiceApi.list_organization_metadata" + end + + path = '/zitadel.org.v2beta.OrganizationService/ListOrganizationMetadata' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_list_organization_metadata_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceListOrganizationMetadataResponse', + nil + ) + end # List Organizations - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Returns a list of organizations that match the requesting filters. All filters are applied with an AND condition. Required permission: - `org.read` Deprecated: Use [ListOrganizations](/apis/resources/org_service_v2/organization-service-list-organizations.api.mdx) instead to list organizations. - # @param beta_organization_service_list_organizations_request [BetaOrganizationServiceListOrganizationsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceListOrganizationsResponse] - def list_organizations(beta_organization_service_list_organizations_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.list_organizations ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_list_organizations_request' is set - if @api_client.config.client_side_validation && beta_organization_service_list_organizations_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_list_organizations_request' when calling Api::BetaOrganizationServiceApi.list_organizations" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/ListOrganizations' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Returns a list of organizations that match the requesting filters. All filters are applied with an AND condition. Required permission: - `org.read` Deprecated: Use [ListOrganizations](/apis/resources/org_service_v2/organization-service-list-organizations.api.mdx) instead to list organizations. + # @param beta_organization_service_list_organizations_request [BetaOrganizationServiceListOrganizationsRequest] + + # @return [BetaOrganizationServiceListOrganizationsResponse] + # @raise [ApiError] if fails to make API call + def list_organizations(beta_organization_service_list_organizations_request) + if beta_organization_service_list_organizations_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_list_organizations_request' when calling BetaOrganizationServiceApi.list_organizations" + end + + result = list_organizations_with_http_info(beta_organization_service_list_organizations_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_list_organizations_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceListOrganizationsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.list_organizations", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_organizations_with_http_info(beta_organization_service_list_organizations_request) + if beta_organization_service_list_organizations_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_list_organizations_request' when calling BetaOrganizationServiceApi.list_organizations" + end + + path = '/zitadel.org.v2beta.OrganizationService/ListOrganizations' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_list_organizations_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceListOrganizationsResponse', + nil + ) + end # Set Organization Metadata - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded. Required permission: - `org.write` - # @param beta_organization_service_set_organization_metadata_request [BetaOrganizationServiceSetOrganizationMetadataRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceSetOrganizationMetadataResponse] - def set_organization_metadata(beta_organization_service_set_organization_metadata_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.set_organization_metadata ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_set_organization_metadata_request' is set - if @api_client.config.client_side_validation && beta_organization_service_set_organization_metadata_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_set_organization_metadata_request' when calling Api::BetaOrganizationServiceApi.set_organization_metadata" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/SetOrganizationMetadata' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded. Required permission: - `org.write` + # @param beta_organization_service_set_organization_metadata_request [BetaOrganizationServiceSetOrganizationMetadataRequest] + + # @return [BetaOrganizationServiceSetOrganizationMetadataResponse] + # @raise [ApiError] if fails to make API call + def set_organization_metadata(beta_organization_service_set_organization_metadata_request) + if beta_organization_service_set_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_set_organization_metadata_request' when calling BetaOrganizationServiceApi.set_organization_metadata" + end + + result = set_organization_metadata_with_http_info(beta_organization_service_set_organization_metadata_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_set_organization_metadata_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceSetOrganizationMetadataResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.set_organization_metadata", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#set_organization_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_organization_metadata_with_http_info(beta_organization_service_set_organization_metadata_request) + if beta_organization_service_set_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_set_organization_metadata_request' when calling BetaOrganizationServiceApi.set_organization_metadata" + end + + path = '/zitadel.org.v2beta.OrganizationService/SetOrganizationMetadata' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_set_organization_metadata_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceSetOrganizationMetadataResponse', + nil + ) + end # Update Organization - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Change the name of the organization. Required permission: - `org.write` - # @param beta_organization_service_update_organization_request [BetaOrganizationServiceUpdateOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceUpdateOrganizationResponse] - def update_organization(beta_organization_service_update_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.update_organization ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_update_organization_request' is set - if @api_client.config.client_side_validation && beta_organization_service_update_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_update_organization_request' when calling Api::BetaOrganizationServiceApi.update_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/UpdateOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Change the name of the organization. Required permission: - `org.write` + # @param beta_organization_service_update_organization_request [BetaOrganizationServiceUpdateOrganizationRequest] + + # @return [BetaOrganizationServiceUpdateOrganizationResponse] + # @raise [ApiError] if fails to make API call + def update_organization(beta_organization_service_update_organization_request) + if beta_organization_service_update_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_update_organization_request' when calling BetaOrganizationServiceApi.update_organization" + end + + result = update_organization_with_http_info(beta_organization_service_update_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_update_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceUpdateOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.update_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#update_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_organization_with_http_info(beta_organization_service_update_organization_request) + if beta_organization_service_update_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_update_organization_request' when calling BetaOrganizationServiceApi.update_organization" + end + + path = '/zitadel.org.v2beta.OrganizationService/UpdateOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_update_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceUpdateOrganizationResponse', + nil + ) + end # Verify Organization Domain - # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique. Required permission: - `org.write` - # @param beta_organization_service_verify_organization_domain_request [BetaOrganizationServiceVerifyOrganizationDomainRequest] - # @param [Hash] opts the optional parameters - # @return [BetaOrganizationServiceVerifyOrganizationDomainResponse] - def verify_organization_domain(beta_organization_service_verify_organization_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaOrganizationServiceApi.verify_organization_domain ...' # MODIFIED - end - # verify the required parameter 'beta_organization_service_verify_organization_domain_request' is set - if @api_client.config.client_side_validation && beta_organization_service_verify_organization_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_organization_service_verify_organization_domain_request' when calling Api::BetaOrganizationServiceApi.verify_organization_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2beta.OrganizationService/VerifyOrganizationDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique. Required permission: - `org.write` + # @param beta_organization_service_verify_organization_domain_request [BetaOrganizationServiceVerifyOrganizationDomainRequest] + + # @return [BetaOrganizationServiceVerifyOrganizationDomainResponse] + # @raise [ApiError] if fails to make API call + def verify_organization_domain(beta_organization_service_verify_organization_domain_request) + if beta_organization_service_verify_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_verify_organization_domain_request' when calling BetaOrganizationServiceApi.verify_organization_domain" + end + + result = verify_organization_domain_with_http_info(beta_organization_service_verify_organization_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_organization_service_verify_organization_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaOrganizationServiceVerifyOrganizationDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaOrganizationServiceApi.verify_organization_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaOrganizationServiceApi#verify_organization_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_organization_domain_with_http_info(beta_organization_service_verify_organization_domain_request) + if beta_organization_service_verify_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_organization_service_verify_organization_domain_request' when calling BetaOrganizationServiceApi.verify_organization_domain" + end + + path = '/zitadel.org.v2beta.OrganizationService/VerifyOrganizationDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_organization_service_verify_organization_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaOrganizationServiceVerifyOrganizationDomainResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_project_service_api.rb b/lib/zitadel/client/api/beta_project_service_api.rb index 5017b701..0a802c24 100644 --- a/lib/zitadel/client/api/beta_project_service_api.rb +++ b/lib/zitadel/client/api/beta_project_service_api.rb @@ -1,1008 +1,923 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaProjectServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaProjectServiceApi provides methods for the BetaProjectService API group. + class BetaProjectServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Activate Project - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of a project to active. Request returns no error if the project is already activated. Required permission: - `project.write` - # @param beta_project_service_activate_project_request [BetaProjectServiceActivateProjectRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceActivateProjectResponse] - def activate_project(beta_project_service_activate_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.activate_project ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_activate_project_request' is set - if @api_client.config.client_side_validation && beta_project_service_activate_project_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_activate_project_request' when calling Api::BetaProjectServiceApi.activate_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/ActivateProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_activate_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceActivateProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.activate_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#activate_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of a project to active. Request returns no error if the project is already activated. Required permission: - `project.write` + # @param beta_project_service_activate_project_request [BetaProjectServiceActivateProjectRequest] + + # @return [BetaProjectServiceActivateProjectResponse] + # @raise [ApiError] if fails to make API call + def activate_project(beta_project_service_activate_project_request) + if beta_project_service_activate_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_activate_project_request' when calling BetaProjectServiceApi.activate_project" + end + + result = activate_project_with_http_info(beta_project_service_activate_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_project_with_http_info(beta_project_service_activate_project_request) + if beta_project_service_activate_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_activate_project_request' when calling BetaProjectServiceApi.activate_project" + end + + path = '/zitadel.project.v2beta.ProjectService/ActivateProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_activate_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceActivateProjectResponse', + nil + ) + end # Activate Project Grant - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of the project grant to activated. Required permission: - `project.grant.write` - # @param beta_project_service_activate_project_grant_request [BetaProjectServiceActivateProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceActivateProjectGrantResponse] - def activate_project_grant(beta_project_service_activate_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.activate_project_grant ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_activate_project_grant_request' is set - if @api_client.config.client_side_validation && beta_project_service_activate_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_activate_project_grant_request' when calling Api::BetaProjectServiceApi.activate_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/ActivateProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_activate_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceActivateProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.activate_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#activate_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of the project grant to activated. Required permission: - `project.grant.write` + # @param beta_project_service_activate_project_grant_request [BetaProjectServiceActivateProjectGrantRequest] + + # @return [BetaProjectServiceActivateProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def activate_project_grant(beta_project_service_activate_project_grant_request) + if beta_project_service_activate_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_activate_project_grant_request' when calling BetaProjectServiceApi.activate_project_grant" + end + + result = activate_project_grant_with_http_info(beta_project_service_activate_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_project_grant_with_http_info(beta_project_service_activate_project_grant_request) + if beta_project_service_activate_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_activate_project_grant_request' when calling BetaProjectServiceApi.activate_project_grant" + end + + path = '/zitadel.project.v2beta.ProjectService/ActivateProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_activate_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceActivateProjectGrantResponse', + nil + ) + end # Add Project Role - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Add a new project role to a project. The key must be unique within the project. Required permission: - `project.role.write` - # @param beta_project_service_add_project_role_request [BetaProjectServiceAddProjectRoleRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceAddProjectRoleResponse] - def add_project_role(beta_project_service_add_project_role_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.add_project_role ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_add_project_role_request' is set - if @api_client.config.client_side_validation && beta_project_service_add_project_role_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_add_project_role_request' when calling Api::BetaProjectServiceApi.add_project_role" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/AddProjectRole' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_add_project_role_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceAddProjectRoleResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.add_project_role", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#add_project_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Add a new project role to a project. The key must be unique within the project. Required permission: - `project.role.write` + # @param beta_project_service_add_project_role_request [BetaProjectServiceAddProjectRoleRequest] + + # @return [BetaProjectServiceAddProjectRoleResponse] + # @raise [ApiError] if fails to make API call + def add_project_role(beta_project_service_add_project_role_request) + if beta_project_service_add_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_add_project_role_request' when calling BetaProjectServiceApi.add_project_role" + end + + result = add_project_role_with_http_info(beta_project_service_add_project_role_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_project_role_with_http_info(beta_project_service_add_project_role_request) + if beta_project_service_add_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_add_project_role_request' when calling BetaProjectServiceApi.add_project_role" + end + + path = '/zitadel.project.v2beta.ProjectService/AddProjectRole' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_add_project_role_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceAddProjectRoleResponse', + nil + ) + end # Create Project - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Create a new Project. Required permission: - `project.create` - # @param beta_project_service_create_project_request [BetaProjectServiceCreateProjectRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceCreateProjectResponse] - def create_project(beta_project_service_create_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.create_project ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_create_project_request' is set - if @api_client.config.client_side_validation && beta_project_service_create_project_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_create_project_request' when calling Api::BetaProjectServiceApi.create_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/CreateProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_create_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceCreateProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.create_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Create a new Project. Required permission: - `project.create` + # @param beta_project_service_create_project_request [BetaProjectServiceCreateProjectRequest] + + # @return [BetaProjectServiceCreateProjectResponse] + # @raise [ApiError] if fails to make API call + def create_project(beta_project_service_create_project_request) + if beta_project_service_create_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_create_project_request' when calling BetaProjectServiceApi.create_project" + end + + result = create_project_with_http_info(beta_project_service_create_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_project_with_http_info(beta_project_service_create_project_request) + if beta_project_service_create_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_create_project_request' when calling BetaProjectServiceApi.create_project" + end + + path = '/zitadel.project.v2beta.ProjectService/CreateProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_create_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceCreateProjectResponse', + nil + ) + end # Create Project Grant - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Grant a project to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.create` - # @param beta_project_service_create_project_grant_request [BetaProjectServiceCreateProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceCreateProjectGrantResponse] - def create_project_grant(beta_project_service_create_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.create_project_grant ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_create_project_grant_request' is set - if @api_client.config.client_side_validation && beta_project_service_create_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_create_project_grant_request' when calling Api::BetaProjectServiceApi.create_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/CreateProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_create_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceCreateProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.create_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#create_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Grant a project to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.create` + # @param beta_project_service_create_project_grant_request [BetaProjectServiceCreateProjectGrantRequest] + + # @return [BetaProjectServiceCreateProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def create_project_grant(beta_project_service_create_project_grant_request) + if beta_project_service_create_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_create_project_grant_request' when calling BetaProjectServiceApi.create_project_grant" + end + + result = create_project_grant_with_http_info(beta_project_service_create_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_project_grant_with_http_info(beta_project_service_create_project_grant_request) + if beta_project_service_create_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_create_project_grant_request' when calling BetaProjectServiceApi.create_project_grant" + end + + path = '/zitadel.project.v2beta.ProjectService/CreateProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_create_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceCreateProjectGrantResponse', + nil + ) + end # Deactivate Project - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of a project to deactivated. Request returns no error if the project is already deactivated. Applications under deactivated projects are not able to login anymore. Required permission: - `project.write` - # @param beta_project_service_deactivate_project_request [BetaProjectServiceDeactivateProjectRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceDeactivateProjectResponse] - def deactivate_project(beta_project_service_deactivate_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.deactivate_project ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_deactivate_project_request' is set - if @api_client.config.client_side_validation && beta_project_service_deactivate_project_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_deactivate_project_request' when calling Api::BetaProjectServiceApi.deactivate_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/DeactivateProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_deactivate_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceDeactivateProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.deactivate_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#deactivate_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of a project to deactivated. Request returns no error if the project is already deactivated. Applications under deactivated projects are not able to login anymore. Required permission: - `project.write` + # @param beta_project_service_deactivate_project_request [BetaProjectServiceDeactivateProjectRequest] + + # @return [BetaProjectServiceDeactivateProjectResponse] + # @raise [ApiError] if fails to make API call + def deactivate_project(beta_project_service_deactivate_project_request) + if beta_project_service_deactivate_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_deactivate_project_request' when calling BetaProjectServiceApi.deactivate_project" + end + + result = deactivate_project_with_http_info(beta_project_service_deactivate_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_project_with_http_info(beta_project_service_deactivate_project_request) + if beta_project_service_deactivate_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_deactivate_project_request' when calling BetaProjectServiceApi.deactivate_project" + end + + path = '/zitadel.project.v2beta.ProjectService/DeactivateProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_deactivate_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceDeactivateProjectResponse', + nil + ) + end # Deactivate Project Grant - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of the project grant to deactivated. Applications under deactivated projects grants are not able to login anymore. Required permission: - `project.grant.write` - # @param beta_project_service_deactivate_project_grant_request [BetaProjectServiceDeactivateProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceDeactivateProjectGrantResponse] - def deactivate_project_grant(beta_project_service_deactivate_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.deactivate_project_grant ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_deactivate_project_grant_request' is set - if @api_client.config.client_side_validation && beta_project_service_deactivate_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_deactivate_project_grant_request' when calling Api::BetaProjectServiceApi.deactivate_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/DeactivateProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_deactivate_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceDeactivateProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.deactivate_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#deactivate_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of the project grant to deactivated. Applications under deactivated projects grants are not able to login anymore. Required permission: - `project.grant.write` + # @param beta_project_service_deactivate_project_grant_request [BetaProjectServiceDeactivateProjectGrantRequest] + + # @return [BetaProjectServiceDeactivateProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def deactivate_project_grant(beta_project_service_deactivate_project_grant_request) + if beta_project_service_deactivate_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_deactivate_project_grant_request' when calling BetaProjectServiceApi.deactivate_project_grant" + end + + result = deactivate_project_grant_with_http_info(beta_project_service_deactivate_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_project_grant_with_http_info(beta_project_service_deactivate_project_grant_request) + if beta_project_service_deactivate_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_deactivate_project_grant_request' when calling BetaProjectServiceApi.deactivate_project_grant" + end + + path = '/zitadel.project.v2beta.ProjectService/DeactivateProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_deactivate_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceDeactivateProjectGrantResponse', + nil + ) + end # Delete Project - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Delete an existing project. In case the project is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.delete` - # @param beta_project_service_delete_project_request [BetaProjectServiceDeleteProjectRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceDeleteProjectResponse] - def delete_project(beta_project_service_delete_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.delete_project ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_delete_project_request' is set - if @api_client.config.client_side_validation && beta_project_service_delete_project_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_delete_project_request' when calling Api::BetaProjectServiceApi.delete_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/DeleteProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_delete_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceDeleteProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.delete_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Delete an existing project. In case the project is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.delete` + # @param beta_project_service_delete_project_request [BetaProjectServiceDeleteProjectRequest] + + # @return [BetaProjectServiceDeleteProjectResponse] + # @raise [ApiError] if fails to make API call + def delete_project(beta_project_service_delete_project_request) + if beta_project_service_delete_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_delete_project_request' when calling BetaProjectServiceApi.delete_project" + end + + result = delete_project_with_http_info(beta_project_service_delete_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_project_with_http_info(beta_project_service_delete_project_request) + if beta_project_service_delete_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_delete_project_request' when calling BetaProjectServiceApi.delete_project" + end + + path = '/zitadel.project.v2beta.ProjectService/DeleteProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_delete_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceDeleteProjectResponse', + nil + ) + end # Delete Project Grant - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a project grant. All user grants for this project grant will also be removed. A user will not have access to the project afterward (if permissions are checked). In case the project grant is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.grant.delete` - # @param beta_project_service_delete_project_grant_request [BetaProjectServiceDeleteProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceDeleteProjectGrantResponse] - def delete_project_grant(beta_project_service_delete_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.delete_project_grant ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_delete_project_grant_request' is set - if @api_client.config.client_side_validation && beta_project_service_delete_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_delete_project_grant_request' when calling Api::BetaProjectServiceApi.delete_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/DeleteProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_delete_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceDeleteProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.delete_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#delete_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a project grant. All user grants for this project grant will also be removed. A user will not have access to the project afterward (if permissions are checked). In case the project grant is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.grant.delete` + # @param beta_project_service_delete_project_grant_request [BetaProjectServiceDeleteProjectGrantRequest] + + # @return [BetaProjectServiceDeleteProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def delete_project_grant(beta_project_service_delete_project_grant_request) + if beta_project_service_delete_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_delete_project_grant_request' when calling BetaProjectServiceApi.delete_project_grant" + end + + result = delete_project_grant_with_http_info(beta_project_service_delete_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_project_grant_with_http_info(beta_project_service_delete_project_grant_request) + if beta_project_service_delete_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_delete_project_grant_request' when calling BetaProjectServiceApi.delete_project_grant" + end + + path = '/zitadel.project.v2beta.ProjectService/DeleteProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_delete_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceDeleteProjectGrantResponse', + nil + ) + end # Get Project - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the project identified by the requested ID. Required permission: - `project.read` - # @param beta_project_service_get_project_request [BetaProjectServiceGetProjectRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceGetProjectResponse] - def get_project(beta_project_service_get_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.get_project ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_get_project_request' is set - if @api_client.config.client_side_validation && beta_project_service_get_project_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_get_project_request' when calling Api::BetaProjectServiceApi.get_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/GetProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_get_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceGetProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.get_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the project identified by the requested ID. Required permission: - `project.read` + # @param beta_project_service_get_project_request [BetaProjectServiceGetProjectRequest] + + # @return [BetaProjectServiceGetProjectResponse] + # @raise [ApiError] if fails to make API call + def get_project(beta_project_service_get_project_request) + if beta_project_service_get_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_get_project_request' when calling BetaProjectServiceApi.get_project" + end + + result = get_project_with_http_info(beta_project_service_get_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_project_with_http_info(beta_project_service_get_project_request) + if beta_project_service_get_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_get_project_request' when calling BetaProjectServiceApi.get_project" + end + + path = '/zitadel.project.v2beta.ProjectService/GetProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_get_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceGetProjectResponse', + nil + ) + end # List Project Grants - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns a list of project grants. A project grant is when the organization grants its project to another organization. Required permission: - `project.grant.write` - # @param beta_project_service_list_project_grants_request [BetaProjectServiceListProjectGrantsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceListProjectGrantsResponse] - def list_project_grants(beta_project_service_list_project_grants_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.list_project_grants ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_list_project_grants_request' is set - if @api_client.config.client_side_validation && beta_project_service_list_project_grants_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_list_project_grants_request' when calling Api::BetaProjectServiceApi.list_project_grants" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/ListProjectGrants' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_list_project_grants_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceListProjectGrantsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.list_project_grants", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#list_project_grants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns a list of project grants. A project grant is when the organization grants its project to another organization. Required permission: - `project.grant.write` + # @param beta_project_service_list_project_grants_request [BetaProjectServiceListProjectGrantsRequest] + + # @return [BetaProjectServiceListProjectGrantsResponse] + # @raise [ApiError] if fails to make API call + def list_project_grants(beta_project_service_list_project_grants_request) + if beta_project_service_list_project_grants_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_list_project_grants_request' when calling BetaProjectServiceApi.list_project_grants" + end + + result = list_project_grants_with_http_info(beta_project_service_list_project_grants_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_project_grants_with_http_info(beta_project_service_list_project_grants_request) + if beta_project_service_list_project_grants_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_list_project_grants_request' when calling BetaProjectServiceApi.list_project_grants" + end + + path = '/zitadel.project.v2beta.ProjectService/ListProjectGrants' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_list_project_grants_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceListProjectGrantsResponse', + nil + ) + end # List Project Roles - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns all roles of a project matching the search query. Required permission: - `project.role.read` - # @param beta_project_service_list_project_roles_request [BetaProjectServiceListProjectRolesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceListProjectRolesResponse] - def list_project_roles(beta_project_service_list_project_roles_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.list_project_roles ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_list_project_roles_request' is set - if @api_client.config.client_side_validation && beta_project_service_list_project_roles_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_list_project_roles_request' when calling Api::BetaProjectServiceApi.list_project_roles" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/ListProjectRoles' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_list_project_roles_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceListProjectRolesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.list_project_roles", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#list_project_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns all roles of a project matching the search query. Required permission: - `project.role.read` + # @param beta_project_service_list_project_roles_request [BetaProjectServiceListProjectRolesRequest] + + # @return [BetaProjectServiceListProjectRolesResponse] + # @raise [ApiError] if fails to make API call + def list_project_roles(beta_project_service_list_project_roles_request) + if beta_project_service_list_project_roles_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_list_project_roles_request' when calling BetaProjectServiceApi.list_project_roles" + end + + result = list_project_roles_with_http_info(beta_project_service_list_project_roles_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_project_roles_with_http_info(beta_project_service_list_project_roles_request) + if beta_project_service_list_project_roles_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_list_project_roles_request' when calling BetaProjectServiceApi.list_project_roles" + end + + path = '/zitadel.project.v2beta.ProjectService/ListProjectRoles' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_list_project_roles_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceListProjectRolesResponse', + nil + ) + end # List Projects - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching projects. By default all projects of the instance that the caller has permission to read are returned. Make sure to include a limit and sorting for pagination. Required permission: - `project.read` - # @param beta_project_service_list_projects_request [BetaProjectServiceListProjectsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceListProjectsResponse] - def list_projects(beta_project_service_list_projects_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.list_projects ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_list_projects_request' is set - if @api_client.config.client_side_validation && beta_project_service_list_projects_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_list_projects_request' when calling Api::BetaProjectServiceApi.list_projects" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/ListProjects' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_list_projects_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceListProjectsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.list_projects", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#list_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching projects. By default all projects of the instance that the caller has permission to read are returned. Make sure to include a limit and sorting for pagination. Required permission: - `project.read` + # @param beta_project_service_list_projects_request [BetaProjectServiceListProjectsRequest] + + # @return [BetaProjectServiceListProjectsResponse] + # @raise [ApiError] if fails to make API call + def list_projects(beta_project_service_list_projects_request) + if beta_project_service_list_projects_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_list_projects_request' when calling BetaProjectServiceApi.list_projects" + end + + result = list_projects_with_http_info(beta_project_service_list_projects_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_projects_with_http_info(beta_project_service_list_projects_request) + if beta_project_service_list_projects_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_list_projects_request' when calling BetaProjectServiceApi.list_projects" + end + + path = '/zitadel.project.v2beta.ProjectService/ListProjects' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_list_projects_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceListProjectsResponse', + nil + ) + end # Remove Project Role - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Removes the role from the project and on every resource it has a dependency. This includes project grants and user grants. Required permission: - `project.role.write` - # @param beta_project_service_remove_project_role_request [BetaProjectServiceRemoveProjectRoleRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceRemoveProjectRoleResponse] - def remove_project_role(beta_project_service_remove_project_role_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.remove_project_role ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_remove_project_role_request' is set - if @api_client.config.client_side_validation && beta_project_service_remove_project_role_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_remove_project_role_request' when calling Api::BetaProjectServiceApi.remove_project_role" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/RemoveProjectRole' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_remove_project_role_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceRemoveProjectRoleResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.remove_project_role", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#remove_project_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Removes the role from the project and on every resource it has a dependency. This includes project grants and user grants. Required permission: - `project.role.write` + # @param beta_project_service_remove_project_role_request [BetaProjectServiceRemoveProjectRoleRequest] + + # @return [BetaProjectServiceRemoveProjectRoleResponse] + # @raise [ApiError] if fails to make API call + def remove_project_role(beta_project_service_remove_project_role_request) + if beta_project_service_remove_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_remove_project_role_request' when calling BetaProjectServiceApi.remove_project_role" + end + + result = remove_project_role_with_http_info(beta_project_service_remove_project_role_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_project_role_with_http_info(beta_project_service_remove_project_role_request) + if beta_project_service_remove_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_remove_project_role_request' when calling BetaProjectServiceApi.remove_project_role" + end + + path = '/zitadel.project.v2beta.ProjectService/RemoveProjectRole' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_remove_project_role_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceRemoveProjectRoleResponse', + nil + ) + end # Update Project - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Update an existing project. Required permission: - `project.write` - # @param beta_project_service_update_project_request [BetaProjectServiceUpdateProjectRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceUpdateProjectResponse] - def update_project(beta_project_service_update_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.update_project ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_update_project_request' is set - if @api_client.config.client_side_validation && beta_project_service_update_project_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_update_project_request' when calling Api::BetaProjectServiceApi.update_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/UpdateProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_update_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceUpdateProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.update_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Update an existing project. Required permission: - `project.write` + # @param beta_project_service_update_project_request [BetaProjectServiceUpdateProjectRequest] + + # @return [BetaProjectServiceUpdateProjectResponse] + # @raise [ApiError] if fails to make API call + def update_project(beta_project_service_update_project_request) + if beta_project_service_update_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_update_project_request' when calling BetaProjectServiceApi.update_project" + end + + result = update_project_with_http_info(beta_project_service_update_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_project_with_http_info(beta_project_service_update_project_request) + if beta_project_service_update_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_update_project_request' when calling BetaProjectServiceApi.update_project" + end + + path = '/zitadel.project.v2beta.ProjectService/UpdateProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_update_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceUpdateProjectResponse', + nil + ) + end # Update Project Grant - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Change the roles of the project that is granted to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.write` - # @param beta_project_service_update_project_grant_request [BetaProjectServiceUpdateProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceUpdateProjectGrantResponse] - def update_project_grant(beta_project_service_update_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.update_project_grant ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_update_project_grant_request' is set - if @api_client.config.client_side_validation && beta_project_service_update_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_update_project_grant_request' when calling Api::BetaProjectServiceApi.update_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/UpdateProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_update_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceUpdateProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.update_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#update_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Change the roles of the project that is granted to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.write` + # @param beta_project_service_update_project_grant_request [BetaProjectServiceUpdateProjectGrantRequest] + + # @return [BetaProjectServiceUpdateProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def update_project_grant(beta_project_service_update_project_grant_request) + if beta_project_service_update_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_update_project_grant_request' when calling BetaProjectServiceApi.update_project_grant" + end + + result = update_project_grant_with_http_info(beta_project_service_update_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_project_grant_with_http_info(beta_project_service_update_project_grant_request) + if beta_project_service_update_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_update_project_grant_request' when calling BetaProjectServiceApi.update_project_grant" + end + + path = '/zitadel.project.v2beta.ProjectService/UpdateProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_update_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceUpdateProjectGrantResponse', + nil + ) + end # Update Project Role - # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Change a project role. The key is not editable. If a key should change, remove the role and create a new one. Required permission: - `project.role.write` - # @param beta_project_service_update_project_role_request [BetaProjectServiceUpdateProjectRoleRequest] - # @param [Hash] opts the optional parameters - # @return [BetaProjectServiceUpdateProjectRoleResponse] - def update_project_role(beta_project_service_update_project_role_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaProjectServiceApi.update_project_role ...' # MODIFIED - end - # verify the required parameter 'beta_project_service_update_project_role_request' is set - if @api_client.config.client_side_validation && beta_project_service_update_project_role_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_project_service_update_project_role_request' when calling Api::BetaProjectServiceApi.update_project_role" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2beta.ProjectService/UpdateProjectRole' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_project_service_update_project_role_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaProjectServiceUpdateProjectRoleResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaProjectServiceApi.update_project_role", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaProjectServiceApi#update_project_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Change a project role. The key is not editable. If a key should change, remove the role and create a new one. Required permission: - `project.role.write` + # @param beta_project_service_update_project_role_request [BetaProjectServiceUpdateProjectRoleRequest] + + # @return [BetaProjectServiceUpdateProjectRoleResponse] + # @raise [ApiError] if fails to make API call + def update_project_role(beta_project_service_update_project_role_request) + if beta_project_service_update_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_update_project_role_request' when calling BetaProjectServiceApi.update_project_role" + end + + result = update_project_role_with_http_info(beta_project_service_update_project_role_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_project_role_with_http_info(beta_project_service_update_project_role_request) + if beta_project_service_update_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_project_service_update_project_role_request' when calling BetaProjectServiceApi.update_project_role" + end + + path = '/zitadel.project.v2beta.ProjectService/UpdateProjectRole' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_project_service_update_project_role_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaProjectServiceUpdateProjectRoleResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_session_service_api.rb b/lib/zitadel/client/api/beta_session_service_api.rb index 8ee132fe..44a1df72 100644 --- a/lib/zitadel/client/api/beta_session_service_api.rb +++ b/lib/zitadel/client/api/beta_session_service_api.rb @@ -1,312 +1,287 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaSessionServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaSessionServiceApi provides methods for the BetaSessionService API group. + class BetaSessionServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Create a new session # Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_session_service_create_session_request [BetaSessionServiceCreateSessionRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSessionServiceCreateSessionResponse] - def create_session(beta_session_service_create_session_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.create_session ...' # MODIFIED - end - # verify the required parameter 'beta_session_service_create_session_request' is set - if @api_client.config.client_side_validation && beta_session_service_create_session_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_session_service_create_session_request' when calling Api::BetaSessionServiceApi.create_session" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2beta.SessionService/CreateSession' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_session_service_create_session_request [BetaSessionServiceCreateSessionRequest] + + # @return [BetaSessionServiceCreateSessionResponse] + # @raise [ApiError] if fails to make API call + def create_session(beta_session_service_create_session_request) + if beta_session_service_create_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_create_session_request' when calling BetaSessionServiceApi.create_session" + end + + result = create_session_with_http_info(beta_session_service_create_session_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_session_service_create_session_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSessionServiceCreateSessionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSessionServiceApi.create_session", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSessionServiceApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_session_with_http_info(beta_session_service_create_session_request) + if beta_session_service_create_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_create_session_request' when calling BetaSessionServiceApi.create_session" + end + + path = '/zitadel.session.v2beta.SessionService/CreateSession' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_session_service_create_session_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSessionServiceCreateSessionResponse', + nil + ) + end # Terminate a session # Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_session_service_delete_session_request [BetaSessionServiceDeleteSessionRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSessionServiceDeleteSessionResponse] - def delete_session(beta_session_service_delete_session_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.delete_session ...' # MODIFIED - end - # verify the required parameter 'beta_session_service_delete_session_request' is set - if @api_client.config.client_side_validation && beta_session_service_delete_session_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_session_service_delete_session_request' when calling Api::BetaSessionServiceApi.delete_session" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2beta.SessionService/DeleteSession' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_session_service_delete_session_request [BetaSessionServiceDeleteSessionRequest] + + # @return [BetaSessionServiceDeleteSessionResponse] + # @raise [ApiError] if fails to make API call + def delete_session(beta_session_service_delete_session_request) + if beta_session_service_delete_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_delete_session_request' when calling BetaSessionServiceApi.delete_session" + end + + result = delete_session_with_http_info(beta_session_service_delete_session_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_session_service_delete_session_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSessionServiceDeleteSessionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSessionServiceApi.delete_session", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSessionServiceApi#delete_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_session_with_http_info(beta_session_service_delete_session_request) + if beta_session_service_delete_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_delete_session_request' when calling BetaSessionServiceApi.delete_session" + end + + path = '/zitadel.session.v2beta.SessionService/DeleteSession' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_session_service_delete_session_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSessionServiceDeleteSessionResponse', + nil + ) + end # GetSession a session # Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_session_service_get_session_request [BetaSessionServiceGetSessionRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSessionServiceGetSessionResponse] - def get_session(beta_session_service_get_session_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.get_session ...' # MODIFIED - end - # verify the required parameter 'beta_session_service_get_session_request' is set - if @api_client.config.client_side_validation && beta_session_service_get_session_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_session_service_get_session_request' when calling Api::BetaSessionServiceApi.get_session" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2beta.SessionService/GetSession' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_session_service_get_session_request [BetaSessionServiceGetSessionRequest] + + # @return [BetaSessionServiceGetSessionResponse] + # @raise [ApiError] if fails to make API call + def get_session(beta_session_service_get_session_request) + if beta_session_service_get_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_get_session_request' when calling BetaSessionServiceApi.get_session" + end + + result = get_session_with_http_info(beta_session_service_get_session_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_session_service_get_session_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSessionServiceGetSessionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSessionServiceApi.get_session", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSessionServiceApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_session_with_http_info(beta_session_service_get_session_request) + if beta_session_service_get_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_get_session_request' when calling BetaSessionServiceApi.get_session" + end + + path = '/zitadel.session.v2beta.SessionService/GetSession' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_session_service_get_session_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSessionServiceGetSessionResponse', + nil + ) + end # Search sessions # Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_session_service_list_sessions_request [BetaSessionServiceListSessionsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSessionServiceListSessionsResponse] - def list_sessions(beta_session_service_list_sessions_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.list_sessions ...' # MODIFIED - end - # verify the required parameter 'beta_session_service_list_sessions_request' is set - if @api_client.config.client_side_validation && beta_session_service_list_sessions_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_session_service_list_sessions_request' when calling Api::BetaSessionServiceApi.list_sessions" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2beta.SessionService/ListSessions' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_session_service_list_sessions_request [BetaSessionServiceListSessionsRequest] + + # @return [BetaSessionServiceListSessionsResponse] + # @raise [ApiError] if fails to make API call + def list_sessions(beta_session_service_list_sessions_request) + if beta_session_service_list_sessions_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_list_sessions_request' when calling BetaSessionServiceApi.list_sessions" + end + + result = list_sessions_with_http_info(beta_session_service_list_sessions_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_session_service_list_sessions_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSessionServiceListSessionsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSessionServiceApi.list_sessions", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSessionServiceApi#list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_sessions_with_http_info(beta_session_service_list_sessions_request) + if beta_session_service_list_sessions_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_list_sessions_request' when calling BetaSessionServiceApi.list_sessions" + end + + path = '/zitadel.session.v2beta.SessionService/ListSessions' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_session_service_list_sessions_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSessionServiceListSessionsResponse', + nil + ) + end # Update a session # Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_session_service_set_session_request [BetaSessionServiceSetSessionRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSessionServiceSetSessionResponse] - def set_session(beta_session_service_set_session_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSessionServiceApi.set_session ...' # MODIFIED - end - # verify the required parameter 'beta_session_service_set_session_request' is set - if @api_client.config.client_side_validation && beta_session_service_set_session_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_session_service_set_session_request' when calling Api::BetaSessionServiceApi.set_session" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2beta.SessionService/SetSession' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_session_service_set_session_request [BetaSessionServiceSetSessionRequest] + + # @return [BetaSessionServiceSetSessionResponse] + # @raise [ApiError] if fails to make API call + def set_session(beta_session_service_set_session_request) + if beta_session_service_set_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_set_session_request' when calling BetaSessionServiceApi.set_session" + end + + result = set_session_with_http_info(beta_session_service_set_session_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_session_service_set_session_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSessionServiceSetSessionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSessionServiceApi.set_session", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSessionServiceApi#set_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_session_with_http_info(beta_session_service_set_session_request) + if beta_session_service_set_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_session_service_set_session_request' when calling BetaSessionServiceApi.set_session" + end + + path = '/zitadel.session.v2beta.SessionService/SetSession' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_session_service_set_session_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSessionServiceSetSessionResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_settings_service_api.rb b/lib/zitadel/client/api/beta_settings_service_api.rb index 90219c36..508dcf62 100644 --- a/lib/zitadel/client/api/beta_settings_service_api.rb +++ b/lib/zitadel/client/api/beta_settings_service_api.rb @@ -1,660 +1,605 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaSettingsServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaSettingsServiceApi provides methods for the BetaSettingsService API group. + class BetaSettingsServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Get the current active identity providers # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_settings_service_get_active_identity_providers_request [BetaSettingsServiceGetActiveIdentityProvidersRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetActiveIdentityProvidersResponse] - def get_active_identity_providers(beta_settings_service_get_active_identity_providers_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_active_identity_providers ...' # MODIFIED - end - # verify the required parameter 'beta_settings_service_get_active_identity_providers_request' is set - if @api_client.config.client_side_validation && beta_settings_service_get_active_identity_providers_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_active_identity_providers_request' when calling Api::BetaSettingsServiceApi.get_active_identity_providers" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetActiveIdentityProviders' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_settings_service_get_active_identity_providers_request [BetaSettingsServiceGetActiveIdentityProvidersRequest] + + # @return [BetaSettingsServiceGetActiveIdentityProvidersResponse] + # @raise [ApiError] if fails to make API call + def get_active_identity_providers(beta_settings_service_get_active_identity_providers_request) + if beta_settings_service_get_active_identity_providers_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_active_identity_providers_request' when calling BetaSettingsServiceApi.get_active_identity_providers" + end + + result = get_active_identity_providers_with_http_info(beta_settings_service_get_active_identity_providers_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_settings_service_get_active_identity_providers_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetActiveIdentityProvidersResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_active_identity_providers", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_active_identity_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_active_identity_providers_with_http_info(beta_settings_service_get_active_identity_providers_request) + if beta_settings_service_get_active_identity_providers_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_active_identity_providers_request' when calling BetaSettingsServiceApi.get_active_identity_providers" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetActiveIdentityProviders' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_settings_service_get_active_identity_providers_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetActiveIdentityProvidersResponse', + nil + ) + end # Get the current active branding settings # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_settings_service_get_branding_settings_request [BetaSettingsServiceGetBrandingSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetBrandingSettingsResponse] - def get_branding_settings(beta_settings_service_get_branding_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_branding_settings ...' # MODIFIED - end - # verify the required parameter 'beta_settings_service_get_branding_settings_request' is set - if @api_client.config.client_side_validation && beta_settings_service_get_branding_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_branding_settings_request' when calling Api::BetaSettingsServiceApi.get_branding_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetBrandingSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_settings_service_get_branding_settings_request [BetaSettingsServiceGetBrandingSettingsRequest] + + # @return [BetaSettingsServiceGetBrandingSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_branding_settings(beta_settings_service_get_branding_settings_request) + if beta_settings_service_get_branding_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_branding_settings_request' when calling BetaSettingsServiceApi.get_branding_settings" + end + + result = get_branding_settings_with_http_info(beta_settings_service_get_branding_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_settings_service_get_branding_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetBrandingSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_branding_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_branding_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_branding_settings_with_http_info(beta_settings_service_get_branding_settings_request) + if beta_settings_service_get_branding_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_branding_settings_request' when calling BetaSettingsServiceApi.get_branding_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetBrandingSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_settings_service_get_branding_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetBrandingSettingsResponse', + nil + ) + end # Get the domain settings # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_settings_service_get_domain_settings_request [BetaSettingsServiceGetDomainSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetDomainSettingsResponse] - def get_domain_settings(beta_settings_service_get_domain_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_domain_settings ...' # MODIFIED - end - # verify the required parameter 'beta_settings_service_get_domain_settings_request' is set - if @api_client.config.client_side_validation && beta_settings_service_get_domain_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_domain_settings_request' when calling Api::BetaSettingsServiceApi.get_domain_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetDomainSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_settings_service_get_domain_settings_request [BetaSettingsServiceGetDomainSettingsRequest] + + # @return [BetaSettingsServiceGetDomainSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_domain_settings(beta_settings_service_get_domain_settings_request) + if beta_settings_service_get_domain_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_domain_settings_request' when calling BetaSettingsServiceApi.get_domain_settings" + end + + result = get_domain_settings_with_http_info(beta_settings_service_get_domain_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_settings_service_get_domain_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetDomainSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_domain_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_domain_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_domain_settings_with_http_info(beta_settings_service_get_domain_settings_request) + if beta_settings_service_get_domain_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_domain_settings_request' when calling BetaSettingsServiceApi.get_domain_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetDomainSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_settings_service_get_domain_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetDomainSettingsResponse', + nil + ) + end # Get basic information over the instance # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetGeneralSettingsResponse] - def get_general_settings(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_general_settings ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaSettingsServiceApi.get_general_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetGeneralSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [BetaSettingsServiceGetGeneralSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_general_settings(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaSettingsServiceApi.get_general_settings" + end + + result = get_general_settings_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetGeneralSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_general_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_general_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_general_settings_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaSettingsServiceApi.get_general_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetGeneralSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetGeneralSettingsResponse', + nil + ) + end # Get the legal and support settings # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_settings_service_get_legal_and_support_settings_request [BetaSettingsServiceGetLegalAndSupportSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetLegalAndSupportSettingsResponse] - def get_legal_and_support_settings(beta_settings_service_get_legal_and_support_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_legal_and_support_settings ...' # MODIFIED - end - # verify the required parameter 'beta_settings_service_get_legal_and_support_settings_request' is set - if @api_client.config.client_side_validation && beta_settings_service_get_legal_and_support_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_legal_and_support_settings_request' when calling Api::BetaSettingsServiceApi.get_legal_and_support_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetLegalAndSupportSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_settings_service_get_legal_and_support_settings_request [BetaSettingsServiceGetLegalAndSupportSettingsRequest] + + # @return [BetaSettingsServiceGetLegalAndSupportSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_legal_and_support_settings(beta_settings_service_get_legal_and_support_settings_request) + if beta_settings_service_get_legal_and_support_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_legal_and_support_settings_request' when calling BetaSettingsServiceApi.get_legal_and_support_settings" + end + + result = get_legal_and_support_settings_with_http_info(beta_settings_service_get_legal_and_support_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_settings_service_get_legal_and_support_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetLegalAndSupportSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_legal_and_support_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_legal_and_support_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_legal_and_support_settings_with_http_info(beta_settings_service_get_legal_and_support_settings_request) + if beta_settings_service_get_legal_and_support_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_legal_and_support_settings_request' when calling BetaSettingsServiceApi.get_legal_and_support_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetLegalAndSupportSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_settings_service_get_legal_and_support_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetLegalAndSupportSettingsResponse', + nil + ) + end # Get the lockout settings # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_settings_service_get_lockout_settings_request [BetaSettingsServiceGetLockoutSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetLockoutSettingsResponse] - def get_lockout_settings(beta_settings_service_get_lockout_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_lockout_settings ...' # MODIFIED - end - # verify the required parameter 'beta_settings_service_get_lockout_settings_request' is set - if @api_client.config.client_side_validation && beta_settings_service_get_lockout_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_lockout_settings_request' when calling Api::BetaSettingsServiceApi.get_lockout_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetLockoutSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_settings_service_get_lockout_settings_request [BetaSettingsServiceGetLockoutSettingsRequest] + + # @return [BetaSettingsServiceGetLockoutSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_lockout_settings(beta_settings_service_get_lockout_settings_request) + if beta_settings_service_get_lockout_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_lockout_settings_request' when calling BetaSettingsServiceApi.get_lockout_settings" + end + + result = get_lockout_settings_with_http_info(beta_settings_service_get_lockout_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_settings_service_get_lockout_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetLockoutSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_lockout_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_lockout_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_lockout_settings_with_http_info(beta_settings_service_get_lockout_settings_request) + if beta_settings_service_get_lockout_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_lockout_settings_request' when calling BetaSettingsServiceApi.get_lockout_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetLockoutSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_settings_service_get_lockout_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetLockoutSettingsResponse', + nil + ) + end # Get the login settings # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_settings_service_get_login_settings_request [BetaSettingsServiceGetLoginSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetLoginSettingsResponse] - def get_login_settings(beta_settings_service_get_login_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_login_settings ...' # MODIFIED - end - # verify the required parameter 'beta_settings_service_get_login_settings_request' is set - if @api_client.config.client_side_validation && beta_settings_service_get_login_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_login_settings_request' when calling Api::BetaSettingsServiceApi.get_login_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetLoginSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_settings_service_get_login_settings_request [BetaSettingsServiceGetLoginSettingsRequest] + + # @return [BetaSettingsServiceGetLoginSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_login_settings(beta_settings_service_get_login_settings_request) + if beta_settings_service_get_login_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_login_settings_request' when calling BetaSettingsServiceApi.get_login_settings" + end + + result = get_login_settings_with_http_info(beta_settings_service_get_login_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_settings_service_get_login_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetLoginSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_login_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_login_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_login_settings_with_http_info(beta_settings_service_get_login_settings_request) + if beta_settings_service_get_login_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_login_settings_request' when calling BetaSettingsServiceApi.get_login_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetLoginSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_settings_service_get_login_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetLoginSettingsResponse', + nil + ) + end # Get the password complexity settings # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_settings_service_get_password_complexity_settings_request [BetaSettingsServiceGetPasswordComplexitySettingsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetPasswordComplexitySettingsResponse] - def get_password_complexity_settings(beta_settings_service_get_password_complexity_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_password_complexity_settings ...' # MODIFIED - end - # verify the required parameter 'beta_settings_service_get_password_complexity_settings_request' is set - if @api_client.config.client_side_validation && beta_settings_service_get_password_complexity_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_password_complexity_settings_request' when calling Api::BetaSettingsServiceApi.get_password_complexity_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetPasswordComplexitySettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_settings_service_get_password_complexity_settings_request [BetaSettingsServiceGetPasswordComplexitySettingsRequest] + + # @return [BetaSettingsServiceGetPasswordComplexitySettingsResponse] + # @raise [ApiError] if fails to make API call + def get_password_complexity_settings(beta_settings_service_get_password_complexity_settings_request) + if beta_settings_service_get_password_complexity_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_password_complexity_settings_request' when calling BetaSettingsServiceApi.get_password_complexity_settings" + end + + result = get_password_complexity_settings_with_http_info(beta_settings_service_get_password_complexity_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_settings_service_get_password_complexity_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetPasswordComplexitySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_password_complexity_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_password_complexity_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_password_complexity_settings_with_http_info(beta_settings_service_get_password_complexity_settings_request) + if beta_settings_service_get_password_complexity_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_password_complexity_settings_request' when calling BetaSettingsServiceApi.get_password_complexity_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetPasswordComplexitySettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_settings_service_get_password_complexity_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetPasswordComplexitySettingsResponse', + nil + ) + end # Get the password expiry settings # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_settings_service_get_password_expiry_settings_request [BetaSettingsServiceGetPasswordExpirySettingsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetPasswordExpirySettingsResponse] - def get_password_expiry_settings(beta_settings_service_get_password_expiry_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_password_expiry_settings ...' # MODIFIED - end - # verify the required parameter 'beta_settings_service_get_password_expiry_settings_request' is set - if @api_client.config.client_side_validation && beta_settings_service_get_password_expiry_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_settings_service_get_password_expiry_settings_request' when calling Api::BetaSettingsServiceApi.get_password_expiry_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetPasswordExpirySettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_settings_service_get_password_expiry_settings_request [BetaSettingsServiceGetPasswordExpirySettingsRequest] + + # @return [BetaSettingsServiceGetPasswordExpirySettingsResponse] + # @raise [ApiError] if fails to make API call + def get_password_expiry_settings(beta_settings_service_get_password_expiry_settings_request) + if beta_settings_service_get_password_expiry_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_password_expiry_settings_request' when calling BetaSettingsServiceApi.get_password_expiry_settings" + end + + result = get_password_expiry_settings_with_http_info(beta_settings_service_get_password_expiry_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_settings_service_get_password_expiry_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetPasswordExpirySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_password_expiry_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_password_expiry_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_password_expiry_settings_with_http_info(beta_settings_service_get_password_expiry_settings_request) + if beta_settings_service_get_password_expiry_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_get_password_expiry_settings_request' when calling BetaSettingsServiceApi.get_password_expiry_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetPasswordExpirySettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_settings_service_get_password_expiry_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetPasswordExpirySettingsResponse', + nil + ) + end # Get the security settings # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceGetSecuritySettingsResponse] - def get_security_settings(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.get_security_settings ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaSettingsServiceApi.get_security_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/GetSecuritySettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [BetaSettingsServiceGetSecuritySettingsResponse] + # @raise [ApiError] if fails to make API call + def get_security_settings(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaSettingsServiceApi.get_security_settings" + end + + result = get_security_settings_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceGetSecuritySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.get_security_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#get_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_security_settings_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaSettingsServiceApi.get_security_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/GetSecuritySettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceGetSecuritySettingsResponse', + nil + ) + end # Set the security settings # Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - # @param beta_settings_service_set_security_settings_request [BetaSettingsServiceSetSecuritySettingsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaSettingsServiceSetSecuritySettingsResponse] - def set_security_settings(beta_settings_service_set_security_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaSettingsServiceApi.set_security_settings ...' # MODIFIED - end - # verify the required parameter 'beta_settings_service_set_security_settings_request' is set - if @api_client.config.client_side_validation && beta_settings_service_set_security_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_settings_service_set_security_settings_request' when calling Api::BetaSettingsServiceApi.set_security_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2beta.SettingsService/SetSecuritySettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_settings_service_set_security_settings_request [BetaSettingsServiceSetSecuritySettingsRequest] + + # @return [BetaSettingsServiceSetSecuritySettingsResponse] + # @raise [ApiError] if fails to make API call + def set_security_settings(beta_settings_service_set_security_settings_request) + if beta_settings_service_set_security_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_set_security_settings_request' when calling BetaSettingsServiceApi.set_security_settings" + end + + result = set_security_settings_with_http_info(beta_settings_service_set_security_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_settings_service_set_security_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaSettingsServiceSetSecuritySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaSettingsServiceApi.set_security_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaSettingsServiceApi#set_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_security_settings_with_http_info(beta_settings_service_set_security_settings_request) + if beta_settings_service_set_security_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_settings_service_set_security_settings_request' when calling BetaSettingsServiceApi.set_security_settings" + end + + path = '/zitadel.settings.v2beta.SettingsService/SetSecuritySettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_settings_service_set_security_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaSettingsServiceSetSecuritySettingsResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_telemetry_service_api.rb b/lib/zitadel/client/api/beta_telemetry_service_api.rb index b3e01051..d9add806 100644 --- a/lib/zitadel/client/api/beta_telemetry_service_api.rb +++ b/lib/zitadel/client/api/beta_telemetry_service_api.rb @@ -1,138 +1,128 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaTelemetryServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaTelemetryServiceApi provides methods for the BetaTelemetryService API group. + class BetaTelemetryServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # ReportBaseInformation is used to report the base information of the ZITADEL system, including the version, instances, their creation date and domains. The response contains a report ID to link it to the resource counts or other reports. The report ID is only valid for the same system ID. # ReportBaseInformation is used to report the base information of the ZITADEL system, including the version, instances, their creation date and domains. The response contains a report ID to link it to the resource counts or other reports. The report ID is only valid for the same system ID. - # @param beta_telemetry_service_report_base_information_request [BetaTelemetryServiceReportBaseInformationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaTelemetryServiceReportBaseInformationResponse] - def report_base_information(beta_telemetry_service_report_base_information_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaTelemetryServiceApi.report_base_information ...' # MODIFIED - end - # verify the required parameter 'beta_telemetry_service_report_base_information_request' is set - if @api_client.config.client_side_validation && beta_telemetry_service_report_base_information_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_telemetry_service_report_base_information_request' when calling Api::BetaTelemetryServiceApi.report_base_information" # MODIFIED - end - # resource path - local_var_path = '/zitadel.analytics.v2beta.TelemetryService/ReportBaseInformation' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_telemetry_service_report_base_information_request [BetaTelemetryServiceReportBaseInformationRequest] + + # @return [BetaTelemetryServiceReportBaseInformationResponse] + # @raise [ApiError] if fails to make API call + def report_base_information(beta_telemetry_service_report_base_information_request) + if beta_telemetry_service_report_base_information_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_telemetry_service_report_base_information_request' when calling BetaTelemetryServiceApi.report_base_information" + end + + result = report_base_information_with_http_info(beta_telemetry_service_report_base_information_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_telemetry_service_report_base_information_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaTelemetryServiceReportBaseInformationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaTelemetryServiceApi.report_base_information", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaTelemetryServiceApi#report_base_information\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def report_base_information_with_http_info(beta_telemetry_service_report_base_information_request) + if beta_telemetry_service_report_base_information_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_telemetry_service_report_base_information_request' when calling BetaTelemetryServiceApi.report_base_information" + end + + path = '/zitadel.analytics.v2beta.TelemetryService/ReportBaseInformation' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_telemetry_service_report_base_information_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaTelemetryServiceReportBaseInformationResponse', + nil + ) + end # ReportResourceCounts is used to report the resource counts such as amount of organizations or users per organization and much more. Since the resource counts can be reported in multiple batches, the response contains a report ID to continue reporting. The report ID is only valid for the same system ID. # ReportResourceCounts is used to report the resource counts such as amount of organizations or users per organization and much more. Since the resource counts can be reported in multiple batches, the response contains a report ID to continue reporting. The report ID is only valid for the same system ID. - # @param beta_telemetry_service_report_resource_counts_request [BetaTelemetryServiceReportResourceCountsRequest] - # @param [Hash] opts the optional parameters - # @return [BetaTelemetryServiceReportResourceCountsResponse] - def report_resource_counts(beta_telemetry_service_report_resource_counts_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaTelemetryServiceApi.report_resource_counts ...' # MODIFIED - end - # verify the required parameter 'beta_telemetry_service_report_resource_counts_request' is set - if @api_client.config.client_side_validation && beta_telemetry_service_report_resource_counts_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_telemetry_service_report_resource_counts_request' when calling Api::BetaTelemetryServiceApi.report_resource_counts" # MODIFIED - end - # resource path - local_var_path = '/zitadel.analytics.v2beta.TelemetryService/ReportResourceCounts' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param beta_telemetry_service_report_resource_counts_request [BetaTelemetryServiceReportResourceCountsRequest] + + # @return [BetaTelemetryServiceReportResourceCountsResponse] + # @raise [ApiError] if fails to make API call + def report_resource_counts(beta_telemetry_service_report_resource_counts_request) + if beta_telemetry_service_report_resource_counts_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_telemetry_service_report_resource_counts_request' when calling BetaTelemetryServiceApi.report_resource_counts" + end + + result = report_resource_counts_with_http_info(beta_telemetry_service_report_resource_counts_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_telemetry_service_report_resource_counts_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaTelemetryServiceReportResourceCountsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaTelemetryServiceApi.report_resource_counts", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaTelemetryServiceApi#report_resource_counts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def report_resource_counts_with_http_info(beta_telemetry_service_report_resource_counts_request) + if beta_telemetry_service_report_resource_counts_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_telemetry_service_report_resource_counts_request' when calling BetaTelemetryServiceApi.report_resource_counts" + end + + path = '/zitadel.analytics.v2beta.TelemetryService/ReportResourceCounts' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_telemetry_service_report_resource_counts_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaTelemetryServiceReportResourceCountsResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_user_service_api.rb b/lib/zitadel/client/api/beta_user_service_api.rb index 1c02079a..6ece4936 100644 --- a/lib/zitadel/client/api/beta_user_service_api.rb +++ b/lib/zitadel/client/api/beta_user_service_api.rb @@ -1,1994 +1,1824 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaUserServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaUserServiceApi provides methods for the BetaUserService API group. + class BetaUserServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Create a new human user # Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. Deprecated: please move to the corresponding endpoint under user service v2 (GA) - # @param beta_user_service_add_human_user_request [BetaUserServiceAddHumanUserRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceAddHumanUserResponse] - def add_human_user(beta_user_service_add_human_user_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.add_human_user ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_add_human_user_request' is set - if @api_client.config.client_side_validation && beta_user_service_add_human_user_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_add_human_user_request' when calling Api::BetaUserServiceApi.add_human_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/AddHumanUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_add_human_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceAddHumanUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.add_human_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#add_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_add_human_user_request [BetaUserServiceAddHumanUserRequest] + + # @return [BetaUserServiceAddHumanUserResponse] + # @raise [ApiError] if fails to make API call + def add_human_user(beta_user_service_add_human_user_request) + if beta_user_service_add_human_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_add_human_user_request' when calling BetaUserServiceApi.add_human_user" + end + + result = add_human_user_with_http_info(beta_user_service_add_human_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_human_user_with_http_info(beta_user_service_add_human_user_request) + if beta_user_service_add_human_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_add_human_user_request' when calling BetaUserServiceApi.add_human_user" + end + + path = '/zitadel.user.v2beta.UserService/AddHumanUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_add_human_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceAddHumanUserResponse', + nil + ) + end # Add link to an identity provider to an user # Add link to an identity provider to an user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_add_idp_link_request [BetaUserServiceAddIDPLinkRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceAddIDPLinkResponse] - def add_idp_link(beta_user_service_add_idp_link_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.add_idp_link ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_add_idp_link_request' is set - if @api_client.config.client_side_validation && beta_user_service_add_idp_link_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_add_idp_link_request' when calling Api::BetaUserServiceApi.add_idp_link" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/AddIDPLink' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_add_idp_link_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceAddIDPLinkResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.add_idp_link", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#add_idp_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_add_idp_link_request [BetaUserServiceAddIDPLinkRequest] + + # @return [BetaUserServiceAddIDPLinkResponse] + # @raise [ApiError] if fails to make API call + def add_idp_link(beta_user_service_add_idp_link_request) + if beta_user_service_add_idp_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_add_idp_link_request' when calling BetaUserServiceApi.add_idp_link" + end + + result = add_idp_link_with_http_info(beta_user_service_add_idp_link_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_idp_link_with_http_info(beta_user_service_add_idp_link_request) + if beta_user_service_add_idp_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_add_idp_link_request' when calling BetaUserServiceApi.add_idp_link" + end + + path = '/zitadel.user.v2beta.UserService/AddIDPLink' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_add_idp_link_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceAddIDPLinkResponse', + nil + ) + end # Add OTP Email for a user # Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_add_otp_email_request [BetaUserServiceAddOTPEmailRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceAddOTPEmailResponse] - def add_otp_email(beta_user_service_add_otp_email_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.add_otp_email ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_add_otp_email_request' is set - if @api_client.config.client_side_validation && beta_user_service_add_otp_email_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_add_otp_email_request' when calling Api::BetaUserServiceApi.add_otp_email" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/AddOTPEmail' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_add_otp_email_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceAddOTPEmailResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.add_otp_email", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#add_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_add_otp_email_request [BetaUserServiceAddOTPEmailRequest] + + # @return [BetaUserServiceAddOTPEmailResponse] + # @raise [ApiError] if fails to make API call + def add_otp_email(beta_user_service_add_otp_email_request) + if beta_user_service_add_otp_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_add_otp_email_request' when calling BetaUserServiceApi.add_otp_email" + end + + result = add_otp_email_with_http_info(beta_user_service_add_otp_email_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_otp_email_with_http_info(beta_user_service_add_otp_email_request) + if beta_user_service_add_otp_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_add_otp_email_request' when calling BetaUserServiceApi.add_otp_email" + end + + path = '/zitadel.user.v2beta.UserService/AddOTPEmail' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_add_otp_email_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceAddOTPEmailResponse', + nil + ) + end # Add OTP SMS for a user # Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_add_otpsms_request [BetaUserServiceAddOTPSMSRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceAddOTPSMSResponse] - def add_otpsms(beta_user_service_add_otpsms_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.add_otpsms ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_add_otpsms_request' is set - if @api_client.config.client_side_validation && beta_user_service_add_otpsms_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_add_otpsms_request' when calling Api::BetaUserServiceApi.add_otpsms" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/AddOTPSMS' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_add_otpsms_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceAddOTPSMSResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.add_otpsms", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#add_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_add_otpsms_request [BetaUserServiceAddOTPSMSRequest] + + # @return [BetaUserServiceAddOTPSMSResponse] + # @raise [ApiError] if fails to make API call + def add_otpsms(beta_user_service_add_otpsms_request) + if beta_user_service_add_otpsms_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_add_otpsms_request' when calling BetaUserServiceApi.add_otpsms" + end + + result = add_otpsms_with_http_info(beta_user_service_add_otpsms_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_otpsms_with_http_info(beta_user_service_add_otpsms_request) + if beta_user_service_add_otpsms_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_add_otpsms_request' when calling BetaUserServiceApi.add_otpsms" + end + + path = '/zitadel.user.v2beta.UserService/AddOTPSMS' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_add_otpsms_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceAddOTPSMSResponse', + nil + ) + end # Create a passkey registration link for a user # Create a passkey registration link which includes a code and either return it or send it to the user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_create_passkey_registration_link_request [BetaUserServiceCreatePasskeyRegistrationLinkRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceCreatePasskeyRegistrationLinkResponse] - def create_passkey_registration_link(beta_user_service_create_passkey_registration_link_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.create_passkey_registration_link ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_create_passkey_registration_link_request' is set - if @api_client.config.client_side_validation && beta_user_service_create_passkey_registration_link_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_create_passkey_registration_link_request' when calling Api::BetaUserServiceApi.create_passkey_registration_link" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/CreatePasskeyRegistrationLink' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_create_passkey_registration_link_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceCreatePasskeyRegistrationLinkResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.create_passkey_registration_link", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#create_passkey_registration_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_create_passkey_registration_link_request [BetaUserServiceCreatePasskeyRegistrationLinkRequest] + + # @return [BetaUserServiceCreatePasskeyRegistrationLinkResponse] + # @raise [ApiError] if fails to make API call + def create_passkey_registration_link(beta_user_service_create_passkey_registration_link_request) + if beta_user_service_create_passkey_registration_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_create_passkey_registration_link_request' when calling BetaUserServiceApi.create_passkey_registration_link" + end + + result = create_passkey_registration_link_with_http_info(beta_user_service_create_passkey_registration_link_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_passkey_registration_link_with_http_info(beta_user_service_create_passkey_registration_link_request) + if beta_user_service_create_passkey_registration_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_create_passkey_registration_link_request' when calling BetaUserServiceApi.create_passkey_registration_link" + end + + path = '/zitadel.user.v2beta.UserService/CreatePasskeyRegistrationLink' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_create_passkey_registration_link_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceCreatePasskeyRegistrationLinkResponse', + nil + ) + end # Deactivate user - # The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_deactivate_user_request [BetaUserServiceDeactivateUserRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceDeactivateUserResponse] - def deactivate_user(beta_user_service_deactivate_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.deactivate_user ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_deactivate_user_request' is set - if @api_client.config.client_side_validation && beta_user_service_deactivate_user_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_deactivate_user_request' when calling Api::BetaUserServiceApi.deactivate_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/DeactivateUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_deactivate_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceDeactivateUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.deactivate_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#deactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_deactivate_user_request [BetaUserServiceDeactivateUserRequest] + + # @return [BetaUserServiceDeactivateUserResponse] + # @raise [ApiError] if fails to make API call + def deactivate_user(beta_user_service_deactivate_user_request) + if beta_user_service_deactivate_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_deactivate_user_request' when calling BetaUserServiceApi.deactivate_user" + end + + result = deactivate_user_with_http_info(beta_user_service_deactivate_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_user_with_http_info(beta_user_service_deactivate_user_request) + if beta_user_service_deactivate_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_deactivate_user_request' when calling BetaUserServiceApi.deactivate_user" + end + + path = '/zitadel.user.v2beta.UserService/DeactivateUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_deactivate_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceDeactivateUserResponse', + nil + ) + end # Delete user - # The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_delete_user_request [BetaUserServiceDeleteUserRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceDeleteUserResponse] - def delete_user(beta_user_service_delete_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.delete_user ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_delete_user_request' is set - if @api_client.config.client_side_validation && beta_user_service_delete_user_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_delete_user_request' when calling Api::BetaUserServiceApi.delete_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/DeleteUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_delete_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceDeleteUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.delete_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_delete_user_request [BetaUserServiceDeleteUserRequest] + + # @return [BetaUserServiceDeleteUserResponse] + # @raise [ApiError] if fails to make API call + def delete_user(beta_user_service_delete_user_request) + if beta_user_service_delete_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_delete_user_request' when calling BetaUserServiceApi.delete_user" + end + + result = delete_user_with_http_info(beta_user_service_delete_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_user_with_http_info(beta_user_service_delete_user_request) + if beta_user_service_delete_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_delete_user_request' when calling BetaUserServiceApi.delete_user" + end + + path = '/zitadel.user.v2beta.UserService/DeleteUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_delete_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceDeleteUserResponse', + nil + ) + end # User by ID # Returns the full user object (human or machine) including the profile, email, etc. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_get_user_by_id_request [BetaUserServiceGetUserByIDRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceGetUserByIDResponse] - def get_user_by_id(beta_user_service_get_user_by_id_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.get_user_by_id ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_get_user_by_id_request' is set - if @api_client.config.client_side_validation && beta_user_service_get_user_by_id_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_get_user_by_id_request' when calling Api::BetaUserServiceApi.get_user_by_id" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/GetUserByID' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_get_user_by_id_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceGetUserByIDResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.get_user_by_id", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#get_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_get_user_by_id_request [BetaUserServiceGetUserByIDRequest] + + # @return [BetaUserServiceGetUserByIDResponse] + # @raise [ApiError] if fails to make API call + def get_user_by_id(beta_user_service_get_user_by_id_request) + if beta_user_service_get_user_by_id_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_get_user_by_id_request' when calling BetaUserServiceApi.get_user_by_id" + end + + result = get_user_by_id_with_http_info(beta_user_service_get_user_by_id_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_user_by_id_with_http_info(beta_user_service_get_user_by_id_request) + if beta_user_service_get_user_by_id_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_get_user_by_id_request' when calling BetaUserServiceApi.get_user_by_id" + end + + path = '/zitadel.user.v2beta.UserService/GetUserByID' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_get_user_by_id_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceGetUserByIDResponse', + nil + ) + end # List all possible authentication methods of a user # List all possible authentication methods of a user like password, passwordless, (T)OTP and more. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_list_authentication_method_types_request [BetaUserServiceListAuthenticationMethodTypesRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceListAuthenticationMethodTypesResponse] - def list_authentication_method_types(beta_user_service_list_authentication_method_types_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.list_authentication_method_types ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_list_authentication_method_types_request' is set - if @api_client.config.client_side_validation && beta_user_service_list_authentication_method_types_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_list_authentication_method_types_request' when calling Api::BetaUserServiceApi.list_authentication_method_types" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/ListAuthenticationMethodTypes' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_list_authentication_method_types_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceListAuthenticationMethodTypesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.list_authentication_method_types", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#list_authentication_method_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_list_authentication_method_types_request [BetaUserServiceListAuthenticationMethodTypesRequest] + + # @return [BetaUserServiceListAuthenticationMethodTypesResponse] + # @raise [ApiError] if fails to make API call + def list_authentication_method_types(beta_user_service_list_authentication_method_types_request) + if beta_user_service_list_authentication_method_types_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_list_authentication_method_types_request' when calling BetaUserServiceApi.list_authentication_method_types" + end + + result = list_authentication_method_types_with_http_info(beta_user_service_list_authentication_method_types_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_authentication_method_types_with_http_info(beta_user_service_list_authentication_method_types_request) + if beta_user_service_list_authentication_method_types_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_list_authentication_method_types_request' when calling BetaUserServiceApi.list_authentication_method_types" + end + + path = '/zitadel.user.v2beta.UserService/ListAuthenticationMethodTypes' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_list_authentication_method_types_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceListAuthenticationMethodTypesResponse', + nil + ) + end # Search Users # Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_list_users_request [BetaUserServiceListUsersRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceListUsersResponse] - def list_users(beta_user_service_list_users_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.list_users ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_list_users_request' is set - if @api_client.config.client_side_validation && beta_user_service_list_users_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_list_users_request' when calling Api::BetaUserServiceApi.list_users" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/ListUsers' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_list_users_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceListUsersResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.list_users", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_list_users_request [BetaUserServiceListUsersRequest] + + # @return [BetaUserServiceListUsersResponse] + # @raise [ApiError] if fails to make API call + def list_users(beta_user_service_list_users_request) + if beta_user_service_list_users_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_list_users_request' when calling BetaUserServiceApi.list_users" + end + + result = list_users_with_http_info(beta_user_service_list_users_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_users_with_http_info(beta_user_service_list_users_request) + if beta_user_service_list_users_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_list_users_request' when calling BetaUserServiceApi.list_users" + end + + path = '/zitadel.user.v2beta.UserService/ListUsers' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_list_users_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceListUsersResponse', + nil + ) + end # Lock user - # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_lock_user_request [BetaUserServiceLockUserRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceLockUserResponse] - def lock_user(beta_user_service_lock_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.lock_user ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_lock_user_request' is set - if @api_client.config.client_side_validation && beta_user_service_lock_user_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_lock_user_request' when calling Api::BetaUserServiceApi.lock_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/LockUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_lock_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceLockUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.lock_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#lock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_lock_user_request [BetaUserServiceLockUserRequest] + + # @return [BetaUserServiceLockUserResponse] + # @raise [ApiError] if fails to make API call + def lock_user(beta_user_service_lock_user_request) + if beta_user_service_lock_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_lock_user_request' when calling BetaUserServiceApi.lock_user" + end + + result = lock_user_with_http_info(beta_user_service_lock_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def lock_user_with_http_info(beta_user_service_lock_user_request) + if beta_user_service_lock_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_lock_user_request' when calling BetaUserServiceApi.lock_user" + end + + path = '/zitadel.user.v2beta.UserService/LockUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_lock_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceLockUserResponse', + nil + ) + end # Request a code to reset a password # Request a code to reset a password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_password_reset_request [BetaUserServicePasswordResetRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServicePasswordResetResponse] - def password_reset(beta_user_service_password_reset_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.password_reset ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_password_reset_request' is set - if @api_client.config.client_side_validation && beta_user_service_password_reset_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_password_reset_request' when calling Api::BetaUserServiceApi.password_reset" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/PasswordReset' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_password_reset_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServicePasswordResetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.password_reset", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#password_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_password_reset_request [BetaUserServicePasswordResetRequest] + + # @return [BetaUserServicePasswordResetResponse] + # @raise [ApiError] if fails to make API call + def password_reset(beta_user_service_password_reset_request) + if beta_user_service_password_reset_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_password_reset_request' when calling BetaUserServiceApi.password_reset" + end + + result = password_reset_with_http_info(beta_user_service_password_reset_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def password_reset_with_http_info(beta_user_service_password_reset_request) + if beta_user_service_password_reset_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_password_reset_request' when calling BetaUserServiceApi.password_reset" + end + + path = '/zitadel.user.v2beta.UserService/PasswordReset' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_password_reset_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServicePasswordResetResponse', + nil + ) + end # Reactivate user - # Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_reactivate_user_request [BetaUserServiceReactivateUserRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceReactivateUserResponse] - def reactivate_user(beta_user_service_reactivate_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.reactivate_user ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_reactivate_user_request' is set - if @api_client.config.client_side_validation && beta_user_service_reactivate_user_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_reactivate_user_request' when calling Api::BetaUserServiceApi.reactivate_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/ReactivateUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_reactivate_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceReactivateUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.reactivate_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#reactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_reactivate_user_request [BetaUserServiceReactivateUserRequest] + + # @return [BetaUserServiceReactivateUserResponse] + # @raise [ApiError] if fails to make API call + def reactivate_user(beta_user_service_reactivate_user_request) + if beta_user_service_reactivate_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_reactivate_user_request' when calling BetaUserServiceApi.reactivate_user" + end + + result = reactivate_user_with_http_info(beta_user_service_reactivate_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reactivate_user_with_http_info(beta_user_service_reactivate_user_request) + if beta_user_service_reactivate_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_reactivate_user_request' when calling BetaUserServiceApi.reactivate_user" + end + + path = '/zitadel.user.v2beta.UserService/ReactivateUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_reactivate_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceReactivateUserResponse', + nil + ) + end # Start the registration of passkey for a user # Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_register_passkey_request [BetaUserServiceRegisterPasskeyRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceRegisterPasskeyResponse] - def register_passkey(beta_user_service_register_passkey_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.register_passkey ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_register_passkey_request' is set - if @api_client.config.client_side_validation && beta_user_service_register_passkey_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_register_passkey_request' when calling Api::BetaUserServiceApi.register_passkey" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/RegisterPasskey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_register_passkey_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceRegisterPasskeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.register_passkey", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#register_passkey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_register_passkey_request [BetaUserServiceRegisterPasskeyRequest] + + # @return [BetaUserServiceRegisterPasskeyResponse] + # @raise [ApiError] if fails to make API call + def register_passkey(beta_user_service_register_passkey_request) + if beta_user_service_register_passkey_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_register_passkey_request' when calling BetaUserServiceApi.register_passkey" + end + + result = register_passkey_with_http_info(beta_user_service_register_passkey_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def register_passkey_with_http_info(beta_user_service_register_passkey_request) + if beta_user_service_register_passkey_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_register_passkey_request' when calling BetaUserServiceApi.register_passkey" + end + + path = '/zitadel.user.v2beta.UserService/RegisterPasskey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_register_passkey_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceRegisterPasskeyResponse', + nil + ) + end # Start the registration of a TOTP generator for a user # Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_register_totp_request [BetaUserServiceRegisterTOTPRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceRegisterTOTPResponse] - def register_totp(beta_user_service_register_totp_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.register_totp ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_register_totp_request' is set - if @api_client.config.client_side_validation && beta_user_service_register_totp_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_register_totp_request' when calling Api::BetaUserServiceApi.register_totp" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/RegisterTOTP' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_register_totp_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceRegisterTOTPResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.register_totp", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#register_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_register_totp_request [BetaUserServiceRegisterTOTPRequest] + + # @return [BetaUserServiceRegisterTOTPResponse] + # @raise [ApiError] if fails to make API call + def register_totp(beta_user_service_register_totp_request) + if beta_user_service_register_totp_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_register_totp_request' when calling BetaUserServiceApi.register_totp" + end + + result = register_totp_with_http_info(beta_user_service_register_totp_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def register_totp_with_http_info(beta_user_service_register_totp_request) + if beta_user_service_register_totp_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_register_totp_request' when calling BetaUserServiceApi.register_totp" + end + + path = '/zitadel.user.v2beta.UserService/RegisterTOTP' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_register_totp_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceRegisterTOTPResponse', + nil + ) + end # Start the registration of a u2f token for a user # Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_register_u2_f_request [BetaUserServiceRegisterU2FRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceRegisterU2FResponse] - def register_u2_f(beta_user_service_register_u2_f_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.register_u2_f ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_register_u2_f_request' is set - if @api_client.config.client_side_validation && beta_user_service_register_u2_f_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_register_u2_f_request' when calling Api::BetaUserServiceApi.register_u2_f" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/RegisterU2F' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_register_u2_f_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceRegisterU2FResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.register_u2_f", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#register_u2_f\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_register_u2_f_request [BetaUserServiceRegisterU2FRequest] + + # @return [BetaUserServiceRegisterU2FResponse] + # @raise [ApiError] if fails to make API call + def register_u2_f(beta_user_service_register_u2_f_request) + if beta_user_service_register_u2_f_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_register_u2_f_request' when calling BetaUserServiceApi.register_u2_f" + end + + result = register_u2_f_with_http_info(beta_user_service_register_u2_f_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def register_u2_f_with_http_info(beta_user_service_register_u2_f_request) + if beta_user_service_register_u2_f_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_register_u2_f_request' when calling BetaUserServiceApi.register_u2_f" + end + + path = '/zitadel.user.v2beta.UserService/RegisterU2F' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_register_u2_f_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceRegisterU2FResponse', + nil + ) + end # Remove One-Time Password (OTP) Email from a user # Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_remove_otp_email_request [BetaUserServiceRemoveOTPEmailRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceRemoveOTPEmailResponse] - def remove_otp_email(beta_user_service_remove_otp_email_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.remove_otp_email ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_remove_otp_email_request' is set - if @api_client.config.client_side_validation && beta_user_service_remove_otp_email_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_remove_otp_email_request' when calling Api::BetaUserServiceApi.remove_otp_email" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/RemoveOTPEmail' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_remove_otp_email_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceRemoveOTPEmailResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.remove_otp_email", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#remove_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_remove_otp_email_request [BetaUserServiceRemoveOTPEmailRequest] + + # @return [BetaUserServiceRemoveOTPEmailResponse] + # @raise [ApiError] if fails to make API call + def remove_otp_email(beta_user_service_remove_otp_email_request) + if beta_user_service_remove_otp_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_remove_otp_email_request' when calling BetaUserServiceApi.remove_otp_email" + end + + result = remove_otp_email_with_http_info(beta_user_service_remove_otp_email_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_otp_email_with_http_info(beta_user_service_remove_otp_email_request) + if beta_user_service_remove_otp_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_remove_otp_email_request' when calling BetaUserServiceApi.remove_otp_email" + end + + path = '/zitadel.user.v2beta.UserService/RemoveOTPEmail' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_remove_otp_email_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceRemoveOTPEmailResponse', + nil + ) + end # Remove One-Time Password (OTP) SMS from a user # Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_remove_otpsms_request [BetaUserServiceRemoveOTPSMSRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceRemoveOTPSMSResponse] - def remove_otpsms(beta_user_service_remove_otpsms_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.remove_otpsms ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_remove_otpsms_request' is set - if @api_client.config.client_side_validation && beta_user_service_remove_otpsms_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_remove_otpsms_request' when calling Api::BetaUserServiceApi.remove_otpsms" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/RemoveOTPSMS' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_remove_otpsms_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceRemoveOTPSMSResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.remove_otpsms", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#remove_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_remove_otpsms_request [BetaUserServiceRemoveOTPSMSRequest] + + # @return [BetaUserServiceRemoveOTPSMSResponse] + # @raise [ApiError] if fails to make API call + def remove_otpsms(beta_user_service_remove_otpsms_request) + if beta_user_service_remove_otpsms_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_remove_otpsms_request' when calling BetaUserServiceApi.remove_otpsms" + end + + result = remove_otpsms_with_http_info(beta_user_service_remove_otpsms_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_otpsms_with_http_info(beta_user_service_remove_otpsms_request) + if beta_user_service_remove_otpsms_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_remove_otpsms_request' when calling BetaUserServiceApi.remove_otpsms" + end + + path = '/zitadel.user.v2beta.UserService/RemoveOTPSMS' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_remove_otpsms_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceRemoveOTPSMSResponse', + nil + ) + end # Remove the user phone # Remove the user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_remove_phone_request [BetaUserServiceRemovePhoneRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceRemovePhoneResponse] - def remove_phone(beta_user_service_remove_phone_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.remove_phone ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_remove_phone_request' is set - if @api_client.config.client_side_validation && beta_user_service_remove_phone_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_remove_phone_request' when calling Api::BetaUserServiceApi.remove_phone" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/RemovePhone' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_remove_phone_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceRemovePhoneResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.remove_phone", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#remove_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_remove_phone_request [BetaUserServiceRemovePhoneRequest] + + # @return [BetaUserServiceRemovePhoneResponse] + # @raise [ApiError] if fails to make API call + def remove_phone(beta_user_service_remove_phone_request) + if beta_user_service_remove_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_remove_phone_request' when calling BetaUserServiceApi.remove_phone" + end + + result = remove_phone_with_http_info(beta_user_service_remove_phone_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_phone_with_http_info(beta_user_service_remove_phone_request) + if beta_user_service_remove_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_remove_phone_request' when calling BetaUserServiceApi.remove_phone" + end + + path = '/zitadel.user.v2beta.UserService/RemovePhone' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_remove_phone_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceRemovePhoneResponse', + nil + ) + end # Remove TOTP generator from a user # Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_remove_totp_request [BetaUserServiceRemoveTOTPRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceRemoveTOTPResponse] - def remove_totp(beta_user_service_remove_totp_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.remove_totp ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_remove_totp_request' is set - if @api_client.config.client_side_validation && beta_user_service_remove_totp_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_remove_totp_request' when calling Api::BetaUserServiceApi.remove_totp" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/RemoveTOTP' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_remove_totp_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceRemoveTOTPResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.remove_totp", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#remove_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_remove_totp_request [BetaUserServiceRemoveTOTPRequest] + + # @return [BetaUserServiceRemoveTOTPResponse] + # @raise [ApiError] if fails to make API call + def remove_totp(beta_user_service_remove_totp_request) + if beta_user_service_remove_totp_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_remove_totp_request' when calling BetaUserServiceApi.remove_totp" + end + + result = remove_totp_with_http_info(beta_user_service_remove_totp_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_totp_with_http_info(beta_user_service_remove_totp_request) + if beta_user_service_remove_totp_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_remove_totp_request' when calling BetaUserServiceApi.remove_totp" + end + + path = '/zitadel.user.v2beta.UserService/RemoveTOTP' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_remove_totp_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceRemoveTOTPResponse', + nil + ) + end # Resend code to verify user email # Resend code to verify user email Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_resend_email_code_request [BetaUserServiceResendEmailCodeRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceResendEmailCodeResponse] - def resend_email_code(beta_user_service_resend_email_code_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.resend_email_code ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_resend_email_code_request' is set - if @api_client.config.client_side_validation && beta_user_service_resend_email_code_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_resend_email_code_request' when calling Api::BetaUserServiceApi.resend_email_code" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/ResendEmailCode' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_resend_email_code_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceResendEmailCodeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.resend_email_code", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#resend_email_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_resend_email_code_request [BetaUserServiceResendEmailCodeRequest] + + # @return [BetaUserServiceResendEmailCodeResponse] + # @raise [ApiError] if fails to make API call + def resend_email_code(beta_user_service_resend_email_code_request) + if beta_user_service_resend_email_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_resend_email_code_request' when calling BetaUserServiceApi.resend_email_code" + end + + result = resend_email_code_with_http_info(beta_user_service_resend_email_code_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def resend_email_code_with_http_info(beta_user_service_resend_email_code_request) + if beta_user_service_resend_email_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_resend_email_code_request' when calling BetaUserServiceApi.resend_email_code" + end + + path = '/zitadel.user.v2beta.UserService/ResendEmailCode' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_resend_email_code_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceResendEmailCodeResponse', + nil + ) + end # Resend code to verify user phone # Resend code to verify user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_resend_phone_code_request [BetaUserServiceResendPhoneCodeRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceResendPhoneCodeResponse] - def resend_phone_code(beta_user_service_resend_phone_code_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.resend_phone_code ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_resend_phone_code_request' is set - if @api_client.config.client_side_validation && beta_user_service_resend_phone_code_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_resend_phone_code_request' when calling Api::BetaUserServiceApi.resend_phone_code" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/ResendPhoneCode' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_resend_phone_code_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceResendPhoneCodeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.resend_phone_code", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#resend_phone_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_resend_phone_code_request [BetaUserServiceResendPhoneCodeRequest] + + # @return [BetaUserServiceResendPhoneCodeResponse] + # @raise [ApiError] if fails to make API call + def resend_phone_code(beta_user_service_resend_phone_code_request) + if beta_user_service_resend_phone_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_resend_phone_code_request' when calling BetaUserServiceApi.resend_phone_code" + end + + result = resend_phone_code_with_http_info(beta_user_service_resend_phone_code_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def resend_phone_code_with_http_info(beta_user_service_resend_phone_code_request) + if beta_user_service_resend_phone_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_resend_phone_code_request' when calling BetaUserServiceApi.resend_phone_code" + end + + path = '/zitadel.user.v2beta.UserService/ResendPhoneCode' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_resend_phone_code_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceResendPhoneCodeResponse', + nil + ) + end # Retrieve the information returned by the identity provider # Retrieve the information returned by the identity provider for registration or updating an existing user with new information. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_retrieve_identity_provider_intent_request [BetaUserServiceRetrieveIdentityProviderIntentRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceRetrieveIdentityProviderIntentResponse] - def retrieve_identity_provider_intent(beta_user_service_retrieve_identity_provider_intent_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.retrieve_identity_provider_intent ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_retrieve_identity_provider_intent_request' is set - if @api_client.config.client_side_validation && beta_user_service_retrieve_identity_provider_intent_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_retrieve_identity_provider_intent_request' when calling Api::BetaUserServiceApi.retrieve_identity_provider_intent" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/RetrieveIdentityProviderIntent' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_retrieve_identity_provider_intent_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceRetrieveIdentityProviderIntentResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.retrieve_identity_provider_intent", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#retrieve_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_retrieve_identity_provider_intent_request [BetaUserServiceRetrieveIdentityProviderIntentRequest] + + # @return [BetaUserServiceRetrieveIdentityProviderIntentResponse] + # @raise [ApiError] if fails to make API call + def retrieve_identity_provider_intent(beta_user_service_retrieve_identity_provider_intent_request) + if beta_user_service_retrieve_identity_provider_intent_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_retrieve_identity_provider_intent_request' when calling BetaUserServiceApi.retrieve_identity_provider_intent" + end + + result = retrieve_identity_provider_intent_with_http_info(beta_user_service_retrieve_identity_provider_intent_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def retrieve_identity_provider_intent_with_http_info(beta_user_service_retrieve_identity_provider_intent_request) + if beta_user_service_retrieve_identity_provider_intent_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_retrieve_identity_provider_intent_request' when calling BetaUserServiceApi.retrieve_identity_provider_intent" + end + + path = '/zitadel.user.v2beta.UserService/RetrieveIdentityProviderIntent' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_retrieve_identity_provider_intent_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceRetrieveIdentityProviderIntentResponse', + nil + ) + end # Change the user email # Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_set_email_request [BetaUserServiceSetEmailRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceSetEmailResponse] - def set_email(beta_user_service_set_email_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.set_email ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_set_email_request' is set - if @api_client.config.client_side_validation && beta_user_service_set_email_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_set_email_request' when calling Api::BetaUserServiceApi.set_email" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/SetEmail' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_set_email_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceSetEmailResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.set_email", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#set_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_set_email_request [BetaUserServiceSetEmailRequest] + + # @return [BetaUserServiceSetEmailResponse] + # @raise [ApiError] if fails to make API call + def set_email(beta_user_service_set_email_request) + if beta_user_service_set_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_set_email_request' when calling BetaUserServiceApi.set_email" + end + + result = set_email_with_http_info(beta_user_service_set_email_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_email_with_http_info(beta_user_service_set_email_request) + if beta_user_service_set_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_set_email_request' when calling BetaUserServiceApi.set_email" + end + + path = '/zitadel.user.v2beta.UserService/SetEmail' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_set_email_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceSetEmailResponse', + nil + ) + end # Change password # Change the password of a user with either a verification code or the current password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_set_password_request [BetaUserServiceSetPasswordRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceSetPasswordResponse] - def set_password(beta_user_service_set_password_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.set_password ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_set_password_request' is set - if @api_client.config.client_side_validation && beta_user_service_set_password_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_set_password_request' when calling Api::BetaUserServiceApi.set_password" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/SetPassword' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_set_password_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceSetPasswordResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.set_password", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#set_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_set_password_request [BetaUserServiceSetPasswordRequest] + + # @return [BetaUserServiceSetPasswordResponse] + # @raise [ApiError] if fails to make API call + def set_password(beta_user_service_set_password_request) + if beta_user_service_set_password_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_set_password_request' when calling BetaUserServiceApi.set_password" + end + + result = set_password_with_http_info(beta_user_service_set_password_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_password_with_http_info(beta_user_service_set_password_request) + if beta_user_service_set_password_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_set_password_request' when calling BetaUserServiceApi.set_password" + end + + path = '/zitadel.user.v2beta.UserService/SetPassword' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_set_password_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceSetPasswordResponse', + nil + ) + end # Set the user phone # Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_set_phone_request [BetaUserServiceSetPhoneRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceSetPhoneResponse] - def set_phone(beta_user_service_set_phone_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.set_phone ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_set_phone_request' is set - if @api_client.config.client_side_validation && beta_user_service_set_phone_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_set_phone_request' when calling Api::BetaUserServiceApi.set_phone" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/SetPhone' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_set_phone_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceSetPhoneResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.set_phone", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#set_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_set_phone_request [BetaUserServiceSetPhoneRequest] + + # @return [BetaUserServiceSetPhoneResponse] + # @raise [ApiError] if fails to make API call + def set_phone(beta_user_service_set_phone_request) + if beta_user_service_set_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_set_phone_request' when calling BetaUserServiceApi.set_phone" + end + + result = set_phone_with_http_info(beta_user_service_set_phone_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_phone_with_http_info(beta_user_service_set_phone_request) + if beta_user_service_set_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_set_phone_request' when calling BetaUserServiceApi.set_phone" + end + + path = '/zitadel.user.v2beta.UserService/SetPhone' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_set_phone_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceSetPhoneResponse', + nil + ) + end # Start flow with an identity provider # Start a flow with an identity provider, for external login, registration or linking. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_start_identity_provider_intent_request [BetaUserServiceStartIdentityProviderIntentRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceStartIdentityProviderIntentResponse] - def start_identity_provider_intent(beta_user_service_start_identity_provider_intent_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.start_identity_provider_intent ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_start_identity_provider_intent_request' is set - if @api_client.config.client_side_validation && beta_user_service_start_identity_provider_intent_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_start_identity_provider_intent_request' when calling Api::BetaUserServiceApi.start_identity_provider_intent" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/StartIdentityProviderIntent' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_start_identity_provider_intent_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceStartIdentityProviderIntentResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.start_identity_provider_intent", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#start_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_start_identity_provider_intent_request [BetaUserServiceStartIdentityProviderIntentRequest] + + # @return [BetaUserServiceStartIdentityProviderIntentResponse] + # @raise [ApiError] if fails to make API call + def start_identity_provider_intent(beta_user_service_start_identity_provider_intent_request) + if beta_user_service_start_identity_provider_intent_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_start_identity_provider_intent_request' when calling BetaUserServiceApi.start_identity_provider_intent" + end + + result = start_identity_provider_intent_with_http_info(beta_user_service_start_identity_provider_intent_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def start_identity_provider_intent_with_http_info(beta_user_service_start_identity_provider_intent_request) + if beta_user_service_start_identity_provider_intent_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_start_identity_provider_intent_request' when calling BetaUserServiceApi.start_identity_provider_intent" + end + + path = '/zitadel.user.v2beta.UserService/StartIdentityProviderIntent' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_start_identity_provider_intent_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceStartIdentityProviderIntentResponse', + nil + ) + end # Unlock user - # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_unlock_user_request [BetaUserServiceUnlockUserRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceUnlockUserResponse] - def unlock_user(beta_user_service_unlock_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.unlock_user ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_unlock_user_request' is set - if @api_client.config.client_side_validation && beta_user_service_unlock_user_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_unlock_user_request' when calling Api::BetaUserServiceApi.unlock_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/UnlockUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_unlock_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceUnlockUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.unlock_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#unlock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + # @param beta_user_service_unlock_user_request [BetaUserServiceUnlockUserRequest] + + # @return [BetaUserServiceUnlockUserResponse] + # @raise [ApiError] if fails to make API call + def unlock_user(beta_user_service_unlock_user_request) + if beta_user_service_unlock_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_unlock_user_request' when calling BetaUserServiceApi.unlock_user" + end + + result = unlock_user_with_http_info(beta_user_service_unlock_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def unlock_user_with_http_info(beta_user_service_unlock_user_request) + if beta_user_service_unlock_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_unlock_user_request' when calling BetaUserServiceApi.unlock_user" + end + + path = '/zitadel.user.v2beta.UserService/UnlockUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_unlock_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceUnlockUserResponse', + nil + ) + end # Update User # Update all information from a user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_update_human_user_request [BetaUserServiceUpdateHumanUserRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceUpdateHumanUserResponse] - def update_human_user(beta_user_service_update_human_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.update_human_user ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_update_human_user_request' is set - if @api_client.config.client_side_validation && beta_user_service_update_human_user_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_update_human_user_request' when calling Api::BetaUserServiceApi.update_human_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/UpdateHumanUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_update_human_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceUpdateHumanUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.update_human_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#update_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_update_human_user_request [BetaUserServiceUpdateHumanUserRequest] + + # @return [BetaUserServiceUpdateHumanUserResponse] + # @raise [ApiError] if fails to make API call + def update_human_user(beta_user_service_update_human_user_request) + if beta_user_service_update_human_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_update_human_user_request' when calling BetaUserServiceApi.update_human_user" + end + + result = update_human_user_with_http_info(beta_user_service_update_human_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_human_user_with_http_info(beta_user_service_update_human_user_request) + if beta_user_service_update_human_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_update_human_user_request' when calling BetaUserServiceApi.update_human_user" + end + + path = '/zitadel.user.v2beta.UserService/UpdateHumanUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_update_human_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceUpdateHumanUserResponse', + nil + ) + end # Verify the email # Verify the email with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_verify_email_request [BetaUserServiceVerifyEmailRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceVerifyEmailResponse] - def verify_email(beta_user_service_verify_email_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_email ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_verify_email_request' is set - if @api_client.config.client_side_validation && beta_user_service_verify_email_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_email_request' when calling Api::BetaUserServiceApi.verify_email" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/VerifyEmail' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_verify_email_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyEmailResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.verify_email", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#verify_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_verify_email_request [BetaUserServiceVerifyEmailRequest] + + # @return [BetaUserServiceVerifyEmailResponse] + # @raise [ApiError] if fails to make API call + def verify_email(beta_user_service_verify_email_request) + if beta_user_service_verify_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_email_request' when calling BetaUserServiceApi.verify_email" + end + + result = verify_email_with_http_info(beta_user_service_verify_email_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_email_with_http_info(beta_user_service_verify_email_request) + if beta_user_service_verify_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_email_request' when calling BetaUserServiceApi.verify_email" + end + + path = '/zitadel.user.v2beta.UserService/VerifyEmail' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_verify_email_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceVerifyEmailResponse', + nil + ) + end # Verify a passkey for a user # Verify the passkey registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_verify_passkey_registration_request [BetaUserServiceVerifyPasskeyRegistrationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceVerifyPasskeyRegistrationResponse] - def verify_passkey_registration(beta_user_service_verify_passkey_registration_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_passkey_registration ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_verify_passkey_registration_request' is set - if @api_client.config.client_side_validation && beta_user_service_verify_passkey_registration_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_passkey_registration_request' when calling Api::BetaUserServiceApi.verify_passkey_registration" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/VerifyPasskeyRegistration' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_verify_passkey_registration_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyPasskeyRegistrationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.verify_passkey_registration", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#verify_passkey_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_verify_passkey_registration_request [BetaUserServiceVerifyPasskeyRegistrationRequest] + + # @return [BetaUserServiceVerifyPasskeyRegistrationResponse] + # @raise [ApiError] if fails to make API call + def verify_passkey_registration(beta_user_service_verify_passkey_registration_request) + if beta_user_service_verify_passkey_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_passkey_registration_request' when calling BetaUserServiceApi.verify_passkey_registration" + end + + result = verify_passkey_registration_with_http_info(beta_user_service_verify_passkey_registration_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_passkey_registration_with_http_info(beta_user_service_verify_passkey_registration_request) + if beta_user_service_verify_passkey_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_passkey_registration_request' when calling BetaUserServiceApi.verify_passkey_registration" + end + + path = '/zitadel.user.v2beta.UserService/VerifyPasskeyRegistration' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_verify_passkey_registration_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceVerifyPasskeyRegistrationResponse', + nil + ) + end # Verify the phone # Verify the phone with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_verify_phone_request [BetaUserServiceVerifyPhoneRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceVerifyPhoneResponse] - def verify_phone(beta_user_service_verify_phone_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_phone ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_verify_phone_request' is set - if @api_client.config.client_side_validation && beta_user_service_verify_phone_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_phone_request' when calling Api::BetaUserServiceApi.verify_phone" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/VerifyPhone' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_verify_phone_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyPhoneResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.verify_phone", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#verify_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_verify_phone_request [BetaUserServiceVerifyPhoneRequest] + + # @return [BetaUserServiceVerifyPhoneResponse] + # @raise [ApiError] if fails to make API call + def verify_phone(beta_user_service_verify_phone_request) + if beta_user_service_verify_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_phone_request' when calling BetaUserServiceApi.verify_phone" + end + + result = verify_phone_with_http_info(beta_user_service_verify_phone_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_phone_with_http_info(beta_user_service_verify_phone_request) + if beta_user_service_verify_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_phone_request' when calling BetaUserServiceApi.verify_phone" + end + + path = '/zitadel.user.v2beta.UserService/VerifyPhone' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_verify_phone_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceVerifyPhoneResponse', + nil + ) + end # Verify a TOTP generator for a user # Verify the TOTP registration with a generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_verify_totp_registration_request [BetaUserServiceVerifyTOTPRegistrationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceVerifyTOTPRegistrationResponse] - def verify_totp_registration(beta_user_service_verify_totp_registration_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_totp_registration ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_verify_totp_registration_request' is set - if @api_client.config.client_side_validation && beta_user_service_verify_totp_registration_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_totp_registration_request' when calling Api::BetaUserServiceApi.verify_totp_registration" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/VerifyTOTPRegistration' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_verify_totp_registration_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyTOTPRegistrationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.verify_totp_registration", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#verify_totp_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param beta_user_service_verify_totp_registration_request [BetaUserServiceVerifyTOTPRegistrationRequest] + + # @return [BetaUserServiceVerifyTOTPRegistrationResponse] + # @raise [ApiError] if fails to make API call + def verify_totp_registration(beta_user_service_verify_totp_registration_request) + if beta_user_service_verify_totp_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_totp_registration_request' when calling BetaUserServiceApi.verify_totp_registration" + end + + result = verify_totp_registration_with_http_info(beta_user_service_verify_totp_registration_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_totp_registration_with_http_info(beta_user_service_verify_totp_registration_request) + if beta_user_service_verify_totp_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_totp_registration_request' when calling BetaUserServiceApi.verify_totp_registration" + end + + path = '/zitadel.user.v2beta.UserService/VerifyTOTPRegistration' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_verify_totp_registration_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceVerifyTOTPRegistrationResponse', + nil + ) + end # Verify a u2f token for a user # Verify the u2f token registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). - # @param beta_user_service_verify_u2_f_registration_request [BetaUserServiceVerifyU2FRegistrationRequest] - # @param [Hash] opts the optional parameters - # @return [BetaUserServiceVerifyU2FRegistrationResponse] - def verify_u2_f_registration(beta_user_service_verify_u2_f_registration_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaUserServiceApi.verify_u2_f_registration ...' # MODIFIED - end - # verify the required parameter 'beta_user_service_verify_u2_f_registration_request' is set - if @api_client.config.client_side_validation && beta_user_service_verify_u2_f_registration_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_user_service_verify_u2_f_registration_request' when calling Api::BetaUserServiceApi.verify_u2_f_registration" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2beta.UserService/VerifyU2FRegistration' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_user_service_verify_u2_f_registration_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaUserServiceVerifyU2FRegistrationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaUserServiceApi.verify_u2_f_registration", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaUserServiceApi#verify_u2_f_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @param beta_user_service_verify_u2_f_registration_request [BetaUserServiceVerifyU2FRegistrationRequest] + + # @return [BetaUserServiceVerifyU2FRegistrationResponse] + # @raise [ApiError] if fails to make API call + def verify_u2_f_registration(beta_user_service_verify_u2_f_registration_request) + if beta_user_service_verify_u2_f_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_u2_f_registration_request' when calling BetaUserServiceApi.verify_u2_f_registration" + end + + result = verify_u2_f_registration_with_http_info(beta_user_service_verify_u2_f_registration_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_u2_f_registration_with_http_info(beta_user_service_verify_u2_f_registration_request) + if beta_user_service_verify_u2_f_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_user_service_verify_u2_f_registration_request' when calling BetaUserServiceApi.verify_u2_f_registration" + end + + path = '/zitadel.user.v2beta.UserService/VerifyU2FRegistration' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_user_service_verify_u2_f_registration_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaUserServiceVerifyU2FRegistrationResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/beta_web_key_service_api.rb b/lib/zitadel/client/api/beta_web_key_service_api.rb index 3ca4a607..d4dfe45b 100644 --- a/lib/zitadel/client/api/beta_web_key_service_api.rb +++ b/lib/zitadel/client/api/beta_web_key_service_api.rb @@ -1,254 +1,234 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class BetaWebKeyServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # BetaWebKeyServiceApi provides methods for the BetaWebKeyService API group. + class BetaWebKeyServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Activate Web Key - # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` - # @param beta_web_key_service_activate_web_key_request [BetaWebKeyServiceActivateWebKeyRequest] - # @param [Hash] opts the optional parameters - # @return [BetaWebKeyServiceActivateWebKeyResponse] - def activate_web_key(beta_web_key_service_activate_web_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaWebKeyServiceApi.activate_web_key ...' # MODIFIED - end - # verify the required parameter 'beta_web_key_service_activate_web_key_request' is set - if @api_client.config.client_side_validation && beta_web_key_service_activate_web_key_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_web_key_service_activate_web_key_request' when calling Api::BetaWebKeyServiceApi.activate_web_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.webkey.v2beta.WebKeyService/ActivateWebKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` + # @param beta_web_key_service_activate_web_key_request [BetaWebKeyServiceActivateWebKeyRequest] + + # @return [BetaWebKeyServiceActivateWebKeyResponse] + # @raise [ApiError] if fails to make API call + def activate_web_key(beta_web_key_service_activate_web_key_request) + if beta_web_key_service_activate_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_web_key_service_activate_web_key_request' when calling BetaWebKeyServiceApi.activate_web_key" + end + + result = activate_web_key_with_http_info(beta_web_key_service_activate_web_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_web_key_service_activate_web_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaWebKeyServiceActivateWebKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaWebKeyServiceApi.activate_web_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaWebKeyServiceApi#activate_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_web_key_with_http_info(beta_web_key_service_activate_web_key_request) + if beta_web_key_service_activate_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_web_key_service_activate_web_key_request' when calling BetaWebKeyServiceApi.activate_web_key" + end + + path = '/zitadel.webkey.v2beta.WebKeyService/ActivateWebKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_web_key_service_activate_web_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaWebKeyServiceActivateWebKeyResponse', + nil + ) + end # Create Web Key - # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` - # @param beta_web_key_service_create_web_key_request [BetaWebKeyServiceCreateWebKeyRequest] - # @param [Hash] opts the optional parameters - # @return [BetaWebKeyServiceCreateWebKeyResponse] - def create_web_key(beta_web_key_service_create_web_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaWebKeyServiceApi.create_web_key ...' # MODIFIED - end - # verify the required parameter 'beta_web_key_service_create_web_key_request' is set - if @api_client.config.client_side_validation && beta_web_key_service_create_web_key_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_web_key_service_create_web_key_request' when calling Api::BetaWebKeyServiceApi.create_web_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.webkey.v2beta.WebKeyService/CreateWebKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` + # @param beta_web_key_service_create_web_key_request [BetaWebKeyServiceCreateWebKeyRequest] + + # @return [BetaWebKeyServiceCreateWebKeyResponse] + # @raise [ApiError] if fails to make API call + def create_web_key(beta_web_key_service_create_web_key_request) + if beta_web_key_service_create_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_web_key_service_create_web_key_request' when calling BetaWebKeyServiceApi.create_web_key" + end + + result = create_web_key_with_http_info(beta_web_key_service_create_web_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_web_key_service_create_web_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaWebKeyServiceCreateWebKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaWebKeyServiceApi.create_web_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaWebKeyServiceApi#create_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_web_key_with_http_info(beta_web_key_service_create_web_key_request) + if beta_web_key_service_create_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_web_key_service_create_web_key_request' when calling BetaWebKeyServiceApi.create_web_key" + end + + path = '/zitadel.webkey.v2beta.WebKeyService/CreateWebKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_web_key_service_create_web_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaWebKeyServiceCreateWebKeyResponse', + nil + ) + end # Delete Web Key - # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` - # @param beta_web_key_service_delete_web_key_request [BetaWebKeyServiceDeleteWebKeyRequest] - # @param [Hash] opts the optional parameters - # @return [BetaWebKeyServiceDeleteWebKeyResponse] - def delete_web_key(beta_web_key_service_delete_web_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaWebKeyServiceApi.delete_web_key ...' # MODIFIED - end - # verify the required parameter 'beta_web_key_service_delete_web_key_request' is set - if @api_client.config.client_side_validation && beta_web_key_service_delete_web_key_request.nil? - fail ArgumentError, "Missing the required parameter 'beta_web_key_service_delete_web_key_request' when calling Api::BetaWebKeyServiceApi.delete_web_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.webkey.v2beta.WebKeyService/DeleteWebKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` + # @param beta_web_key_service_delete_web_key_request [BetaWebKeyServiceDeleteWebKeyRequest] + + # @return [BetaWebKeyServiceDeleteWebKeyResponse] + # @raise [ApiError] if fails to make API call + def delete_web_key(beta_web_key_service_delete_web_key_request) + if beta_web_key_service_delete_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_web_key_service_delete_web_key_request' when calling BetaWebKeyServiceApi.delete_web_key" + end + + result = delete_web_key_with_http_info(beta_web_key_service_delete_web_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beta_web_key_service_delete_web_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'BetaWebKeyServiceDeleteWebKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaWebKeyServiceApi.delete_web_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaWebKeyServiceApi#delete_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_web_key_with_http_info(beta_web_key_service_delete_web_key_request) + if beta_web_key_service_delete_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'beta_web_key_service_delete_web_key_request' when calling BetaWebKeyServiceApi.delete_web_key" + end + + path = '/zitadel.webkey.v2beta.WebKeyService/DeleteWebKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = beta_web_key_service_delete_web_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaWebKeyServiceDeleteWebKeyResponse', + nil + ) + end # List Web Keys - # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. List all web keys and their states. Required permission: - `iam.web_key.read` - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [BetaWebKeyServiceListWebKeysResponse] - def list_web_keys(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::BetaWebKeyServiceApi.list_web_keys ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::BetaWebKeyServiceApi.list_web_keys" # MODIFIED - end - # resource path - local_var_path = '/zitadel.webkey.v2beta.WebKeyService/ListWebKeys' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. List all web keys and their states. Required permission: - `iam.web_key.read` + # @param body [Object] + + # @return [BetaWebKeyServiceListWebKeysResponse] + # @raise [ApiError] if fails to make API call + def list_web_keys(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaWebKeyServiceApi.list_web_keys" + end + + result = list_web_keys_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'BetaWebKeyServiceListWebKeysResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::BetaWebKeyServiceApi.list_web_keys", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::BetaWebKeyServiceApi#list_web_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_web_keys_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling BetaWebKeyServiceApi.list_web_keys" + end + + path = '/zitadel.webkey.v2beta.WebKeyService/ListWebKeys' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'BetaWebKeyServiceListWebKeysResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/feature_service_api.rb b/lib/zitadel/client/api/feature_service_api.rb index ef704ddc..664b87cb 100644 --- a/lib/zitadel/client/api/feature_service_api.rb +++ b/lib/zitadel/client/api/feature_service_api.rb @@ -1,718 +1,658 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class FeatureServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # FeatureServiceApi provides methods for the FeatureService API group. + class FeatureServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Get Instance Features # Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none - # @param feature_service_get_instance_features_request [FeatureServiceGetInstanceFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceGetInstanceFeaturesResponse] - def get_instance_features(feature_service_get_instance_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.get_instance_features ...' # MODIFIED - end - # verify the required parameter 'feature_service_get_instance_features_request' is set - if @api_client.config.client_side_validation && feature_service_get_instance_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_get_instance_features_request' when calling Api::FeatureServiceApi.get_instance_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/GetInstanceFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param feature_service_get_instance_features_request [FeatureServiceGetInstanceFeaturesRequest] + + # @return [FeatureServiceGetInstanceFeaturesResponse] + # @raise [ApiError] if fails to make API call + def get_instance_features(feature_service_get_instance_features_request) + if feature_service_get_instance_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_get_instance_features_request' when calling FeatureServiceApi.get_instance_features" + end + + result = get_instance_features_with_http_info(feature_service_get_instance_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_get_instance_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceGetInstanceFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.get_instance_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#get_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_instance_features_with_http_info(feature_service_get_instance_features_request) + if feature_service_get_instance_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_get_instance_features_request' when calling FeatureServiceApi.get_instance_features" + end + + path = '/zitadel.feature.v2.FeatureService/GetInstanceFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = feature_service_get_instance_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceGetInstanceFeaturesResponse', + nil + ) + end # Get Organization Features # Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to - # @param feature_service_get_organization_features_request [FeatureServiceGetOrganizationFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceGetOrganizationFeaturesResponse] - def get_organization_features(feature_service_get_organization_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.get_organization_features ...' # MODIFIED - end - # verify the required parameter 'feature_service_get_organization_features_request' is set - if @api_client.config.client_side_validation && feature_service_get_organization_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_get_organization_features_request' when calling Api::FeatureServiceApi.get_organization_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/GetOrganizationFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param feature_service_get_organization_features_request [FeatureServiceGetOrganizationFeaturesRequest] + + # @return [FeatureServiceGetOrganizationFeaturesResponse] + # @raise [ApiError] if fails to make API call + def get_organization_features(feature_service_get_organization_features_request) + if feature_service_get_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_get_organization_features_request' when calling FeatureServiceApi.get_organization_features" + end + + result = get_organization_features_with_http_info(feature_service_get_organization_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_get_organization_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceGetOrganizationFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.get_organization_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#get_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_organization_features_with_http_info(feature_service_get_organization_features_request) + if feature_service_get_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_get_organization_features_request' when calling FeatureServiceApi.get_organization_features" + end + + path = '/zitadel.feature.v2.FeatureService/GetOrganizationFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = feature_service_get_organization_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceGetOrganizationFeaturesResponse', + nil + ) + end # Get System Features # Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceGetSystemFeaturesResponse] - def get_system_features(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.get_system_features ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::FeatureServiceApi.get_system_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/GetSystemFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [FeatureServiceGetSystemFeaturesResponse] + # @raise [ApiError] if fails to make API call + def get_system_features(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling FeatureServiceApi.get_system_features" + end + + result = get_system_features_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceGetSystemFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.get_system_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#get_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_system_features_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling FeatureServiceApi.get_system_features" + end + + path = '/zitadel.feature.v2.FeatureService/GetSystemFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceGetSystemFeaturesResponse', + nil + ) + end # Get User Features # Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user - # @param feature_service_get_user_features_request [FeatureServiceGetUserFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceGetUserFeaturesResponse] - def get_user_features(feature_service_get_user_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.get_user_features ...' # MODIFIED - end - # verify the required parameter 'feature_service_get_user_features_request' is set - if @api_client.config.client_side_validation && feature_service_get_user_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_get_user_features_request' when calling Api::FeatureServiceApi.get_user_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/GetUserFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param feature_service_get_user_features_request [FeatureServiceGetUserFeaturesRequest] + + # @return [FeatureServiceGetUserFeaturesResponse] + # @raise [ApiError] if fails to make API call + def get_user_features(feature_service_get_user_features_request) + if feature_service_get_user_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_get_user_features_request' when calling FeatureServiceApi.get_user_features" + end + + result = get_user_features_with_http_info(feature_service_get_user_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_get_user_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceGetUserFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.get_user_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#get_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_user_features_with_http_info(feature_service_get_user_features_request) + if feature_service_get_user_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_get_user_features_request' when calling FeatureServiceApi.get_user_features" + end + + path = '/zitadel.feature.v2.FeatureService/GetUserFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = feature_service_get_user_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceGetUserFeaturesResponse', + nil + ) + end # Reset Instance Features # Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceResetInstanceFeaturesResponse] - def reset_instance_features(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.reset_instance_features ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::FeatureServiceApi.reset_instance_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/ResetInstanceFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [FeatureServiceResetInstanceFeaturesResponse] + # @raise [ApiError] if fails to make API call + def reset_instance_features(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling FeatureServiceApi.reset_instance_features" + end + + result = reset_instance_features_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceResetInstanceFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.reset_instance_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#reset_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reset_instance_features_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling FeatureServiceApi.reset_instance_features" + end + + path = '/zitadel.feature.v2.FeatureService/ResetInstanceFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceResetInstanceFeaturesResponse', + nil + ) + end # Reset Organization Features # Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete - # @param feature_service_reset_organization_features_request [FeatureServiceResetOrganizationFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceResetOrganizationFeaturesResponse] - def reset_organization_features(feature_service_reset_organization_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.reset_organization_features ...' # MODIFIED - end - # verify the required parameter 'feature_service_reset_organization_features_request' is set - if @api_client.config.client_side_validation && feature_service_reset_organization_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_reset_organization_features_request' when calling Api::FeatureServiceApi.reset_organization_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/ResetOrganizationFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param feature_service_reset_organization_features_request [FeatureServiceResetOrganizationFeaturesRequest] + + # @return [FeatureServiceResetOrganizationFeaturesResponse] + # @raise [ApiError] if fails to make API call + def reset_organization_features(feature_service_reset_organization_features_request) + if feature_service_reset_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_reset_organization_features_request' when calling FeatureServiceApi.reset_organization_features" + end + + result = reset_organization_features_with_http_info(feature_service_reset_organization_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_reset_organization_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceResetOrganizationFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.reset_organization_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#reset_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reset_organization_features_with_http_info(feature_service_reset_organization_features_request) + if feature_service_reset_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_reset_organization_features_request' when calling FeatureServiceApi.reset_organization_features" + end + + path = '/zitadel.feature.v2.FeatureService/ResetOrganizationFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = feature_service_reset_organization_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceResetOrganizationFeaturesResponse', + nil + ) + end # Reset System Features # Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceResetSystemFeaturesResponse] - def reset_system_features(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.reset_system_features ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::FeatureServiceApi.reset_system_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/ResetSystemFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param body [Object] + + # @return [FeatureServiceResetSystemFeaturesResponse] + # @raise [ApiError] if fails to make API call + def reset_system_features(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling FeatureServiceApi.reset_system_features" + end + + result = reset_system_features_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceResetSystemFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.reset_system_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#reset_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reset_system_features_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling FeatureServiceApi.reset_system_features" + end + + path = '/zitadel.feature.v2.FeatureService/ResetSystemFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceResetSystemFeaturesResponse', + nil + ) + end # Reset User Features # Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete - # @param feature_service_reset_user_features_request [FeatureServiceResetUserFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceResetUserFeaturesResponse] - def reset_user_features(feature_service_reset_user_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.reset_user_features ...' # MODIFIED - end - # verify the required parameter 'feature_service_reset_user_features_request' is set - if @api_client.config.client_side_validation && feature_service_reset_user_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_reset_user_features_request' when calling Api::FeatureServiceApi.reset_user_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/ResetUserFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param feature_service_reset_user_features_request [FeatureServiceResetUserFeaturesRequest] + + # @return [FeatureServiceResetUserFeaturesResponse] + # @raise [ApiError] if fails to make API call + def reset_user_features(feature_service_reset_user_features_request) + if feature_service_reset_user_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_reset_user_features_request' when calling FeatureServiceApi.reset_user_features" + end + + result = reset_user_features_with_http_info(feature_service_reset_user_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_reset_user_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceResetUserFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.reset_user_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#reset_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reset_user_features_with_http_info(feature_service_reset_user_features_request) + if feature_service_reset_user_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_reset_user_features_request' when calling FeatureServiceApi.reset_user_features" + end + + path = '/zitadel.feature.v2.FeatureService/ResetUserFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = feature_service_reset_user_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceResetUserFeaturesResponse', + nil + ) + end # Set Instance Features # Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write - # @param feature_service_set_instance_features_request [FeatureServiceSetInstanceFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceSetInstanceFeaturesResponse] - def set_instance_features(feature_service_set_instance_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.set_instance_features ...' # MODIFIED - end - # verify the required parameter 'feature_service_set_instance_features_request' is set - if @api_client.config.client_side_validation && feature_service_set_instance_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_set_instance_features_request' when calling Api::FeatureServiceApi.set_instance_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/SetInstanceFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param feature_service_set_instance_features_request [FeatureServiceSetInstanceFeaturesRequest] + + # @return [FeatureServiceSetInstanceFeaturesResponse] + # @raise [ApiError] if fails to make API call + def set_instance_features(feature_service_set_instance_features_request) + if feature_service_set_instance_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_set_instance_features_request' when calling FeatureServiceApi.set_instance_features" + end + + result = set_instance_features_with_http_info(feature_service_set_instance_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_set_instance_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceSetInstanceFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.set_instance_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#set_instance_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_instance_features_with_http_info(feature_service_set_instance_features_request) + if feature_service_set_instance_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_set_instance_features_request' when calling FeatureServiceApi.set_instance_features" + end + + path = '/zitadel.feature.v2.FeatureService/SetInstanceFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = feature_service_set_instance_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceSetInstanceFeaturesResponse', + nil + ) + end # Set Organization Features # Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write - # @param feature_service_set_organization_features_request [FeatureServiceSetOrganizationFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceSetOrganizationFeaturesResponse] - def set_organization_features(feature_service_set_organization_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.set_organization_features ...' # MODIFIED - end - # verify the required parameter 'feature_service_set_organization_features_request' is set - if @api_client.config.client_side_validation && feature_service_set_organization_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_set_organization_features_request' when calling Api::FeatureServiceApi.set_organization_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/SetOrganizationFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param feature_service_set_organization_features_request [FeatureServiceSetOrganizationFeaturesRequest] + + # @return [FeatureServiceSetOrganizationFeaturesResponse] + # @raise [ApiError] if fails to make API call + def set_organization_features(feature_service_set_organization_features_request) + if feature_service_set_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_set_organization_features_request' when calling FeatureServiceApi.set_organization_features" + end + + result = set_organization_features_with_http_info(feature_service_set_organization_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_set_organization_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceSetOrganizationFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.set_organization_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#set_organization_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_organization_features_with_http_info(feature_service_set_organization_features_request) + if feature_service_set_organization_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_set_organization_features_request' when calling FeatureServiceApi.set_organization_features" + end + + path = '/zitadel.feature.v2.FeatureService/SetOrganizationFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = feature_service_set_organization_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceSetOrganizationFeaturesResponse', + nil + ) + end # Set System Features # Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write - # @param feature_service_set_system_features_request [FeatureServiceSetSystemFeaturesRequest] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceSetSystemFeaturesResponse] - def set_system_features(feature_service_set_system_features_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.set_system_features ...' # MODIFIED - end - # verify the required parameter 'feature_service_set_system_features_request' is set - if @api_client.config.client_side_validation && feature_service_set_system_features_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_set_system_features_request' when calling Api::FeatureServiceApi.set_system_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/SetSystemFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param feature_service_set_system_features_request [FeatureServiceSetSystemFeaturesRequest] + + # @return [FeatureServiceSetSystemFeaturesResponse] + # @raise [ApiError] if fails to make API call + def set_system_features(feature_service_set_system_features_request) + if feature_service_set_system_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_set_system_features_request' when calling FeatureServiceApi.set_system_features" + end + + result = set_system_features_with_http_info(feature_service_set_system_features_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_set_system_features_request) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceSetSystemFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.set_system_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#set_system_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_system_features_with_http_info(feature_service_set_system_features_request) + if feature_service_set_system_features_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_set_system_features_request' when calling FeatureServiceApi.set_system_features" + end + + path = '/zitadel.feature.v2.FeatureService/SetSystemFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = feature_service_set_system_features_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceSetSystemFeaturesResponse', + nil + ) + end # Set User Features # Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write - # @param feature_service_set_user_feature_request [FeatureServiceSetUserFeatureRequest] - # @param [Hash] opts the optional parameters - # @return [FeatureServiceSetUserFeaturesResponse] - def set_user_features(feature_service_set_user_feature_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::FeatureServiceApi.set_user_features ...' # MODIFIED - end - # verify the required parameter 'feature_service_set_user_feature_request' is set - if @api_client.config.client_side_validation && feature_service_set_user_feature_request.nil? - fail ArgumentError, "Missing the required parameter 'feature_service_set_user_feature_request' when calling Api::FeatureServiceApi.set_user_features" # MODIFIED - end - # resource path - local_var_path = '/zitadel.feature.v2.FeatureService/SetUserFeatures' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # @param feature_service_set_user_feature_request [FeatureServiceSetUserFeatureRequest] + + # @return [FeatureServiceSetUserFeaturesResponse] + # @raise [ApiError] if fails to make API call + def set_user_features(feature_service_set_user_feature_request) + if feature_service_set_user_feature_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_set_user_feature_request' when calling FeatureServiceApi.set_user_features" + end + + result = set_user_features_with_http_info(feature_service_set_user_feature_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(feature_service_set_user_feature_request) - - # return_type - return_type = opts[:debug_return_type] || 'FeatureServiceSetUserFeaturesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::FeatureServiceApi.set_user_features", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::FeatureServiceApi#set_user_features\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_user_features_with_http_info(feature_service_set_user_feature_request) + if feature_service_set_user_feature_request.nil? + raise ArgumentError, + "Missing the required parameter 'feature_service_set_user_feature_request' when calling FeatureServiceApi.set_user_features" + end + + path = '/zitadel.feature.v2.FeatureService/SetUserFeatures' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = feature_service_set_user_feature_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'FeatureServiceSetUserFeaturesResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/identity_provider_service_api.rb b/lib/zitadel/client/api/identity_provider_service_api.rb index 1451c653..d456816f 100644 --- a/lib/zitadel/client/api/identity_provider_service_api.rb +++ b/lib/zitadel/client/api/identity_provider_service_api.rb @@ -1,80 +1,75 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +# :nodoc: +module Zitadel::Client + module Api -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class IdentityProviderServiceApi - attr_accessor :api_client + # IdentityProviderServiceApi provides methods for the IdentityProviderService API group. + class IdentityProviderServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Get identity provider (IdP) by ID # Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. - # @param identity_provider_service_get_idpby_id_request [IdentityProviderServiceGetIDPByIDRequest] - # @param [Hash] opts the optional parameters - # @return [IdentityProviderServiceGetIDPByIDResponse] - def get_idpby_id(identity_provider_service_get_idpby_id_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::IdentityProviderServiceApi.get_idpby_id ...' # MODIFIED - end - # verify the required parameter 'identity_provider_service_get_idpby_id_request' is set - if @api_client.config.client_side_validation && identity_provider_service_get_idpby_id_request.nil? - fail ArgumentError, "Missing the required parameter 'identity_provider_service_get_idpby_id_request' when calling Api::IdentityProviderServiceApi.get_idpby_id" # MODIFIED - end - # resource path - local_var_path = '/zitadel.idp.v2.IdentityProviderService/GetIDPByID' + # @param identity_provider_service_get_idpby_id_request [IdentityProviderServiceGetIDPByIDRequest] - # query parameters - query_params = opts[:query_params] || {} + # @return [IdentityProviderServiceGetIDPByIDResponse] + # @raise [ApiError] if fails to make API call + def get_idpby_id(identity_provider_service_get_idpby_id_request) + if identity_provider_service_get_idpby_id_request.nil? + raise ArgumentError, + "Missing the required parameter 'identity_provider_service_get_idpby_id_request' when calling IdentityProviderServiceApi.get_idpby_id" + end - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + result = get_idpby_id_with_http_info(identity_provider_service_get_idpby_id_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_idpby_id_with_http_info(identity_provider_service_get_idpby_id_request) + if identity_provider_service_get_idpby_id_request.nil? + raise ArgumentError, + "Missing the required parameter 'identity_provider_service_get_idpby_id_request' when calling IdentityProviderServiceApi.get_idpby_id" + end - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_provider_service_get_idpby_id_request) + path = '/zitadel.idp.v2.IdentityProviderService/GetIDPByID' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = identity_provider_service_get_idpby_id_request - # return_type - return_type = opts[:debug_return_type] || 'IdentityProviderServiceGetIDPByIDResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::IdentityProviderServiceApi.get_idpby_id", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::IdentityProviderServiceApi#get_idpby_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'IdentityProviderServiceGetIDPByIDResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/instance_service_api.rb b/lib/zitadel/client/api/instance_service_api.rb index 49a385cd..248c59ec 100644 --- a/lib/zitadel/client/api/instance_service_api.rb +++ b/lib/zitadel/client/api/instance_service_api.rb @@ -1,602 +1,552 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class InstanceServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # InstanceServiceApi provides methods for the InstanceService API group. + class InstanceServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Add Custom Domain - # Adds a custom domain to the instance. The custom domain must be unique across all instances. Once the domain is added, it will be used to route requests to this instance. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.domain.write` - # @param instance_service_add_custom_domain_request [InstanceServiceAddCustomDomainRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceAddCustomDomainResponse] - def add_custom_domain(instance_service_add_custom_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.add_custom_domain ...' # MODIFIED - end - # verify the required parameter 'instance_service_add_custom_domain_request' is set - if @api_client.config.client_side_validation && instance_service_add_custom_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_add_custom_domain_request' when calling Api::InstanceServiceApi.add_custom_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/AddCustomDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Adds a custom domain to the instance. The custom domain must be unique across all instances. Once the domain is added, it will be used to route requests to this instance. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.domain.write` + # @param instance_service_add_custom_domain_request [InstanceServiceAddCustomDomainRequest] + + # @return [InstanceServiceAddCustomDomainResponse] + # @raise [ApiError] if fails to make API call + def add_custom_domain(instance_service_add_custom_domain_request) + if instance_service_add_custom_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_add_custom_domain_request' when calling InstanceServiceApi.add_custom_domain" + end + + result = add_custom_domain_with_http_info(instance_service_add_custom_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_add_custom_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceAddCustomDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.add_custom_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#add_custom_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_custom_domain_with_http_info(instance_service_add_custom_domain_request) + if instance_service_add_custom_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_add_custom_domain_request' when calling InstanceServiceApi.add_custom_domain" + end + + path = '/zitadel.instance.v2.InstanceService/AddCustomDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_add_custom_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceAddCustomDomainResponse', + nil + ) + end # Add Trusted Domain - # Adds a trusted domain to the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. It must be a valid domain name. Once the domain is added, it can be used in API responses like OIDC discovery, email templates, and more. This can be used in cases where the API is accessed through a different domain than the instance domain, e.g. proxy setups and custom login UIs. Unlike custom domain, trusted domains are not used to route requests to this instance and therefore do not need to be uniquely assigned to an instance. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) - # @param instance_service_add_trusted_domain_request [InstanceServiceAddTrustedDomainRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceAddTrustedDomainResponse] - def add_trusted_domain(instance_service_add_trusted_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.add_trusted_domain ...' # MODIFIED - end - # verify the required parameter 'instance_service_add_trusted_domain_request' is set - if @api_client.config.client_side_validation && instance_service_add_trusted_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_add_trusted_domain_request' when calling Api::InstanceServiceApi.add_trusted_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/AddTrustedDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Adds a trusted domain to the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. It must be a valid domain name. Once the domain is added, it can be used in API responses like OIDC discovery, email templates, and more. This can be used in cases where the API is accessed through a different domain than the instance domain, e.g. proxy setups and custom login UIs. Unlike custom domain, trusted domains are not used to route requests to this instance and therefore do not need to be uniquely assigned to an instance. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) + # @param instance_service_add_trusted_domain_request [InstanceServiceAddTrustedDomainRequest] + + # @return [InstanceServiceAddTrustedDomainResponse] + # @raise [ApiError] if fails to make API call + def add_trusted_domain(instance_service_add_trusted_domain_request) + if instance_service_add_trusted_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_add_trusted_domain_request' when calling InstanceServiceApi.add_trusted_domain" + end + + result = add_trusted_domain_with_http_info(instance_service_add_trusted_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_add_trusted_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceAddTrustedDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.add_trusted_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#add_trusted_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_trusted_domain_with_http_info(instance_service_add_trusted_domain_request) + if instance_service_add_trusted_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_add_trusted_domain_request' when calling InstanceServiceApi.add_trusted_domain" + end + + path = '/zitadel.instance.v2.InstanceService/AddTrustedDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_add_trusted_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceAddTrustedDomainResponse', + nil + ) + end # Delete Instance - # Deletes an instance with the given ID. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.instance.delete` - # @param instance_service_delete_instance_request [InstanceServiceDeleteInstanceRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceDeleteInstanceResponse] - def delete_instance(instance_service_delete_instance_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.delete_instance ...' # MODIFIED - end - # verify the required parameter 'instance_service_delete_instance_request' is set - if @api_client.config.client_side_validation && instance_service_delete_instance_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_delete_instance_request' when calling Api::InstanceServiceApi.delete_instance" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/DeleteInstance' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deletes an instance with the given ID. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.instance.delete` + # @param instance_service_delete_instance_request [InstanceServiceDeleteInstanceRequest] + + # @return [InstanceServiceDeleteInstanceResponse] + # @raise [ApiError] if fails to make API call + def delete_instance(instance_service_delete_instance_request) + if instance_service_delete_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_delete_instance_request' when calling InstanceServiceApi.delete_instance" + end + + result = delete_instance_with_http_info(instance_service_delete_instance_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_delete_instance_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceDeleteInstanceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.delete_instance", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#delete_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_instance_with_http_info(instance_service_delete_instance_request) + if instance_service_delete_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_delete_instance_request' when calling InstanceServiceApi.delete_instance" + end + + path = '/zitadel.instance.v2.InstanceService/DeleteInstance' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_delete_instance_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceDeleteInstanceResponse', + nil + ) + end # Get Instance - # Returns the instance in the current context or by its ID. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to retrieve a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) - # @param instance_service_get_instance_request [InstanceServiceGetInstanceRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceGetInstanceResponse] - def get_instance(instance_service_get_instance_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.get_instance ...' # MODIFIED - end - # verify the required parameter 'instance_service_get_instance_request' is set - if @api_client.config.client_side_validation && instance_service_get_instance_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_get_instance_request' when calling Api::InstanceServiceApi.get_instance" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/GetInstance' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Returns the instance in the current context or by its ID. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to retrieve a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) + # @param instance_service_get_instance_request [InstanceServiceGetInstanceRequest] + + # @return [InstanceServiceGetInstanceResponse] + # @raise [ApiError] if fails to make API call + def get_instance(instance_service_get_instance_request) + if instance_service_get_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_get_instance_request' when calling InstanceServiceApi.get_instance" + end + + result = get_instance_with_http_info(instance_service_get_instance_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_get_instance_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceGetInstanceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.get_instance", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#get_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_instance_with_http_info(instance_service_get_instance_request) + if instance_service_get_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_get_instance_request' when calling InstanceServiceApi.get_instance" + end + + path = '/zitadel.instance.v2.InstanceService/GetInstance' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_get_instance_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceGetInstanceResponse', + nil + ) + end # List Custom Domains - # Lists custom domains of the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) - # @param instance_service_list_custom_domains_request [InstanceServiceListCustomDomainsRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceListCustomDomainsResponse] - def list_custom_domains(instance_service_list_custom_domains_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.list_custom_domains ...' # MODIFIED - end - # verify the required parameter 'instance_service_list_custom_domains_request' is set - if @api_client.config.client_side_validation && instance_service_list_custom_domains_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_list_custom_domains_request' when calling Api::InstanceServiceApi.list_custom_domains" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/ListCustomDomains' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Lists custom domains of the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) + # @param instance_service_list_custom_domains_request [InstanceServiceListCustomDomainsRequest] + + # @return [InstanceServiceListCustomDomainsResponse] + # @raise [ApiError] if fails to make API call + def list_custom_domains(instance_service_list_custom_domains_request) + if instance_service_list_custom_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_list_custom_domains_request' when calling InstanceServiceApi.list_custom_domains" + end + + result = list_custom_domains_with_http_info(instance_service_list_custom_domains_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_list_custom_domains_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceListCustomDomainsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.list_custom_domains", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#list_custom_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_custom_domains_with_http_info(instance_service_list_custom_domains_request) + if instance_service_list_custom_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_list_custom_domains_request' when calling InstanceServiceApi.list_custom_domains" + end + + path = '/zitadel.instance.v2.InstanceService/ListCustomDomains' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_list_custom_domains_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceListCustomDomainsResponse', + nil + ) + end # List Instances - # Lists instances matching the given query. The query can be used to filter either by instance ID or domain. The request is paginated and returns 100 results by default. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.instance.read` - # @param instance_service_list_instances_request [InstanceServiceListInstancesRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceListInstancesResponse] - def list_instances(instance_service_list_instances_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.list_instances ...' # MODIFIED - end - # verify the required parameter 'instance_service_list_instances_request' is set - if @api_client.config.client_side_validation && instance_service_list_instances_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_list_instances_request' when calling Api::InstanceServiceApi.list_instances" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/ListInstances' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Lists instances matching the given query. The query can be used to filter either by instance ID or domain. The request is paginated and returns 100 results by default. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.instance.read` + # @param instance_service_list_instances_request [InstanceServiceListInstancesRequest] + + # @return [InstanceServiceListInstancesResponse] + # @raise [ApiError] if fails to make API call + def list_instances(instance_service_list_instances_request) + if instance_service_list_instances_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_list_instances_request' when calling InstanceServiceApi.list_instances" + end + + result = list_instances_with_http_info(instance_service_list_instances_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_list_instances_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceListInstancesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.list_instances", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#list_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_instances_with_http_info(instance_service_list_instances_request) + if instance_service_list_instances_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_list_instances_request' when calling InstanceServiceApi.list_instances" + end + + path = '/zitadel.instance.v2.InstanceService/ListInstances' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_list_instances_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceListInstancesResponse', + nil + ) + end # List Trusted Domains - # Lists trusted domains of the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) - # @param instance_service_list_trusted_domains_request [InstanceServiceListTrustedDomainsRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceListTrustedDomainsResponse] - def list_trusted_domains(instance_service_list_trusted_domains_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.list_trusted_domains ...' # MODIFIED - end - # verify the required parameter 'instance_service_list_trusted_domains_request' is set - if @api_client.config.client_side_validation && instance_service_list_trusted_domains_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_list_trusted_domains_request' when calling Api::InstanceServiceApi.list_trusted_domains" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/ListTrustedDomains' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Lists trusted domains of the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) + # @param instance_service_list_trusted_domains_request [InstanceServiceListTrustedDomainsRequest] + + # @return [InstanceServiceListTrustedDomainsResponse] + # @raise [ApiError] if fails to make API call + def list_trusted_domains(instance_service_list_trusted_domains_request) + if instance_service_list_trusted_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_list_trusted_domains_request' when calling InstanceServiceApi.list_trusted_domains" + end + + result = list_trusted_domains_with_http_info(instance_service_list_trusted_domains_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_list_trusted_domains_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceListTrustedDomainsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.list_trusted_domains", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#list_trusted_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_trusted_domains_with_http_info(instance_service_list_trusted_domains_request) + if instance_service_list_trusted_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_list_trusted_domains_request' when calling InstanceServiceApi.list_trusted_domains" + end + + path = '/zitadel.instance.v2.InstanceService/ListTrustedDomains' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_list_trusted_domains_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceListTrustedDomainsResponse', + nil + ) + end # Remove Custom Domain - # Removes a custom domain from the instance. Be aware that this will stop routing requests from this domain to the instance and might break existing setups or integrations. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.domain.write` - # @param instance_service_remove_custom_domain_request [InstanceServiceRemoveCustomDomainRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceRemoveCustomDomainResponse] - def remove_custom_domain(instance_service_remove_custom_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.remove_custom_domain ...' # MODIFIED - end - # verify the required parameter 'instance_service_remove_custom_domain_request' is set - if @api_client.config.client_side_validation && instance_service_remove_custom_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_remove_custom_domain_request' when calling Api::InstanceServiceApi.remove_custom_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/RemoveCustomDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Removes a custom domain from the instance. Be aware that this will stop routing requests from this domain to the instance and might break existing setups or integrations. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.domain.write` + # @param instance_service_remove_custom_domain_request [InstanceServiceRemoveCustomDomainRequest] + + # @return [InstanceServiceRemoveCustomDomainResponse] + # @raise [ApiError] if fails to make API call + def remove_custom_domain(instance_service_remove_custom_domain_request) + if instance_service_remove_custom_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_remove_custom_domain_request' when calling InstanceServiceApi.remove_custom_domain" + end + + result = remove_custom_domain_with_http_info(instance_service_remove_custom_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_remove_custom_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceRemoveCustomDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.remove_custom_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#remove_custom_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_custom_domain_with_http_info(instance_service_remove_custom_domain_request) + if instance_service_remove_custom_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_remove_custom_domain_request' when calling InstanceServiceApi.remove_custom_domain" + end + + path = '/zitadel.instance.v2.InstanceService/RemoveCustomDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_remove_custom_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceRemoveCustomDomainResponse', + nil + ) + end # Remove Trusted Domain - # Removes a trusted domain from the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) - # @param instance_service_remove_trusted_domain_request [InstanceServiceRemoveTrustedDomainRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceRemoveTrustedDomainResponse] - def remove_trusted_domain(instance_service_remove_trusted_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.remove_trusted_domain ...' # MODIFIED - end - # verify the required parameter 'instance_service_remove_trusted_domain_request' is set - if @api_client.config.client_side_validation && instance_service_remove_trusted_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_remove_trusted_domain_request' when calling Api::InstanceServiceApi.remove_trusted_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/RemoveTrustedDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Removes a trusted domain from the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) + # @param instance_service_remove_trusted_domain_request [InstanceServiceRemoveTrustedDomainRequest] + + # @return [InstanceServiceRemoveTrustedDomainResponse] + # @raise [ApiError] if fails to make API call + def remove_trusted_domain(instance_service_remove_trusted_domain_request) + if instance_service_remove_trusted_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_remove_trusted_domain_request' when calling InstanceServiceApi.remove_trusted_domain" + end + + result = remove_trusted_domain_with_http_info(instance_service_remove_trusted_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_remove_trusted_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceRemoveTrustedDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.remove_trusted_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#remove_trusted_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_trusted_domain_with_http_info(instance_service_remove_trusted_domain_request) + if instance_service_remove_trusted_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_remove_trusted_domain_request' when calling InstanceServiceApi.remove_trusted_domain" + end + + path = '/zitadel.instance.v2.InstanceService/RemoveTrustedDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_remove_trusted_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceRemoveTrustedDomainResponse', + nil + ) + end # Update Instance - # Updates instance's name in the current context or by its ID. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to update a specific instance. This requires additional permissions. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) - # @param instance_service_update_instance_request [InstanceServiceUpdateInstanceRequest] - # @param [Hash] opts the optional parameters - # @return [InstanceServiceUpdateInstanceResponse] - def update_instance(instance_service_update_instance_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InstanceServiceApi.update_instance ...' # MODIFIED - end - # verify the required parameter 'instance_service_update_instance_request' is set - if @api_client.config.client_side_validation && instance_service_update_instance_request.nil? - fail ArgumentError, "Missing the required parameter 'instance_service_update_instance_request' when calling Api::InstanceServiceApi.update_instance" # MODIFIED - end - # resource path - local_var_path = '/zitadel.instance.v2.InstanceService/UpdateInstance' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Updates instance's name in the current context or by its ID. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to update a specific instance. This requires additional permissions. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) + # @param instance_service_update_instance_request [InstanceServiceUpdateInstanceRequest] + + # @return [InstanceServiceUpdateInstanceResponse] + # @raise [ApiError] if fails to make API call + def update_instance(instance_service_update_instance_request) + if instance_service_update_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_update_instance_request' when calling InstanceServiceApi.update_instance" + end + + result = update_instance_with_http_info(instance_service_update_instance_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(instance_service_update_instance_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstanceServiceUpdateInstanceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InstanceServiceApi.update_instance", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InstanceServiceApi#update_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_instance_with_http_info(instance_service_update_instance_request) + if instance_service_update_instance_request.nil? + raise ArgumentError, + "Missing the required parameter 'instance_service_update_instance_request' when calling InstanceServiceApi.update_instance" + end + + path = '/zitadel.instance.v2.InstanceService/UpdateInstance' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = instance_service_update_instance_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InstanceServiceUpdateInstanceResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/internal_permission_service_api.rb b/lib/zitadel/client/api/internal_permission_service_api.rb index 5e4573d5..d718f457 100644 --- a/lib/zitadel/client/api/internal_permission_service_api.rb +++ b/lib/zitadel/client/api/internal_permission_service_api.rb @@ -1,254 +1,234 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class InternalPermissionServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # InternalPermissionServiceApi provides methods for the InternalPermissionService API group. + class InternalPermissionServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Create Administrator - # CreateAdministrator grants an administrator role to a user for a specific resource. Note that the roles are specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators - # @param internal_permission_service_create_administrator_request [InternalPermissionServiceCreateAdministratorRequest] - # @param [Hash] opts the optional parameters - # @return [InternalPermissionServiceCreateAdministratorResponse] - def create_administrator(internal_permission_service_create_administrator_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InternalPermissionServiceApi.create_administrator ...' # MODIFIED - end - # verify the required parameter 'internal_permission_service_create_administrator_request' is set - if @api_client.config.client_side_validation && internal_permission_service_create_administrator_request.nil? - fail ArgumentError, "Missing the required parameter 'internal_permission_service_create_administrator_request' when calling Api::InternalPermissionServiceApi.create_administrator" # MODIFIED - end - # resource path - local_var_path = '/zitadel.internal_permission.v2.InternalPermissionService/CreateAdministrator' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # CreateAdministrator grants an administrator role to a user for a specific resource. Note that the roles are specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + # @param internal_permission_service_create_administrator_request [InternalPermissionServiceCreateAdministratorRequest] + + # @return [InternalPermissionServiceCreateAdministratorResponse] + # @raise [ApiError] if fails to make API call + def create_administrator(internal_permission_service_create_administrator_request) + if internal_permission_service_create_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'internal_permission_service_create_administrator_request' when calling InternalPermissionServiceApi.create_administrator" + end + + result = create_administrator_with_http_info(internal_permission_service_create_administrator_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(internal_permission_service_create_administrator_request) - - # return_type - return_type = opts[:debug_return_type] || 'InternalPermissionServiceCreateAdministratorResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InternalPermissionServiceApi.create_administrator", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InternalPermissionServiceApi#create_administrator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_administrator_with_http_info(internal_permission_service_create_administrator_request) + if internal_permission_service_create_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'internal_permission_service_create_administrator_request' when calling InternalPermissionServiceApi.create_administrator" + end + + path = '/zitadel.internal_permission.v2.InternalPermissionService/CreateAdministrator' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = internal_permission_service_create_administrator_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InternalPermissionServiceCreateAdministratorResponse', + nil + ) + end # Delete Administrator - # DeleteAdministrator revokes an administrator role from a user. In case the administrator role is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the administrator role was deleted during the request. Required permissions depend on the resource type: - \"iam.member.delete\" for instance administrators - \"org.member.delete\" for organization administrators - \"project.member.delete\" for project administrators - \"project.grant.member.delete\" for project grant administrators - # @param internal_permission_service_delete_administrator_request [InternalPermissionServiceDeleteAdministratorRequest] - # @param [Hash] opts the optional parameters - # @return [InternalPermissionServiceDeleteAdministratorResponse] - def delete_administrator(internal_permission_service_delete_administrator_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InternalPermissionServiceApi.delete_administrator ...' # MODIFIED - end - # verify the required parameter 'internal_permission_service_delete_administrator_request' is set - if @api_client.config.client_side_validation && internal_permission_service_delete_administrator_request.nil? - fail ArgumentError, "Missing the required parameter 'internal_permission_service_delete_administrator_request' when calling Api::InternalPermissionServiceApi.delete_administrator" # MODIFIED - end - # resource path - local_var_path = '/zitadel.internal_permission.v2.InternalPermissionService/DeleteAdministrator' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # DeleteAdministrator revokes an administrator role from a user. In case the administrator role is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the administrator role was deleted during the request. Required permissions depend on the resource type: - \"iam.member.delete\" for instance administrators - \"org.member.delete\" for organization administrators - \"project.member.delete\" for project administrators - \"project.grant.member.delete\" for project grant administrators + # @param internal_permission_service_delete_administrator_request [InternalPermissionServiceDeleteAdministratorRequest] + + # @return [InternalPermissionServiceDeleteAdministratorResponse] + # @raise [ApiError] if fails to make API call + def delete_administrator(internal_permission_service_delete_administrator_request) + if internal_permission_service_delete_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'internal_permission_service_delete_administrator_request' when calling InternalPermissionServiceApi.delete_administrator" + end + + result = delete_administrator_with_http_info(internal_permission_service_delete_administrator_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(internal_permission_service_delete_administrator_request) - - # return_type - return_type = opts[:debug_return_type] || 'InternalPermissionServiceDeleteAdministratorResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InternalPermissionServiceApi.delete_administrator", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InternalPermissionServiceApi#delete_administrator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_administrator_with_http_info(internal_permission_service_delete_administrator_request) + if internal_permission_service_delete_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'internal_permission_service_delete_administrator_request' when calling InternalPermissionServiceApi.delete_administrator" + end + + path = '/zitadel.internal_permission.v2.InternalPermissionService/DeleteAdministrator' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = internal_permission_service_delete_administrator_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InternalPermissionServiceDeleteAdministratorResponse', + nil + ) + end # List Administrators - # ListAdministrators returns all administrators and their roles matching the request and the caller's permissions to retrieve. Required permissions depend on the resource type: - \"iam.member.read\" for instance administrators - \"org.member.read\" for organization administrators - \"project.member.read\" for project administrators - \"project.grant.member.read\" for project grant administrators - no permissions required for listing own administrator roles - # @param internal_permission_service_list_administrators_request [InternalPermissionServiceListAdministratorsRequest] - # @param [Hash] opts the optional parameters - # @return [InternalPermissionServiceListAdministratorsResponse] - def list_administrators(internal_permission_service_list_administrators_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InternalPermissionServiceApi.list_administrators ...' # MODIFIED - end - # verify the required parameter 'internal_permission_service_list_administrators_request' is set - if @api_client.config.client_side_validation && internal_permission_service_list_administrators_request.nil? - fail ArgumentError, "Missing the required parameter 'internal_permission_service_list_administrators_request' when calling Api::InternalPermissionServiceApi.list_administrators" # MODIFIED - end - # resource path - local_var_path = '/zitadel.internal_permission.v2.InternalPermissionService/ListAdministrators' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # ListAdministrators returns all administrators and their roles matching the request and the caller's permissions to retrieve. Required permissions depend on the resource type: - \"iam.member.read\" for instance administrators - \"org.member.read\" for organization administrators - \"project.member.read\" for project administrators - \"project.grant.member.read\" for project grant administrators - no permissions required for listing own administrator roles + # @param internal_permission_service_list_administrators_request [InternalPermissionServiceListAdministratorsRequest] + + # @return [InternalPermissionServiceListAdministratorsResponse] + # @raise [ApiError] if fails to make API call + def list_administrators(internal_permission_service_list_administrators_request) + if internal_permission_service_list_administrators_request.nil? + raise ArgumentError, + "Missing the required parameter 'internal_permission_service_list_administrators_request' when calling InternalPermissionServiceApi.list_administrators" + end + + result = list_administrators_with_http_info(internal_permission_service_list_administrators_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(internal_permission_service_list_administrators_request) - - # return_type - return_type = opts[:debug_return_type] || 'InternalPermissionServiceListAdministratorsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InternalPermissionServiceApi.list_administrators", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InternalPermissionServiceApi#list_administrators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_administrators_with_http_info(internal_permission_service_list_administrators_request) + if internal_permission_service_list_administrators_request.nil? + raise ArgumentError, + "Missing the required parameter 'internal_permission_service_list_administrators_request' when calling InternalPermissionServiceApi.list_administrators" + end + + path = '/zitadel.internal_permission.v2.InternalPermissionService/ListAdministrators' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = internal_permission_service_list_administrators_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InternalPermissionServiceListAdministratorsResponse', + nil + ) + end # Update Administrator - # UpdateAdministrator updates the specific administrator role. Note that any role previously granted to the user and not present in the request will be revoked. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators - # @param internal_permission_service_update_administrator_request [InternalPermissionServiceUpdateAdministratorRequest] - # @param [Hash] opts the optional parameters - # @return [InternalPermissionServiceUpdateAdministratorResponse] - def update_administrator(internal_permission_service_update_administrator_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::InternalPermissionServiceApi.update_administrator ...' # MODIFIED - end - # verify the required parameter 'internal_permission_service_update_administrator_request' is set - if @api_client.config.client_side_validation && internal_permission_service_update_administrator_request.nil? - fail ArgumentError, "Missing the required parameter 'internal_permission_service_update_administrator_request' when calling Api::InternalPermissionServiceApi.update_administrator" # MODIFIED - end - # resource path - local_var_path = '/zitadel.internal_permission.v2.InternalPermissionService/UpdateAdministrator' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # UpdateAdministrator updates the specific administrator role. Note that any role previously granted to the user and not present in the request will be revoked. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + # @param internal_permission_service_update_administrator_request [InternalPermissionServiceUpdateAdministratorRequest] + + # @return [InternalPermissionServiceUpdateAdministratorResponse] + # @raise [ApiError] if fails to make API call + def update_administrator(internal_permission_service_update_administrator_request) + if internal_permission_service_update_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'internal_permission_service_update_administrator_request' when calling InternalPermissionServiceApi.update_administrator" + end + + result = update_administrator_with_http_info(internal_permission_service_update_administrator_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(internal_permission_service_update_administrator_request) - - # return_type - return_type = opts[:debug_return_type] || 'InternalPermissionServiceUpdateAdministratorResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::InternalPermissionServiceApi.update_administrator", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::InternalPermissionServiceApi#update_administrator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_administrator_with_http_info(internal_permission_service_update_administrator_request) + if internal_permission_service_update_administrator_request.nil? + raise ArgumentError, + "Missing the required parameter 'internal_permission_service_update_administrator_request' when calling InternalPermissionServiceApi.update_administrator" + end + + path = '/zitadel.internal_permission.v2.InternalPermissionService/UpdateAdministrator' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = internal_permission_service_update_administrator_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'InternalPermissionServiceUpdateAdministratorResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/o_i_d_c_service_api.rb b/lib/zitadel/client/api/o_i_d_c_service_api.rb deleted file mode 100644 index 88c3080a..00000000 --- a/lib/zitadel/client/api/o_i_d_c_service_api.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class OIDCServiceApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Authorize or Deny Device Authorization - # Authorize or deny the device authorization request based on the provided device authorization id. Required permissions: - `session.link` - # @param oidc_service_authorize_or_deny_device_authorization_request [OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest] - # @param [Hash] opts the optional parameters - # @return [Object] - def authorize_or_deny_device_authorization(oidc_service_authorize_or_deny_device_authorization_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.authorize_or_deny_device_authorization ...' # MODIFIED - end - # verify the required parameter 'oidc_service_authorize_or_deny_device_authorization_request' is set - if @api_client.config.client_side_validation && oidc_service_authorize_or_deny_device_authorization_request.nil? - fail ArgumentError, "Missing the required parameter 'oidc_service_authorize_or_deny_device_authorization_request' when calling Api::OIDCServiceApi.authorize_or_deny_device_authorization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.oidc.v2.OIDCService/AuthorizeOrDenyDeviceAuthorization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(oidc_service_authorize_or_deny_device_authorization_request) - - # return_type - return_type = opts[:debug_return_type] || 'Object' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OIDCServiceApi.authorize_or_deny_device_authorization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OIDCServiceApi#authorize_or_deny_device_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end - - # Create Callback - # Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. Required permissions: - `session.link` - # @param oidc_service_create_callback_request [OIDCServiceCreateCallbackRequest] - # @param [Hash] opts the optional parameters - # @return [OIDCServiceCreateCallbackResponse] - def create_callback(oidc_service_create_callback_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.create_callback ...' # MODIFIED - end - # verify the required parameter 'oidc_service_create_callback_request' is set - if @api_client.config.client_side_validation && oidc_service_create_callback_request.nil? - fail ArgumentError, "Missing the required parameter 'oidc_service_create_callback_request' when calling Api::OIDCServiceApi.create_callback" # MODIFIED - end - # resource path - local_var_path = '/zitadel.oidc.v2.OIDCService/CreateCallback' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(oidc_service_create_callback_request) - - # return_type - return_type = opts[:debug_return_type] || 'OIDCServiceCreateCallbackResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OIDCServiceApi.create_callback", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OIDCServiceApi#create_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end - - # Get Auth Request - # Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. Required permissions: - `session.read` - # @param oidc_service_get_auth_request_request [OIDCServiceGetAuthRequestRequest] - # @param [Hash] opts the optional parameters - # @return [OIDCServiceGetAuthRequestResponse] - def get_auth_request(oidc_service_get_auth_request_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.get_auth_request ...' # MODIFIED - end - # verify the required parameter 'oidc_service_get_auth_request_request' is set - if @api_client.config.client_side_validation && oidc_service_get_auth_request_request.nil? - fail ArgumentError, "Missing the required parameter 'oidc_service_get_auth_request_request' when calling Api::OIDCServiceApi.get_auth_request" # MODIFIED - end - # resource path - local_var_path = '/zitadel.oidc.v2.OIDCService/GetAuthRequest' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(oidc_service_get_auth_request_request) - - # return_type - return_type = opts[:debug_return_type] || 'OIDCServiceGetAuthRequestResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OIDCServiceApi.get_auth_request", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OIDCServiceApi#get_auth_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end - - # Get Device Authorization Request - # Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. Required permissions: - `session.read` - # @param oidc_service_get_device_authorization_request_request [OIDCServiceGetDeviceAuthorizationRequestRequest] - # @param [Hash] opts the optional parameters - # @return [OIDCServiceGetDeviceAuthorizationRequestResponse] - def get_device_authorization_request(oidc_service_get_device_authorization_request_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OIDCServiceApi.get_device_authorization_request ...' # MODIFIED - end - # verify the required parameter 'oidc_service_get_device_authorization_request_request' is set - if @api_client.config.client_side_validation && oidc_service_get_device_authorization_request_request.nil? - fail ArgumentError, "Missing the required parameter 'oidc_service_get_device_authorization_request_request' when calling Api::OIDCServiceApi.get_device_authorization_request" # MODIFIED - end - # resource path - local_var_path = '/zitadel.oidc.v2.OIDCService/GetDeviceAuthorizationRequest' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(oidc_service_get_device_authorization_request_request) - - # return_type - return_type = opts[:debug_return_type] || 'OIDCServiceGetDeviceAuthorizationRequestResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OIDCServiceApi.get_device_authorization_request", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OIDCServiceApi#get_device_authorization_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end - end -end diff --git a/lib/zitadel/client/api/oidc_service_api.rb b/lib/zitadel/client/api/oidc_service_api.rb new file mode 100644 index 00000000..6e415ba1 --- /dev/null +++ b/lib/zitadel/client/api/oidc_service_api.rb @@ -0,0 +1,234 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # OIDCServiceApi provides methods for the OIDCService API group. + class OIDCServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end + + # Authorize or Deny Device Authorization + # Authorize or deny the device authorization request based on the provided device authorization id. Required permissions: - `session.link` + # @param oidc_service_authorize_or_deny_device_authorization_request [OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest] + + # @return [Object] + # @raise [ApiError] if fails to make API call + def authorize_or_deny_device_authorization(oidc_service_authorize_or_deny_device_authorization_request) + if oidc_service_authorize_or_deny_device_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'oidc_service_authorize_or_deny_device_authorization_request' when calling OIDCServiceApi.authorize_or_deny_device_authorization" + end + + result = authorize_or_deny_device_authorization_with_http_info(oidc_service_authorize_or_deny_device_authorization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def authorize_or_deny_device_authorization_with_http_info(oidc_service_authorize_or_deny_device_authorization_request) + if oidc_service_authorize_or_deny_device_authorization_request.nil? + raise ArgumentError, + "Missing the required parameter 'oidc_service_authorize_or_deny_device_authorization_request' when calling OIDCServiceApi.authorize_or_deny_device_authorization" + end + + path = '/zitadel.oidc.v2.OIDCService/AuthorizeOrDenyDeviceAuthorization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = oidc_service_authorize_or_deny_device_authorization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'Object', + nil + ) + end + + # Create Callback + # Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. Required permissions: - `session.link` + # @param oidc_service_create_callback_request [OIDCServiceCreateCallbackRequest] + + # @return [OIDCServiceCreateCallbackResponse] + # @raise [ApiError] if fails to make API call + def create_callback(oidc_service_create_callback_request) + if oidc_service_create_callback_request.nil? + raise ArgumentError, + "Missing the required parameter 'oidc_service_create_callback_request' when calling OIDCServiceApi.create_callback" + end + + result = create_callback_with_http_info(oidc_service_create_callback_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_callback_with_http_info(oidc_service_create_callback_request) + if oidc_service_create_callback_request.nil? + raise ArgumentError, + "Missing the required parameter 'oidc_service_create_callback_request' when calling OIDCServiceApi.create_callback" + end + + path = '/zitadel.oidc.v2.OIDCService/CreateCallback' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = oidc_service_create_callback_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OIDCServiceCreateCallbackResponse', + nil + ) + end + + # Get Auth Request + # Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. Required permissions: - `session.read` + # @param oidc_service_get_auth_request_request [OIDCServiceGetAuthRequestRequest] + + # @return [OIDCServiceGetAuthRequestResponse] + # @raise [ApiError] if fails to make API call + def get_auth_request(oidc_service_get_auth_request_request) + if oidc_service_get_auth_request_request.nil? + raise ArgumentError, + "Missing the required parameter 'oidc_service_get_auth_request_request' when calling OIDCServiceApi.get_auth_request" + end + + result = get_auth_request_with_http_info(oidc_service_get_auth_request_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_auth_request_with_http_info(oidc_service_get_auth_request_request) + if oidc_service_get_auth_request_request.nil? + raise ArgumentError, + "Missing the required parameter 'oidc_service_get_auth_request_request' when calling OIDCServiceApi.get_auth_request" + end + + path = '/zitadel.oidc.v2.OIDCService/GetAuthRequest' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = oidc_service_get_auth_request_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OIDCServiceGetAuthRequestResponse', + nil + ) + end + + # Get Device Authorization Request + # Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. Required permissions: - `session.read` + # @param oidc_service_get_device_authorization_request_request [OIDCServiceGetDeviceAuthorizationRequestRequest] + + # @return [OIDCServiceGetDeviceAuthorizationRequestResponse] + # @raise [ApiError] if fails to make API call + def get_device_authorization_request(oidc_service_get_device_authorization_request_request) + if oidc_service_get_device_authorization_request_request.nil? + raise ArgumentError, + "Missing the required parameter 'oidc_service_get_device_authorization_request_request' when calling OIDCServiceApi.get_device_authorization_request" + end + + result = get_device_authorization_request_with_http_info(oidc_service_get_device_authorization_request_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_device_authorization_request_with_http_info(oidc_service_get_device_authorization_request_request) + if oidc_service_get_device_authorization_request_request.nil? + raise ArgumentError, + "Missing the required parameter 'oidc_service_get_device_authorization_request_request' when calling OIDCServiceApi.get_device_authorization_request" + end + + path = '/zitadel.oidc.v2.OIDCService/GetDeviceAuthorizationRequest' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = oidc_service_get_device_authorization_request_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OIDCServiceGetDeviceAuthorizationRequestResponse', + nil + ) + end + end + end +end diff --git a/lib/zitadel/client/api/organization_service_api.rb b/lib/zitadel/client/api/organization_service_api.rb index df831fbd..0a35581a 100644 --- a/lib/zitadel/client/api/organization_service_api.rb +++ b/lib/zitadel/client/api/organization_service_api.rb @@ -1,834 +1,764 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class OrganizationServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # OrganizationServiceApi provides methods for the OrganizationService API group. + class OrganizationServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Activate Organization - # Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again. Required permission: - `org.write` - # @param organization_service_activate_organization_request [OrganizationServiceActivateOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceActivateOrganizationResponse] - def activate_organization(organization_service_activate_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.activate_organization ...' # MODIFIED - end - # verify the required parameter 'organization_service_activate_organization_request' is set - if @api_client.config.client_side_validation && organization_service_activate_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_activate_organization_request' when calling Api::OrganizationServiceApi.activate_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/ActivateOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again. Required permission: - `org.write` + # @param organization_service_activate_organization_request [OrganizationServiceActivateOrganizationRequest] + + # @return [OrganizationServiceActivateOrganizationResponse] + # @raise [ApiError] if fails to make API call + def activate_organization(organization_service_activate_organization_request) + if organization_service_activate_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_activate_organization_request' when calling OrganizationServiceApi.activate_organization" + end + + result = activate_organization_with_http_info(organization_service_activate_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_activate_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceActivateOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.activate_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#activate_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_organization_with_http_info(organization_service_activate_organization_request) + if organization_service_activate_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_activate_organization_request' when calling OrganizationServiceApi.activate_organization" + end + + path = '/zitadel.org.v2.OrganizationService/ActivateOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_activate_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceActivateOrganizationResponse', + nil + ) + end # Add Organization - # Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. Required permission: - `org.create` - # @param organization_service_add_organization_request [OrganizationServiceAddOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceAddOrganizationResponse] - def add_organization(organization_service_add_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.add_organization ...' # MODIFIED - end - # verify the required parameter 'organization_service_add_organization_request' is set - if @api_client.config.client_side_validation && organization_service_add_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_add_organization_request' when calling Api::OrganizationServiceApi.add_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/AddOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. Required permission: - `org.create` + # @param organization_service_add_organization_request [OrganizationServiceAddOrganizationRequest] + + # @return [OrganizationServiceAddOrganizationResponse] + # @raise [ApiError] if fails to make API call + def add_organization(organization_service_add_organization_request) + if organization_service_add_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_add_organization_request' when calling OrganizationServiceApi.add_organization" + end + + result = add_organization_with_http_info(organization_service_add_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_add_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceAddOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.add_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#add_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_organization_with_http_info(organization_service_add_organization_request) + if organization_service_add_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_add_organization_request' when calling OrganizationServiceApi.add_organization" + end + + path = '/zitadel.org.v2.OrganizationService/AddOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_add_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceAddOrganizationResponse', + nil + ) + end # Add Organization Domain - # Add a new domain to an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.write` - # @param organization_service_add_organization_domain_request [OrganizationServiceAddOrganizationDomainRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceAddOrganizationDomainResponse] - def add_organization_domain(organization_service_add_organization_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.add_organization_domain ...' # MODIFIED - end - # verify the required parameter 'organization_service_add_organization_domain_request' is set - if @api_client.config.client_side_validation && organization_service_add_organization_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_add_organization_domain_request' when calling Api::OrganizationServiceApi.add_organization_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/AddOrganizationDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Add a new domain to an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.write` + # @param organization_service_add_organization_domain_request [OrganizationServiceAddOrganizationDomainRequest] + + # @return [OrganizationServiceAddOrganizationDomainResponse] + # @raise [ApiError] if fails to make API call + def add_organization_domain(organization_service_add_organization_domain_request) + if organization_service_add_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_add_organization_domain_request' when calling OrganizationServiceApi.add_organization_domain" + end + + result = add_organization_domain_with_http_info(organization_service_add_organization_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_add_organization_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceAddOrganizationDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.add_organization_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#add_organization_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_organization_domain_with_http_info(organization_service_add_organization_domain_request) + if organization_service_add_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_add_organization_domain_request' when calling OrganizationServiceApi.add_organization_domain" + end + + path = '/zitadel.org.v2.OrganizationService/AddOrganizationDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_add_organization_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceAddOrganizationDomainResponse', + nil + ) + end # Deactivate Organization - # Sets the state of my organization to deactivated. Users of this organization will not be able to log in. Required permission: - `org.write` - # @param organization_service_deactivate_organization_request [OrganizationServiceDeactivateOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceDeactivateOrganizationResponse] - def deactivate_organization(organization_service_deactivate_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.deactivate_organization ...' # MODIFIED - end - # verify the required parameter 'organization_service_deactivate_organization_request' is set - if @api_client.config.client_side_validation && organization_service_deactivate_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_deactivate_organization_request' when calling Api::OrganizationServiceApi.deactivate_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/DeactivateOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Sets the state of my organization to deactivated. Users of this organization will not be able to log in. Required permission: - `org.write` + # @param organization_service_deactivate_organization_request [OrganizationServiceDeactivateOrganizationRequest] + + # @return [OrganizationServiceDeactivateOrganizationResponse] + # @raise [ApiError] if fails to make API call + def deactivate_organization(organization_service_deactivate_organization_request) + if organization_service_deactivate_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_deactivate_organization_request' when calling OrganizationServiceApi.deactivate_organization" + end + + result = deactivate_organization_with_http_info(organization_service_deactivate_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_deactivate_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceDeactivateOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.deactivate_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#deactivate_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_organization_with_http_info(organization_service_deactivate_organization_request) + if organization_service_deactivate_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_deactivate_organization_request' when calling OrganizationServiceApi.deactivate_organization" + end + + path = '/zitadel.org.v2.OrganizationService/DeactivateOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_deactivate_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceDeactivateOrganizationResponse', + nil + ) + end # Delete Organization - # Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in. Required permission: - `org.delete` - # @param organization_service_delete_organization_request [OrganizationServiceDeleteOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceDeleteOrganizationResponse] - def delete_organization(organization_service_delete_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.delete_organization ...' # MODIFIED - end - # verify the required parameter 'organization_service_delete_organization_request' is set - if @api_client.config.client_side_validation && organization_service_delete_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_delete_organization_request' when calling Api::OrganizationServiceApi.delete_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/DeleteOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in. Required permission: - `org.delete` + # @param organization_service_delete_organization_request [OrganizationServiceDeleteOrganizationRequest] + + # @return [OrganizationServiceDeleteOrganizationResponse] + # @raise [ApiError] if fails to make API call + def delete_organization(organization_service_delete_organization_request) + if organization_service_delete_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_delete_organization_request' when calling OrganizationServiceApi.delete_organization" + end + + result = delete_organization_with_http_info(organization_service_delete_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_delete_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceDeleteOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.delete_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#delete_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_organization_with_http_info(organization_service_delete_organization_request) + if organization_service_delete_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_delete_organization_request' when calling OrganizationServiceApi.delete_organization" + end + + path = '/zitadel.org.v2.OrganizationService/DeleteOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_delete_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceDeleteOrganizationResponse', + nil + ) + end # Delete Organization Domain - # Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead. Required permission: - `org.write` - # @param organization_service_delete_organization_domain_request [OrganizationServiceDeleteOrganizationDomainRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceDeleteOrganizationDomainResponse] - def delete_organization_domain(organization_service_delete_organization_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.delete_organization_domain ...' # MODIFIED - end - # verify the required parameter 'organization_service_delete_organization_domain_request' is set - if @api_client.config.client_side_validation && organization_service_delete_organization_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_delete_organization_domain_request' when calling Api::OrganizationServiceApi.delete_organization_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/DeleteOrganizationDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead. Required permission: - `org.write` + # @param organization_service_delete_organization_domain_request [OrganizationServiceDeleteOrganizationDomainRequest] + + # @return [OrganizationServiceDeleteOrganizationDomainResponse] + # @raise [ApiError] if fails to make API call + def delete_organization_domain(organization_service_delete_organization_domain_request) + if organization_service_delete_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_delete_organization_domain_request' when calling OrganizationServiceApi.delete_organization_domain" + end + + result = delete_organization_domain_with_http_info(organization_service_delete_organization_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_delete_organization_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceDeleteOrganizationDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.delete_organization_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#delete_organization_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_organization_domain_with_http_info(organization_service_delete_organization_domain_request) + if organization_service_delete_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_delete_organization_domain_request' when calling OrganizationServiceApi.delete_organization_domain" + end + + path = '/zitadel.org.v2.OrganizationService/DeleteOrganizationDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_delete_organization_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceDeleteOrganizationDomainResponse', + nil + ) + end # Delete Organization Metadata - # Delete metadata objects from an organization with a specific key. Required permission: - `org.write` - # @param organization_service_delete_organization_metadata_request [OrganizationServiceDeleteOrganizationMetadataRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceDeleteOrganizationMetadataResponse] - def delete_organization_metadata(organization_service_delete_organization_metadata_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.delete_organization_metadata ...' # MODIFIED - end - # verify the required parameter 'organization_service_delete_organization_metadata_request' is set - if @api_client.config.client_side_validation && organization_service_delete_organization_metadata_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_delete_organization_metadata_request' when calling Api::OrganizationServiceApi.delete_organization_metadata" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/DeleteOrganizationMetadata' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Delete metadata objects from an organization with a specific key. Required permission: - `org.write` + # @param organization_service_delete_organization_metadata_request [OrganizationServiceDeleteOrganizationMetadataRequest] + + # @return [OrganizationServiceDeleteOrganizationMetadataResponse] + # @raise [ApiError] if fails to make API call + def delete_organization_metadata(organization_service_delete_organization_metadata_request) + if organization_service_delete_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_delete_organization_metadata_request' when calling OrganizationServiceApi.delete_organization_metadata" + end + + result = delete_organization_metadata_with_http_info(organization_service_delete_organization_metadata_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_delete_organization_metadata_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceDeleteOrganizationMetadataResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.delete_organization_metadata", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#delete_organization_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_organization_metadata_with_http_info(organization_service_delete_organization_metadata_request) + if organization_service_delete_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_delete_organization_metadata_request' when calling OrganizationServiceApi.delete_organization_metadata" + end + + path = '/zitadel.org.v2.OrganizationService/DeleteOrganizationMetadata' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_delete_organization_metadata_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceDeleteOrganizationMetadataResponse', + nil + ) + end # Generate Organization Domain Validation - # Generate a new file to be able to verify your domain with DNS or HTTP challenge. Required permission: - `org.write` - # @param organization_service_generate_organization_domain_validation_request [OrganizationServiceGenerateOrganizationDomainValidationRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceGenerateOrganizationDomainValidationResponse] - def generate_organization_domain_validation(organization_service_generate_organization_domain_validation_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.generate_organization_domain_validation ...' # MODIFIED - end - # verify the required parameter 'organization_service_generate_organization_domain_validation_request' is set - if @api_client.config.client_side_validation && organization_service_generate_organization_domain_validation_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_generate_organization_domain_validation_request' when calling Api::OrganizationServiceApi.generate_organization_domain_validation" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/GenerateOrganizationDomainValidation' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Generate a new file to be able to verify your domain with DNS or HTTP challenge. Required permission: - `org.write` + # @param organization_service_generate_organization_domain_validation_request [OrganizationServiceGenerateOrganizationDomainValidationRequest] + + # @return [OrganizationServiceGenerateOrganizationDomainValidationResponse] + # @raise [ApiError] if fails to make API call + def generate_organization_domain_validation(organization_service_generate_organization_domain_validation_request) + if organization_service_generate_organization_domain_validation_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_generate_organization_domain_validation_request' when calling OrganizationServiceApi.generate_organization_domain_validation" + end + + result = generate_organization_domain_validation_with_http_info(organization_service_generate_organization_domain_validation_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_generate_organization_domain_validation_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceGenerateOrganizationDomainValidationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.generate_organization_domain_validation", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#generate_organization_domain_validation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def generate_organization_domain_validation_with_http_info(organization_service_generate_organization_domain_validation_request) + if organization_service_generate_organization_domain_validation_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_generate_organization_domain_validation_request' when calling OrganizationServiceApi.generate_organization_domain_validation" + end + + path = '/zitadel.org.v2.OrganizationService/GenerateOrganizationDomainValidation' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_generate_organization_domain_validation_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceGenerateOrganizationDomainValidationResponse', + nil + ) + end # List Organization Domains - # Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.read` - # @param organization_service_list_organization_domains_request [OrganizationServiceListOrganizationDomainsRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceListOrganizationDomainsResponse] - def list_organization_domains(organization_service_list_organization_domains_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.list_organization_domains ...' # MODIFIED - end - # verify the required parameter 'organization_service_list_organization_domains_request' is set - if @api_client.config.client_side_validation && organization_service_list_organization_domains_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_list_organization_domains_request' when calling Api::OrganizationServiceApi.list_organization_domains" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/ListOrganizationDomains' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.read` + # @param organization_service_list_organization_domains_request [OrganizationServiceListOrganizationDomainsRequest] + + # @return [OrganizationServiceListOrganizationDomainsResponse] + # @raise [ApiError] if fails to make API call + def list_organization_domains(organization_service_list_organization_domains_request) + if organization_service_list_organization_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_list_organization_domains_request' when calling OrganizationServiceApi.list_organization_domains" + end + + result = list_organization_domains_with_http_info(organization_service_list_organization_domains_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_list_organization_domains_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceListOrganizationDomainsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.list_organization_domains", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#list_organization_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_organization_domains_with_http_info(organization_service_list_organization_domains_request) + if organization_service_list_organization_domains_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_list_organization_domains_request' when calling OrganizationServiceApi.list_organization_domains" + end + + path = '/zitadel.org.v2.OrganizationService/ListOrganizationDomains' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_list_organization_domains_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceListOrganizationDomainsResponse', + nil + ) + end # List Organization Metadata - # List metadata of an organization filtered by query. Required permission: - `org.read` - # @param organization_service_list_organization_metadata_request [OrganizationServiceListOrganizationMetadataRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceListOrganizationMetadataResponse] - def list_organization_metadata(organization_service_list_organization_metadata_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.list_organization_metadata ...' # MODIFIED - end - # verify the required parameter 'organization_service_list_organization_metadata_request' is set - if @api_client.config.client_side_validation && organization_service_list_organization_metadata_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_list_organization_metadata_request' when calling Api::OrganizationServiceApi.list_organization_metadata" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/ListOrganizationMetadata' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # List metadata of an organization filtered by query. Required permission: - `org.read` + # @param organization_service_list_organization_metadata_request [OrganizationServiceListOrganizationMetadataRequest] + + # @return [OrganizationServiceListOrganizationMetadataResponse] + # @raise [ApiError] if fails to make API call + def list_organization_metadata(organization_service_list_organization_metadata_request) + if organization_service_list_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_list_organization_metadata_request' when calling OrganizationServiceApi.list_organization_metadata" + end + + result = list_organization_metadata_with_http_info(organization_service_list_organization_metadata_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_list_organization_metadata_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceListOrganizationMetadataResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.list_organization_metadata", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#list_organization_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_organization_metadata_with_http_info(organization_service_list_organization_metadata_request) + if organization_service_list_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_list_organization_metadata_request' when calling OrganizationServiceApi.list_organization_metadata" + end + + path = '/zitadel.org.v2.OrganizationService/ListOrganizationMetadata' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_list_organization_metadata_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceListOrganizationMetadataResponse', + nil + ) + end # List Organizations - # Search for Organizations. By default, we will return all organization of the instance that you have permission to read. Make sure to include a limit and sorting for pagination. Required permission: - `org.read` - # @param organization_service_list_organizations_request [OrganizationServiceListOrganizationsRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceListOrganizationsResponse] - def list_organizations(organization_service_list_organizations_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.list_organizations ...' # MODIFIED - end - # verify the required parameter 'organization_service_list_organizations_request' is set - if @api_client.config.client_side_validation && organization_service_list_organizations_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_list_organizations_request' when calling Api::OrganizationServiceApi.list_organizations" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/ListOrganizations' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Search for Organizations. By default, we will return all organization of the instance that you have permission to read. Make sure to include a limit and sorting for pagination. Required permission: - `org.read` + # @param organization_service_list_organizations_request [OrganizationServiceListOrganizationsRequest] + + # @return [OrganizationServiceListOrganizationsResponse] + # @raise [ApiError] if fails to make API call + def list_organizations(organization_service_list_organizations_request) + if organization_service_list_organizations_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_list_organizations_request' when calling OrganizationServiceApi.list_organizations" + end + + result = list_organizations_with_http_info(organization_service_list_organizations_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_list_organizations_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceListOrganizationsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.list_organizations", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#list_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_organizations_with_http_info(organization_service_list_organizations_request) + if organization_service_list_organizations_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_list_organizations_request' when calling OrganizationServiceApi.list_organizations" + end + + path = '/zitadel.org.v2.OrganizationService/ListOrganizations' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_list_organizations_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceListOrganizationsResponse', + nil + ) + end # Set Organization Metadata - # Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded. Required permission: - `org.write` - # @param organization_service_set_organization_metadata_request [OrganizationServiceSetOrganizationMetadataRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceSetOrganizationMetadataResponse] - def set_organization_metadata(organization_service_set_organization_metadata_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.set_organization_metadata ...' # MODIFIED - end - # verify the required parameter 'organization_service_set_organization_metadata_request' is set - if @api_client.config.client_side_validation && organization_service_set_organization_metadata_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_set_organization_metadata_request' when calling Api::OrganizationServiceApi.set_organization_metadata" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/SetOrganizationMetadata' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded. Required permission: - `org.write` + # @param organization_service_set_organization_metadata_request [OrganizationServiceSetOrganizationMetadataRequest] + + # @return [OrganizationServiceSetOrganizationMetadataResponse] + # @raise [ApiError] if fails to make API call + def set_organization_metadata(organization_service_set_organization_metadata_request) + if organization_service_set_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_set_organization_metadata_request' when calling OrganizationServiceApi.set_organization_metadata" + end + + result = set_organization_metadata_with_http_info(organization_service_set_organization_metadata_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_set_organization_metadata_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceSetOrganizationMetadataResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.set_organization_metadata", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#set_organization_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_organization_metadata_with_http_info(organization_service_set_organization_metadata_request) + if organization_service_set_organization_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_set_organization_metadata_request' when calling OrganizationServiceApi.set_organization_metadata" + end + + path = '/zitadel.org.v2.OrganizationService/SetOrganizationMetadata' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_set_organization_metadata_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceSetOrganizationMetadataResponse', + nil + ) + end # Update Organization - # Change the name of the organization. Required permission: - `org.write` - # @param organization_service_update_organization_request [OrganizationServiceUpdateOrganizationRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceUpdateOrganizationResponse] - def update_organization(organization_service_update_organization_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.update_organization ...' # MODIFIED - end - # verify the required parameter 'organization_service_update_organization_request' is set - if @api_client.config.client_side_validation && organization_service_update_organization_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_update_organization_request' when calling Api::OrganizationServiceApi.update_organization" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/UpdateOrganization' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Change the name of the organization. Required permission: - `org.write` + # @param organization_service_update_organization_request [OrganizationServiceUpdateOrganizationRequest] + + # @return [OrganizationServiceUpdateOrganizationResponse] + # @raise [ApiError] if fails to make API call + def update_organization(organization_service_update_organization_request) + if organization_service_update_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_update_organization_request' when calling OrganizationServiceApi.update_organization" + end + + result = update_organization_with_http_info(organization_service_update_organization_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_update_organization_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceUpdateOrganizationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.update_organization", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#update_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_organization_with_http_info(organization_service_update_organization_request) + if organization_service_update_organization_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_update_organization_request' when calling OrganizationServiceApi.update_organization" + end + + path = '/zitadel.org.v2.OrganizationService/UpdateOrganization' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_update_organization_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceUpdateOrganizationResponse', + nil + ) + end # Verify Organization Domain - # Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique. Required permission: - `org.write` - # @param organization_service_verify_organization_domain_request [OrganizationServiceVerifyOrganizationDomainRequest] - # @param [Hash] opts the optional parameters - # @return [OrganizationServiceVerifyOrganizationDomainResponse] - def verify_organization_domain(organization_service_verify_organization_domain_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::OrganizationServiceApi.verify_organization_domain ...' # MODIFIED - end - # verify the required parameter 'organization_service_verify_organization_domain_request' is set - if @api_client.config.client_side_validation && organization_service_verify_organization_domain_request.nil? - fail ArgumentError, "Missing the required parameter 'organization_service_verify_organization_domain_request' when calling Api::OrganizationServiceApi.verify_organization_domain" # MODIFIED - end - # resource path - local_var_path = '/zitadel.org.v2.OrganizationService/VerifyOrganizationDomain' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique. Required permission: - `org.write` + # @param organization_service_verify_organization_domain_request [OrganizationServiceVerifyOrganizationDomainRequest] + + # @return [OrganizationServiceVerifyOrganizationDomainResponse] + # @raise [ApiError] if fails to make API call + def verify_organization_domain(organization_service_verify_organization_domain_request) + if organization_service_verify_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_verify_organization_domain_request' when calling OrganizationServiceApi.verify_organization_domain" + end + + result = verify_organization_domain_with_http_info(organization_service_verify_organization_domain_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(organization_service_verify_organization_domain_request) - - # return_type - return_type = opts[:debug_return_type] || 'OrganizationServiceVerifyOrganizationDomainResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::OrganizationServiceApi.verify_organization_domain", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::OrganizationServiceApi#verify_organization_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_organization_domain_with_http_info(organization_service_verify_organization_domain_request) + if organization_service_verify_organization_domain_request.nil? + raise ArgumentError, + "Missing the required parameter 'organization_service_verify_organization_domain_request' when calling OrganizationServiceApi.verify_organization_domain" + end + + path = '/zitadel.org.v2.OrganizationService/VerifyOrganizationDomain' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = organization_service_verify_organization_domain_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'OrganizationServiceVerifyOrganizationDomainResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/project_service_api.rb b/lib/zitadel/client/api/project_service_api.rb index 75af5b51..b2150fd9 100644 --- a/lib/zitadel/client/api/project_service_api.rb +++ b/lib/zitadel/client/api/project_service_api.rb @@ -1,1008 +1,923 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class ProjectServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # ProjectServiceApi provides methods for the ProjectService API group. + class ProjectServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Activate Project - # Set the state of a project to active. Request returns no error if the project is already activated. Required permission: - `project.write` - # @param project_service_activate_project_request [ProjectServiceActivateProjectRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceActivateProjectResponse] - def activate_project(project_service_activate_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.activate_project ...' # MODIFIED - end - # verify the required parameter 'project_service_activate_project_request' is set - if @api_client.config.client_side_validation && project_service_activate_project_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_activate_project_request' when calling Api::ProjectServiceApi.activate_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/ActivateProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_activate_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceActivateProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.activate_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#activate_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Set the state of a project to active. Request returns no error if the project is already activated. Required permission: - `project.write` + # @param project_service_activate_project_request [ProjectServiceActivateProjectRequest] + + # @return [ProjectServiceActivateProjectResponse] + # @raise [ApiError] if fails to make API call + def activate_project(project_service_activate_project_request) + if project_service_activate_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_activate_project_request' when calling ProjectServiceApi.activate_project" + end + + result = activate_project_with_http_info(project_service_activate_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_project_with_http_info(project_service_activate_project_request) + if project_service_activate_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_activate_project_request' when calling ProjectServiceApi.activate_project" + end + + path = '/zitadel.project.v2.ProjectService/ActivateProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_activate_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceActivateProjectResponse', + nil + ) + end # Activate Project Grant - # Set the state of the project grant to activated. Required permission: - `project.grant.write` - # @param project_service_activate_project_grant_request [ProjectServiceActivateProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceActivateProjectGrantResponse] - def activate_project_grant(project_service_activate_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.activate_project_grant ...' # MODIFIED - end - # verify the required parameter 'project_service_activate_project_grant_request' is set - if @api_client.config.client_side_validation && project_service_activate_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_activate_project_grant_request' when calling Api::ProjectServiceApi.activate_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/ActivateProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_activate_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceActivateProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.activate_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#activate_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Set the state of the project grant to activated. Required permission: - `project.grant.write` + # @param project_service_activate_project_grant_request [ProjectServiceActivateProjectGrantRequest] + + # @return [ProjectServiceActivateProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def activate_project_grant(project_service_activate_project_grant_request) + if project_service_activate_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_activate_project_grant_request' when calling ProjectServiceApi.activate_project_grant" + end + + result = activate_project_grant_with_http_info(project_service_activate_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_project_grant_with_http_info(project_service_activate_project_grant_request) + if project_service_activate_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_activate_project_grant_request' when calling ProjectServiceApi.activate_project_grant" + end + + path = '/zitadel.project.v2.ProjectService/ActivateProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_activate_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceActivateProjectGrantResponse', + nil + ) + end # Add Project Role - # Add a new project role to a project. The key must be unique within the project. Required permission: - `project.role.write` - # @param project_service_add_project_role_request [ProjectServiceAddProjectRoleRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceAddProjectRoleResponse] - def add_project_role(project_service_add_project_role_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.add_project_role ...' # MODIFIED - end - # verify the required parameter 'project_service_add_project_role_request' is set - if @api_client.config.client_side_validation && project_service_add_project_role_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_add_project_role_request' when calling Api::ProjectServiceApi.add_project_role" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/AddProjectRole' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_add_project_role_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceAddProjectRoleResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.add_project_role", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#add_project_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Add a new project role to a project. The key must be unique within the project. Required permission: - `project.role.write` + # @param project_service_add_project_role_request [ProjectServiceAddProjectRoleRequest] + + # @return [ProjectServiceAddProjectRoleResponse] + # @raise [ApiError] if fails to make API call + def add_project_role(project_service_add_project_role_request) + if project_service_add_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_add_project_role_request' when calling ProjectServiceApi.add_project_role" + end + + result = add_project_role_with_http_info(project_service_add_project_role_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_project_role_with_http_info(project_service_add_project_role_request) + if project_service_add_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_add_project_role_request' when calling ProjectServiceApi.add_project_role" + end + + path = '/zitadel.project.v2.ProjectService/AddProjectRole' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_add_project_role_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceAddProjectRoleResponse', + nil + ) + end # Create Project - # Create a new project. A project is a vessel to group applications, roles and authorizations. Every project belongs to exactly one organization, but can be granted to other organizations for self-management of their authorizations. Required permission: - `project.create` - # @param project_service_create_project_request [ProjectServiceCreateProjectRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceCreateProjectResponse] - def create_project(project_service_create_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.create_project ...' # MODIFIED - end - # verify the required parameter 'project_service_create_project_request' is set - if @api_client.config.client_side_validation && project_service_create_project_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_create_project_request' when calling Api::ProjectServiceApi.create_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/CreateProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_create_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceCreateProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.create_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Create a new project. A project is a vessel to group applications, roles and authorizations. Every project belongs to exactly one organization, but can be granted to other organizations for self-management of their authorizations. Required permission: - `project.create` + # @param project_service_create_project_request [ProjectServiceCreateProjectRequest] + + # @return [ProjectServiceCreateProjectResponse] + # @raise [ApiError] if fails to make API call + def create_project(project_service_create_project_request) + if project_service_create_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_create_project_request' when calling ProjectServiceApi.create_project" + end + + result = create_project_with_http_info(project_service_create_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_project_with_http_info(project_service_create_project_request) + if project_service_create_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_create_project_request' when calling ProjectServiceApi.create_project" + end + + path = '/zitadel.project.v2.ProjectService/CreateProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_create_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceCreateProjectResponse', + nil + ) + end # Create Project Grant - # Grant a project to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.create` - # @param project_service_create_project_grant_request [ProjectServiceCreateProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceCreateProjectGrantResponse] - def create_project_grant(project_service_create_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.create_project_grant ...' # MODIFIED - end - # verify the required parameter 'project_service_create_project_grant_request' is set - if @api_client.config.client_side_validation && project_service_create_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_create_project_grant_request' when calling Api::ProjectServiceApi.create_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/CreateProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_create_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceCreateProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.create_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#create_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Grant a project to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.create` + # @param project_service_create_project_grant_request [ProjectServiceCreateProjectGrantRequest] + + # @return [ProjectServiceCreateProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def create_project_grant(project_service_create_project_grant_request) + if project_service_create_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_create_project_grant_request' when calling ProjectServiceApi.create_project_grant" + end + + result = create_project_grant_with_http_info(project_service_create_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_project_grant_with_http_info(project_service_create_project_grant_request) + if project_service_create_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_create_project_grant_request' when calling ProjectServiceApi.create_project_grant" + end + + path = '/zitadel.project.v2.ProjectService/CreateProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_create_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceCreateProjectGrantResponse', + nil + ) + end # Deactivate Project - # Set the state of a project to deactivated. Request returns no error if the project is already deactivated. Applications under deactivated projects are not able to login anymore. Required permission: - `project.write` - # @param project_service_deactivate_project_request [ProjectServiceDeactivateProjectRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceDeactivateProjectResponse] - def deactivate_project(project_service_deactivate_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.deactivate_project ...' # MODIFIED - end - # verify the required parameter 'project_service_deactivate_project_request' is set - if @api_client.config.client_side_validation && project_service_deactivate_project_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_deactivate_project_request' when calling Api::ProjectServiceApi.deactivate_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/DeactivateProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_deactivate_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceDeactivateProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.deactivate_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#deactivate_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Set the state of a project to deactivated. Request returns no error if the project is already deactivated. Applications under deactivated projects are not able to login anymore. Required permission: - `project.write` + # @param project_service_deactivate_project_request [ProjectServiceDeactivateProjectRequest] + + # @return [ProjectServiceDeactivateProjectResponse] + # @raise [ApiError] if fails to make API call + def deactivate_project(project_service_deactivate_project_request) + if project_service_deactivate_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_deactivate_project_request' when calling ProjectServiceApi.deactivate_project" + end + + result = deactivate_project_with_http_info(project_service_deactivate_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_project_with_http_info(project_service_deactivate_project_request) + if project_service_deactivate_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_deactivate_project_request' when calling ProjectServiceApi.deactivate_project" + end + + path = '/zitadel.project.v2.ProjectService/DeactivateProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_deactivate_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceDeactivateProjectResponse', + nil + ) + end # Deactivate Project Grant - # Set the state of the project grant to deactivated. Applications under deactivated projects grants are not able to login anymore. Required permission: - `project.grant.write` - # @param project_service_deactivate_project_grant_request [ProjectServiceDeactivateProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceDeactivateProjectGrantResponse] - def deactivate_project_grant(project_service_deactivate_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.deactivate_project_grant ...' # MODIFIED - end - # verify the required parameter 'project_service_deactivate_project_grant_request' is set - if @api_client.config.client_side_validation && project_service_deactivate_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_deactivate_project_grant_request' when calling Api::ProjectServiceApi.deactivate_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/DeactivateProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_deactivate_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceDeactivateProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.deactivate_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#deactivate_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Set the state of the project grant to deactivated. Applications under deactivated projects grants are not able to login anymore. Required permission: - `project.grant.write` + # @param project_service_deactivate_project_grant_request [ProjectServiceDeactivateProjectGrantRequest] + + # @return [ProjectServiceDeactivateProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def deactivate_project_grant(project_service_deactivate_project_grant_request) + if project_service_deactivate_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_deactivate_project_grant_request' when calling ProjectServiceApi.deactivate_project_grant" + end + + result = deactivate_project_grant_with_http_info(project_service_deactivate_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_project_grant_with_http_info(project_service_deactivate_project_grant_request) + if project_service_deactivate_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_deactivate_project_grant_request' when calling ProjectServiceApi.deactivate_project_grant" + end + + path = '/zitadel.project.v2.ProjectService/DeactivateProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_deactivate_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceDeactivateProjectGrantResponse', + nil + ) + end # Delete Project - # Delete an existing project. In case the project is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.delete` - # @param project_service_delete_project_request [ProjectServiceDeleteProjectRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceDeleteProjectResponse] - def delete_project(project_service_delete_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.delete_project ...' # MODIFIED - end - # verify the required parameter 'project_service_delete_project_request' is set - if @api_client.config.client_side_validation && project_service_delete_project_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_delete_project_request' when calling Api::ProjectServiceApi.delete_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/DeleteProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_delete_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceDeleteProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.delete_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Delete an existing project. In case the project is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.delete` + # @param project_service_delete_project_request [ProjectServiceDeleteProjectRequest] + + # @return [ProjectServiceDeleteProjectResponse] + # @raise [ApiError] if fails to make API call + def delete_project(project_service_delete_project_request) + if project_service_delete_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_delete_project_request' when calling ProjectServiceApi.delete_project" + end + + result = delete_project_with_http_info(project_service_delete_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_project_with_http_info(project_service_delete_project_request) + if project_service_delete_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_delete_project_request' when calling ProjectServiceApi.delete_project" + end + + path = '/zitadel.project.v2.ProjectService/DeleteProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_delete_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceDeleteProjectResponse', + nil + ) + end # Delete Project Grant - # Delete a project grant. All user grants for this project grant will also be removed. A user will not have access to the project afterward (if permissions are checked). In case the project grant is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.grant.delete` - # @param project_service_delete_project_grant_request [ProjectServiceDeleteProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceDeleteProjectGrantResponse] - def delete_project_grant(project_service_delete_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.delete_project_grant ...' # MODIFIED - end - # verify the required parameter 'project_service_delete_project_grant_request' is set - if @api_client.config.client_side_validation && project_service_delete_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_delete_project_grant_request' when calling Api::ProjectServiceApi.delete_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/DeleteProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_delete_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceDeleteProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.delete_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#delete_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Delete a project grant. All user grants for this project grant will also be removed. A user will not have access to the project afterward (if permissions are checked). In case the project grant is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.grant.delete` + # @param project_service_delete_project_grant_request [ProjectServiceDeleteProjectGrantRequest] + + # @return [ProjectServiceDeleteProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def delete_project_grant(project_service_delete_project_grant_request) + if project_service_delete_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_delete_project_grant_request' when calling ProjectServiceApi.delete_project_grant" + end + + result = delete_project_grant_with_http_info(project_service_delete_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_project_grant_with_http_info(project_service_delete_project_grant_request) + if project_service_delete_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_delete_project_grant_request' when calling ProjectServiceApi.delete_project_grant" + end + + path = '/zitadel.project.v2.ProjectService/DeleteProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_delete_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceDeleteProjectGrantResponse', + nil + ) + end # Get Project - # Returns the project identified by the requested ID. Required permission: - `project.read` - # @param project_service_get_project_request [ProjectServiceGetProjectRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceGetProjectResponse] - def get_project(project_service_get_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.get_project ...' # MODIFIED - end - # verify the required parameter 'project_service_get_project_request' is set - if @api_client.config.client_side_validation && project_service_get_project_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_get_project_request' when calling Api::ProjectServiceApi.get_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/GetProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_get_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceGetProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.get_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Returns the project identified by the requested ID. Required permission: - `project.read` + # @param project_service_get_project_request [ProjectServiceGetProjectRequest] + + # @return [ProjectServiceGetProjectResponse] + # @raise [ApiError] if fails to make API call + def get_project(project_service_get_project_request) + if project_service_get_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_get_project_request' when calling ProjectServiceApi.get_project" + end + + result = get_project_with_http_info(project_service_get_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_project_with_http_info(project_service_get_project_request) + if project_service_get_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_get_project_request' when calling ProjectServiceApi.get_project" + end + + path = '/zitadel.project.v2.ProjectService/GetProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_get_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceGetProjectResponse', + nil + ) + end # List Project Grants - # Returns a list of project grants. A project grant is when the organization grants its project to another organization. Required permission: - `project.grant.read` - # @param project_service_list_project_grants_request [ProjectServiceListProjectGrantsRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceListProjectGrantsResponse] - def list_project_grants(project_service_list_project_grants_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.list_project_grants ...' # MODIFIED - end - # verify the required parameter 'project_service_list_project_grants_request' is set - if @api_client.config.client_side_validation && project_service_list_project_grants_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_list_project_grants_request' when calling Api::ProjectServiceApi.list_project_grants" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/ListProjectGrants' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_list_project_grants_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceListProjectGrantsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.list_project_grants", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#list_project_grants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Returns a list of project grants. A project grant is when the organization grants its project to another organization. Required permission: - `project.grant.read` + # @param project_service_list_project_grants_request [ProjectServiceListProjectGrantsRequest] + + # @return [ProjectServiceListProjectGrantsResponse] + # @raise [ApiError] if fails to make API call + def list_project_grants(project_service_list_project_grants_request) + if project_service_list_project_grants_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_list_project_grants_request' when calling ProjectServiceApi.list_project_grants" + end + + result = list_project_grants_with_http_info(project_service_list_project_grants_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_project_grants_with_http_info(project_service_list_project_grants_request) + if project_service_list_project_grants_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_list_project_grants_request' when calling ProjectServiceApi.list_project_grants" + end + + path = '/zitadel.project.v2.ProjectService/ListProjectGrants' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_list_project_grants_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceListProjectGrantsResponse', + nil + ) + end # List Project Roles - # Returns all roles of a project matching the search query. Required permission: - `project.role.read` - # @param project_service_list_project_roles_request [ProjectServiceListProjectRolesRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceListProjectRolesResponse] - def list_project_roles(project_service_list_project_roles_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.list_project_roles ...' # MODIFIED - end - # verify the required parameter 'project_service_list_project_roles_request' is set - if @api_client.config.client_side_validation && project_service_list_project_roles_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_list_project_roles_request' when calling Api::ProjectServiceApi.list_project_roles" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/ListProjectRoles' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_list_project_roles_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceListProjectRolesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.list_project_roles", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#list_project_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Returns all roles of a project matching the search query. Required permission: - `project.role.read` + # @param project_service_list_project_roles_request [ProjectServiceListProjectRolesRequest] + + # @return [ProjectServiceListProjectRolesResponse] + # @raise [ApiError] if fails to make API call + def list_project_roles(project_service_list_project_roles_request) + if project_service_list_project_roles_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_list_project_roles_request' when calling ProjectServiceApi.list_project_roles" + end + + result = list_project_roles_with_http_info(project_service_list_project_roles_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_project_roles_with_http_info(project_service_list_project_roles_request) + if project_service_list_project_roles_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_list_project_roles_request' when calling ProjectServiceApi.list_project_roles" + end + + path = '/zitadel.project.v2.ProjectService/ListProjectRoles' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_list_project_roles_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceListProjectRolesResponse', + nil + ) + end # List Projects - # List all matching projects. By default all projects of the instance that the caller has permission to read are returned. Make sure to include a limit and sorting for pagination. Required permission: - `project.read` - # @param project_service_list_projects_request [ProjectServiceListProjectsRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceListProjectsResponse] - def list_projects(project_service_list_projects_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.list_projects ...' # MODIFIED - end - # verify the required parameter 'project_service_list_projects_request' is set - if @api_client.config.client_side_validation && project_service_list_projects_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_list_projects_request' when calling Api::ProjectServiceApi.list_projects" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/ListProjects' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_list_projects_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceListProjectsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.list_projects", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#list_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # List all matching projects. By default all projects of the instance that the caller has permission to read are returned. Make sure to include a limit and sorting for pagination. Required permission: - `project.read` + # @param project_service_list_projects_request [ProjectServiceListProjectsRequest] + + # @return [ProjectServiceListProjectsResponse] + # @raise [ApiError] if fails to make API call + def list_projects(project_service_list_projects_request) + if project_service_list_projects_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_list_projects_request' when calling ProjectServiceApi.list_projects" + end + + result = list_projects_with_http_info(project_service_list_projects_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_projects_with_http_info(project_service_list_projects_request) + if project_service_list_projects_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_list_projects_request' when calling ProjectServiceApi.list_projects" + end + + path = '/zitadel.project.v2.ProjectService/ListProjects' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_list_projects_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceListProjectsResponse', + nil + ) + end # Remove Project Role - # Removes the role from the project and on every resource it has a dependency. This includes project grants and user grants. Required permission: - `project.role.write` - # @param project_service_remove_project_role_request [ProjectServiceRemoveProjectRoleRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceRemoveProjectRoleResponse] - def remove_project_role(project_service_remove_project_role_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.remove_project_role ...' # MODIFIED - end - # verify the required parameter 'project_service_remove_project_role_request' is set - if @api_client.config.client_side_validation && project_service_remove_project_role_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_remove_project_role_request' when calling Api::ProjectServiceApi.remove_project_role" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/RemoveProjectRole' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_remove_project_role_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceRemoveProjectRoleResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.remove_project_role", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#remove_project_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Removes the role from the project and on every resource it has a dependency. This includes project grants and user grants. Required permission: - `project.role.write` + # @param project_service_remove_project_role_request [ProjectServiceRemoveProjectRoleRequest] + + # @return [ProjectServiceRemoveProjectRoleResponse] + # @raise [ApiError] if fails to make API call + def remove_project_role(project_service_remove_project_role_request) + if project_service_remove_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_remove_project_role_request' when calling ProjectServiceApi.remove_project_role" + end + + result = remove_project_role_with_http_info(project_service_remove_project_role_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_project_role_with_http_info(project_service_remove_project_role_request) + if project_service_remove_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_remove_project_role_request' when calling ProjectServiceApi.remove_project_role" + end + + path = '/zitadel.project.v2.ProjectService/RemoveProjectRole' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_remove_project_role_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceRemoveProjectRoleResponse', + nil + ) + end # Update Project - # Update an existing project. Required permission: - `project.write` - # @param project_service_update_project_request [ProjectServiceUpdateProjectRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceUpdateProjectResponse] - def update_project(project_service_update_project_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.update_project ...' # MODIFIED - end - # verify the required parameter 'project_service_update_project_request' is set - if @api_client.config.client_side_validation && project_service_update_project_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_update_project_request' when calling Api::ProjectServiceApi.update_project" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/UpdateProject' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_update_project_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceUpdateProjectResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.update_project", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Update an existing project. Required permission: - `project.write` + # @param project_service_update_project_request [ProjectServiceUpdateProjectRequest] + + # @return [ProjectServiceUpdateProjectResponse] + # @raise [ApiError] if fails to make API call + def update_project(project_service_update_project_request) + if project_service_update_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_update_project_request' when calling ProjectServiceApi.update_project" + end + + result = update_project_with_http_info(project_service_update_project_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_project_with_http_info(project_service_update_project_request) + if project_service_update_project_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_update_project_request' when calling ProjectServiceApi.update_project" + end + + path = '/zitadel.project.v2.ProjectService/UpdateProject' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_update_project_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceUpdateProjectResponse', + nil + ) + end # Update Project Grant - # Change the roles of the project that is granted to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.write` - # @param project_service_update_project_grant_request [ProjectServiceUpdateProjectGrantRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceUpdateProjectGrantResponse] - def update_project_grant(project_service_update_project_grant_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.update_project_grant ...' # MODIFIED - end - # verify the required parameter 'project_service_update_project_grant_request' is set - if @api_client.config.client_side_validation && project_service_update_project_grant_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_update_project_grant_request' when calling Api::ProjectServiceApi.update_project_grant" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/UpdateProjectGrant' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_update_project_grant_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceUpdateProjectGrantResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.update_project_grant", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#update_project_grant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Change the roles of the project that is granted to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.write` + # @param project_service_update_project_grant_request [ProjectServiceUpdateProjectGrantRequest] + + # @return [ProjectServiceUpdateProjectGrantResponse] + # @raise [ApiError] if fails to make API call + def update_project_grant(project_service_update_project_grant_request) + if project_service_update_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_update_project_grant_request' when calling ProjectServiceApi.update_project_grant" + end + + result = update_project_grant_with_http_info(project_service_update_project_grant_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_project_grant_with_http_info(project_service_update_project_grant_request) + if project_service_update_project_grant_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_update_project_grant_request' when calling ProjectServiceApi.update_project_grant" + end + + path = '/zitadel.project.v2.ProjectService/UpdateProjectGrant' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_update_project_grant_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceUpdateProjectGrantResponse', + nil + ) + end # Update Project Role - # Change a project role. The key is not editable. If a key should change, remove the role and create a new one. Required permission: - `project.role.write` - # @param project_service_update_project_role_request [ProjectServiceUpdateProjectRoleRequest] - # @param [Hash] opts the optional parameters - # @return [ProjectServiceUpdateProjectRoleResponse] - def update_project_role(project_service_update_project_role_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::ProjectServiceApi.update_project_role ...' # MODIFIED - end - # verify the required parameter 'project_service_update_project_role_request' is set - if @api_client.config.client_side_validation && project_service_update_project_role_request.nil? - fail ArgumentError, "Missing the required parameter 'project_service_update_project_role_request' when calling Api::ProjectServiceApi.update_project_role" # MODIFIED - end - # resource path - local_var_path = '/zitadel.project.v2.ProjectService/UpdateProjectRole' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(project_service_update_project_role_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProjectServiceUpdateProjectRoleResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::ProjectServiceApi.update_project_role", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::ProjectServiceApi#update_project_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # Change a project role. The key is not editable. If a key should change, remove the role and create a new one. Required permission: - `project.role.write` + # @param project_service_update_project_role_request [ProjectServiceUpdateProjectRoleRequest] + + # @return [ProjectServiceUpdateProjectRoleResponse] + # @raise [ApiError] if fails to make API call + def update_project_role(project_service_update_project_role_request) + if project_service_update_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_update_project_role_request' when calling ProjectServiceApi.update_project_role" + end + + result = update_project_role_with_http_info(project_service_update_project_role_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_project_role_with_http_info(project_service_update_project_role_request) + if project_service_update_project_role_request.nil? + raise ArgumentError, + "Missing the required parameter 'project_service_update_project_role_request' when calling ProjectServiceApi.update_project_role" + end + + path = '/zitadel.project.v2.ProjectService/UpdateProjectRole' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = project_service_update_project_role_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'ProjectServiceUpdateProjectRoleResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/s_a_m_l_service_api.rb b/lib/zitadel/client/api/s_a_m_l_service_api.rb deleted file mode 100644 index 1ace2677..00000000 --- a/lib/zitadel/client/api/s_a_m_l_service_api.rb +++ /dev/null @@ -1,138 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class SAMLServiceApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # Create Response - # Finalize a SAML Request and get the response definition for success or failure. The response must be handled as per the SAML definition to inform the application about the success or failure. On success, the response contains details for the application to obtain the SAMLResponse. This method can only be called once for an SAML request. Required permissions: - `session.link` - # @param saml_service_create_response_request [SAMLServiceCreateResponseRequest] - # @param [Hash] opts the optional parameters - # @return [SAMLServiceCreateResponseResponse] - def create_response(saml_service_create_response_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SAMLServiceApi.create_response ...' # MODIFIED - end - # verify the required parameter 'saml_service_create_response_request' is set - if @api_client.config.client_side_validation && saml_service_create_response_request.nil? - fail ArgumentError, "Missing the required parameter 'saml_service_create_response_request' when calling Api::SAMLServiceApi.create_response" # MODIFIED - end - # resource path - local_var_path = '/zitadel.saml.v2.SAMLService/CreateResponse' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(saml_service_create_response_request) - - # return_type - return_type = opts[:debug_return_type] || 'SAMLServiceCreateResponseResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SAMLServiceApi.create_response", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SAMLServiceApi#create_response\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end - - # Get SAML Request - # Get SAML Request details by ID. Returns details that are parsed from the application's SAML Request. Required permissions: - `session.read` - # @param saml_service_get_saml_request_request [SAMLServiceGetSAMLRequestRequest] - # @param [Hash] opts the optional parameters - # @return [SAMLServiceGetSAMLRequestResponse] - def get_saml_request(saml_service_get_saml_request_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SAMLServiceApi.get_saml_request ...' # MODIFIED - end - # verify the required parameter 'saml_service_get_saml_request_request' is set - if @api_client.config.client_side_validation && saml_service_get_saml_request_request.nil? - fail ArgumentError, "Missing the required parameter 'saml_service_get_saml_request_request' when calling Api::SAMLServiceApi.get_saml_request" # MODIFIED - end - # resource path - local_var_path = '/zitadel.saml.v2.SAMLService/GetSAMLRequest' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(saml_service_get_saml_request_request) - - # return_type - return_type = opts[:debug_return_type] || 'SAMLServiceGetSAMLRequestResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SAMLServiceApi.get_saml_request", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SAMLServiceApi#get_saml_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end - end -end diff --git a/lib/zitadel/client/api/saml_service_api.rb b/lib/zitadel/client/api/saml_service_api.rb new file mode 100644 index 00000000..9f75b3e5 --- /dev/null +++ b/lib/zitadel/client/api/saml_service_api.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # SAMLServiceApi provides methods for the SAMLService API group. + class SAMLServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end + + # Create Response + # Finalize a SAML Request and get the response definition for success or failure. The response must be handled as per the SAML definition to inform the application about the success or failure. On success, the response contains details for the application to obtain the SAMLResponse. This method can only be called once for an SAML request. Required permissions: - `session.link` + # @param saml_service_create_response_request [SAMLServiceCreateResponseRequest] + + # @return [SAMLServiceCreateResponseResponse] + # @raise [ApiError] if fails to make API call + def create_response(saml_service_create_response_request) + if saml_service_create_response_request.nil? + raise ArgumentError, + "Missing the required parameter 'saml_service_create_response_request' when calling SAMLServiceApi.create_response" + end + + result = create_response_with_http_info(saml_service_create_response_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_response_with_http_info(saml_service_create_response_request) + if saml_service_create_response_request.nil? + raise ArgumentError, + "Missing the required parameter 'saml_service_create_response_request' when calling SAMLServiceApi.create_response" + end + + path = '/zitadel.saml.v2.SAMLService/CreateResponse' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = saml_service_create_response_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SAMLServiceCreateResponseResponse', + nil + ) + end + + # Get SAML Request + # Get SAML Request details by ID. Returns details that are parsed from the application's SAML Request. Required permissions: - `session.read` + # @param saml_service_get_saml_request_request [SAMLServiceGetSAMLRequestRequest] + + # @return [SAMLServiceGetSAMLRequestResponse] + # @raise [ApiError] if fails to make API call + def get_saml_request(saml_service_get_saml_request_request) + if saml_service_get_saml_request_request.nil? + raise ArgumentError, + "Missing the required parameter 'saml_service_get_saml_request_request' when calling SAMLServiceApi.get_saml_request" + end + + result = get_saml_request_with_http_info(saml_service_get_saml_request_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_saml_request_with_http_info(saml_service_get_saml_request_request) + if saml_service_get_saml_request_request.nil? + raise ArgumentError, + "Missing the required parameter 'saml_service_get_saml_request_request' when calling SAMLServiceApi.get_saml_request" + end + + path = '/zitadel.saml.v2.SAMLService/GetSAMLRequest' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = saml_service_get_saml_request_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SAMLServiceGetSAMLRequestResponse', + nil + ) + end + end + end +end diff --git a/lib/zitadel/client/api/session_service_api.rb b/lib/zitadel/client/api/session_service_api.rb index 2e4b79dc..db17de31 100644 --- a/lib/zitadel/client/api/session_service_api.rb +++ b/lib/zitadel/client/api/session_service_api.rb @@ -1,312 +1,287 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class SessionServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # SessionServiceApi provides methods for the SessionService API group. + class SessionServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Create Session - # Create a new session with initial checks, metadata and challenges for further verification. A token will be returned, which is required for using the session as authentication, e.g. when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. Required permissions: - `session.write` - # @param session_service_create_session_request [SessionServiceCreateSessionRequest] - # @param [Hash] opts the optional parameters - # @return [SessionServiceCreateSessionResponse] - def create_session(session_service_create_session_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.create_session ...' # MODIFIED - end - # verify the required parameter 'session_service_create_session_request' is set - if @api_client.config.client_side_validation && session_service_create_session_request.nil? - fail ArgumentError, "Missing the required parameter 'session_service_create_session_request' when calling Api::SessionServiceApi.create_session" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2.SessionService/CreateSession' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Create a new session with initial checks, metadata and challenges for further verification. A token will be returned, which is required for using the session as authentication, e.g. when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. Required permissions: - `session.write` + # @param session_service_create_session_request [SessionServiceCreateSessionRequest] + + # @return [SessionServiceCreateSessionResponse] + # @raise [ApiError] if fails to make API call + def create_session(session_service_create_session_request) + if session_service_create_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_create_session_request' when calling SessionServiceApi.create_session" + end + + result = create_session_with_http_info(session_service_create_session_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(session_service_create_session_request) - - # return_type - return_type = opts[:debug_return_type] || 'SessionServiceCreateSessionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SessionServiceApi.create_session", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SessionServiceApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_session_with_http_info(session_service_create_session_request) + if session_service_create_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_create_session_request' when calling SessionServiceApi.create_session" + end + + path = '/zitadel.session.v2.SessionService/CreateSession' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = session_service_create_session_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SessionServiceCreateSessionResponse', + nil + ) + end # DeleteSession - # Terminate an existing session. This invalidates the session and its token. The session can no longer be used for the authentication of other resources or to authenticate against the ZITADEL APIs. You can only terminate your own session, unless you are granted the `session.delete` permission. Required permissions: - `session.delete` - no permission required for own sessions or when providing the current session token - # @param session_service_delete_session_request [SessionServiceDeleteSessionRequest] - # @param [Hash] opts the optional parameters - # @return [SessionServiceDeleteSessionResponse] - def delete_session(session_service_delete_session_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.delete_session ...' # MODIFIED - end - # verify the required parameter 'session_service_delete_session_request' is set - if @api_client.config.client_side_validation && session_service_delete_session_request.nil? - fail ArgumentError, "Missing the required parameter 'session_service_delete_session_request' when calling Api::SessionServiceApi.delete_session" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2.SessionService/DeleteSession' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Terminate an existing session. This invalidates the session and its token. The session can no longer be used for the authentication of other resources or to authenticate against the ZITADEL APIs. You can only terminate your own session, unless you are granted the `session.delete` permission. Required permissions: - `session.delete` - no permission required for own sessions or when providing the current session token + # @param session_service_delete_session_request [SessionServiceDeleteSessionRequest] + + # @return [SessionServiceDeleteSessionResponse] + # @raise [ApiError] if fails to make API call + def delete_session(session_service_delete_session_request) + if session_service_delete_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_delete_session_request' when calling SessionServiceApi.delete_session" + end + + result = delete_session_with_http_info(session_service_delete_session_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(session_service_delete_session_request) - - # return_type - return_type = opts[:debug_return_type] || 'SessionServiceDeleteSessionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SessionServiceApi.delete_session", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SessionServiceApi#delete_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_session_with_http_info(session_service_delete_session_request) + if session_service_delete_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_delete_session_request' when calling SessionServiceApi.delete_session" + end + + path = '/zitadel.session.v2.SessionService/DeleteSession' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = session_service_delete_session_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SessionServiceDeleteSessionResponse', + nil + ) + end # Get Session - # Retrieve a session by its ID. Returns all information about the session, including the factors that were verified, the metadata, user agent information and possible expiration date. The session token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.read permission on either the instance or on the checked user's organization Required permissions: - `session.read` - no permission required to get own sessions (see above) or when providing the current session token - # @param session_service_get_session_request [SessionServiceGetSessionRequest] - # @param [Hash] opts the optional parameters - # @return [SessionServiceGetSessionResponse] - def get_session(session_service_get_session_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.get_session ...' # MODIFIED - end - # verify the required parameter 'session_service_get_session_request' is set - if @api_client.config.client_side_validation && session_service_get_session_request.nil? - fail ArgumentError, "Missing the required parameter 'session_service_get_session_request' when calling Api::SessionServiceApi.get_session" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2.SessionService/GetSession' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Retrieve a session by its ID. Returns all information about the session, including the factors that were verified, the metadata, user agent information and possible expiration date. The session token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.read permission on either the instance or on the checked user's organization Required permissions: - `session.read` - no permission required to get own sessions (see above) or when providing the current session token + # @param session_service_get_session_request [SessionServiceGetSessionRequest] + + # @return [SessionServiceGetSessionResponse] + # @raise [ApiError] if fails to make API call + def get_session(session_service_get_session_request) + if session_service_get_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_get_session_request' when calling SessionServiceApi.get_session" + end + + result = get_session_with_http_info(session_service_get_session_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(session_service_get_session_request) - - # return_type - return_type = opts[:debug_return_type] || 'SessionServiceGetSessionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SessionServiceApi.get_session", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SessionServiceApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_session_with_http_info(session_service_get_session_request) + if session_service_get_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_get_session_request' when calling SessionServiceApi.get_session" + end + + path = '/zitadel.session.v2.SessionService/GetSession' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = session_service_get_session_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SessionServiceGetSessionResponse', + nil + ) + end # List sessions - # Searches for sessions matching the given query. You can search by session ID, user ID, creation date, creator, user agent or expiration date. Required permissions: - `session.read` - no permission required to search for own sessions - # @param session_service_list_sessions_request [SessionServiceListSessionsRequest] - # @param [Hash] opts the optional parameters - # @return [SessionServiceListSessionsResponse] - def list_sessions(session_service_list_sessions_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.list_sessions ...' # MODIFIED - end - # verify the required parameter 'session_service_list_sessions_request' is set - if @api_client.config.client_side_validation && session_service_list_sessions_request.nil? - fail ArgumentError, "Missing the required parameter 'session_service_list_sessions_request' when calling Api::SessionServiceApi.list_sessions" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2.SessionService/ListSessions' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Searches for sessions matching the given query. You can search by session ID, user ID, creation date, creator, user agent or expiration date. Required permissions: - `session.read` - no permission required to search for own sessions + # @param session_service_list_sessions_request [SessionServiceListSessionsRequest] + + # @return [SessionServiceListSessionsResponse] + # @raise [ApiError] if fails to make API call + def list_sessions(session_service_list_sessions_request) + if session_service_list_sessions_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_list_sessions_request' when calling SessionServiceApi.list_sessions" + end + + result = list_sessions_with_http_info(session_service_list_sessions_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(session_service_list_sessions_request) - - # return_type - return_type = opts[:debug_return_type] || 'SessionServiceListSessionsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SessionServiceApi.list_sessions", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SessionServiceApi#list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_sessions_with_http_info(session_service_list_sessions_request) + if session_service_list_sessions_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_list_sessions_request' when calling SessionServiceApi.list_sessions" + end + + path = '/zitadel.session.v2.SessionService/ListSessions' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = session_service_list_sessions_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SessionServiceListSessionsResponse', + nil + ) + end # Set Session - # Update an existing session with new information like additional checks or metadata or request additional challenges. A new session token will be returned. Note that the previous token will be invalidated. Required permissions: - `session.write` - # @param session_service_set_session_request [SessionServiceSetSessionRequest] - # @param [Hash] opts the optional parameters - # @return [SessionServiceSetSessionResponse] - def set_session(session_service_set_session_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SessionServiceApi.set_session ...' # MODIFIED - end - # verify the required parameter 'session_service_set_session_request' is set - if @api_client.config.client_side_validation && session_service_set_session_request.nil? - fail ArgumentError, "Missing the required parameter 'session_service_set_session_request' when calling Api::SessionServiceApi.set_session" # MODIFIED - end - # resource path - local_var_path = '/zitadel.session.v2.SessionService/SetSession' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Update an existing session with new information like additional checks or metadata or request additional challenges. A new session token will be returned. Note that the previous token will be invalidated. Required permissions: - `session.write` + # @param session_service_set_session_request [SessionServiceSetSessionRequest] + + # @return [SessionServiceSetSessionResponse] + # @raise [ApiError] if fails to make API call + def set_session(session_service_set_session_request) + if session_service_set_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_set_session_request' when calling SessionServiceApi.set_session" + end + + result = set_session_with_http_info(session_service_set_session_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(session_service_set_session_request) - - # return_type - return_type = opts[:debug_return_type] || 'SessionServiceSetSessionResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SessionServiceApi.set_session", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SessionServiceApi#set_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_session_with_http_info(session_service_set_session_request) + if session_service_set_session_request.nil? + raise ArgumentError, + "Missing the required parameter 'session_service_set_session_request' when calling SessionServiceApi.set_session" + end + + path = '/zitadel.session.v2.SessionService/SetSession' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = session_service_set_session_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SessionServiceSetSessionResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/settings_service_api.rb b/lib/zitadel/client/api/settings_service_api.rb index 5fdc8215..ded3248f 100644 --- a/lib/zitadel/client/api/settings_service_api.rb +++ b/lib/zitadel/client/api/settings_service_api.rb @@ -1,776 +1,711 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class SettingsServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # SettingsServiceApi provides methods for the SettingsService API group. + class SettingsServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Get Active Identity Providers - # Get the current active identity providers for the requested context. This can be the instance or an organization. In case of an organization, the returned identity providers will fall back to the active instance identity providers if not explicitly set on the organization. Optionally, filter the identity providers by their allowed actions: - creation_allowed: only return identity providers that are allowed for user creation - linking_allowed: only return identity providers that are allowed for linking to existing users - auto_creation: only return identity providers that are allowed for automatic user creation - auto_linking: only return identity providers that are allowed for automatic linking to existing users Required permissions: - `policy.read` - # @param settings_service_get_active_identity_providers_request [SettingsServiceGetActiveIdentityProvidersRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetActiveIdentityProvidersResponse] - def get_active_identity_providers(settings_service_get_active_identity_providers_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_active_identity_providers ...' # MODIFIED - end - # verify the required parameter 'settings_service_get_active_identity_providers_request' is set - if @api_client.config.client_side_validation && settings_service_get_active_identity_providers_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_get_active_identity_providers_request' when calling Api::SettingsServiceApi.get_active_identity_providers" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetActiveIdentityProviders' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get the current active identity providers for the requested context. This can be the instance or an organization. In case of an organization, the returned identity providers will fall back to the active instance identity providers if not explicitly set on the organization. Optionally, filter the identity providers by their allowed actions: - creation_allowed: only return identity providers that are allowed for user creation - linking_allowed: only return identity providers that are allowed for linking to existing users - auto_creation: only return identity providers that are allowed for automatic user creation - auto_linking: only return identity providers that are allowed for automatic linking to existing users Required permissions: - `policy.read` + # @param settings_service_get_active_identity_providers_request [SettingsServiceGetActiveIdentityProvidersRequest] + + # @return [SettingsServiceGetActiveIdentityProvidersResponse] + # @raise [ApiError] if fails to make API call + def get_active_identity_providers(settings_service_get_active_identity_providers_request) + if settings_service_get_active_identity_providers_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_active_identity_providers_request' when calling SettingsServiceApi.get_active_identity_providers" + end + + result = get_active_identity_providers_with_http_info(settings_service_get_active_identity_providers_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_active_identity_providers_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetActiveIdentityProvidersResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_active_identity_providers", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_active_identity_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_active_identity_providers_with_http_info(settings_service_get_active_identity_providers_request) + if settings_service_get_active_identity_providers_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_active_identity_providers_request' when calling SettingsServiceApi.get_active_identity_providers" + end + + path = '/zitadel.settings.v2.SettingsService/GetActiveIdentityProviders' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_get_active_identity_providers_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetActiveIdentityProvidersResponse', + nil + ) + end # Get Branding Settings - # Get the current active branding settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` - # @param settings_service_get_branding_settings_request [SettingsServiceGetBrandingSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetBrandingSettingsResponse] - def get_branding_settings(settings_service_get_branding_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_branding_settings ...' # MODIFIED - end - # verify the required parameter 'settings_service_get_branding_settings_request' is set - if @api_client.config.client_side_validation && settings_service_get_branding_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_get_branding_settings_request' when calling Api::SettingsServiceApi.get_branding_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetBrandingSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get the current active branding settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + # @param settings_service_get_branding_settings_request [SettingsServiceGetBrandingSettingsRequest] + + # @return [SettingsServiceGetBrandingSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_branding_settings(settings_service_get_branding_settings_request) + if settings_service_get_branding_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_branding_settings_request' when calling SettingsServiceApi.get_branding_settings" + end + + result = get_branding_settings_with_http_info(settings_service_get_branding_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_branding_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetBrandingSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_branding_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_branding_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_branding_settings_with_http_info(settings_service_get_branding_settings_request) + if settings_service_get_branding_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_branding_settings_request' when calling SettingsServiceApi.get_branding_settings" + end + + path = '/zitadel.settings.v2.SettingsService/GetBrandingSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_get_branding_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetBrandingSettingsResponse', + nil + ) + end # Get Domain Settings - # Get the domain settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` - # @param settings_service_get_domain_settings_request [SettingsServiceGetDomainSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetDomainSettingsResponse] - def get_domain_settings(settings_service_get_domain_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_domain_settings ...' # MODIFIED - end - # verify the required parameter 'settings_service_get_domain_settings_request' is set - if @api_client.config.client_side_validation && settings_service_get_domain_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_get_domain_settings_request' when calling Api::SettingsServiceApi.get_domain_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetDomainSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get the domain settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + # @param settings_service_get_domain_settings_request [SettingsServiceGetDomainSettingsRequest] + + # @return [SettingsServiceGetDomainSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_domain_settings(settings_service_get_domain_settings_request) + if settings_service_get_domain_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_domain_settings_request' when calling SettingsServiceApi.get_domain_settings" + end + + result = get_domain_settings_with_http_info(settings_service_get_domain_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_domain_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetDomainSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_domain_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_domain_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_domain_settings_with_http_info(settings_service_get_domain_settings_request) + if settings_service_get_domain_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_domain_settings_request' when calling SettingsServiceApi.get_domain_settings" + end + + path = '/zitadel.settings.v2.SettingsService/GetDomainSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_get_domain_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetDomainSettingsResponse', + nil + ) + end # Get General Settings - # Get basic information of the instance like the default organization, default language and supported languages. Required permissions: - `policy.read` - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetGeneralSettingsResponse] - def get_general_settings(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_general_settings ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::SettingsServiceApi.get_general_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetGeneralSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get basic information of the instance like the default organization, default language and supported languages. Required permissions: - `policy.read` + # @param body [Object] + + # @return [SettingsServiceGetGeneralSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_general_settings(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling SettingsServiceApi.get_general_settings" + end + + result = get_general_settings_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetGeneralSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_general_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_general_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_general_settings_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling SettingsServiceApi.get_general_settings" + end + + path = '/zitadel.settings.v2.SettingsService/GetGeneralSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetGeneralSettingsResponse', + nil + ) + end # Get Hosted Login Translation - # Returns the translations in the requested locale for the hosted login. The translations returned are based on the input level specified (system, instance or organization). If the requested level doesn't contain all translations, and ignore_inheritance is set to false, a merging process fallbacks onto the higher levels ensuring all keys in the file have a translation, which could be in the default language if the one of the locale is missing on all levels. The etag returned in the response represents the hash of the translations as they are stored on DB and its reliable only if ignore_inheritance = true. Required permissions: - `iam.policy.read` - # @param settings_service_get_hosted_login_translation_request [SettingsServiceGetHostedLoginTranslationRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetHostedLoginTranslationResponse] - def get_hosted_login_translation(settings_service_get_hosted_login_translation_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_hosted_login_translation ...' # MODIFIED - end - # verify the required parameter 'settings_service_get_hosted_login_translation_request' is set - if @api_client.config.client_side_validation && settings_service_get_hosted_login_translation_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_get_hosted_login_translation_request' when calling Api::SettingsServiceApi.get_hosted_login_translation" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetHostedLoginTranslation' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Returns the translations in the requested locale for the hosted login. The translations returned are based on the input level specified (system, instance or organization). If the requested level doesn't contain all translations, and ignore_inheritance is set to false, a merging process fallbacks onto the higher levels ensuring all keys in the file have a translation, which could be in the default language if the one of the locale is missing on all levels. The etag returned in the response represents the hash of the translations as they are stored on DB and its reliable only if ignore_inheritance = true. Required permissions: - `iam.policy.read` + # @param settings_service_get_hosted_login_translation_request [SettingsServiceGetHostedLoginTranslationRequest] + + # @return [SettingsServiceGetHostedLoginTranslationResponse] + # @raise [ApiError] if fails to make API call + def get_hosted_login_translation(settings_service_get_hosted_login_translation_request) + if settings_service_get_hosted_login_translation_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_hosted_login_translation_request' when calling SettingsServiceApi.get_hosted_login_translation" + end + + result = get_hosted_login_translation_with_http_info(settings_service_get_hosted_login_translation_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_hosted_login_translation_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetHostedLoginTranslationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_hosted_login_translation", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_hosted_login_translation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_hosted_login_translation_with_http_info(settings_service_get_hosted_login_translation_request) + if settings_service_get_hosted_login_translation_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_hosted_login_translation_request' when calling SettingsServiceApi.get_hosted_login_translation" + end + + path = '/zitadel.settings.v2.SettingsService/GetHostedLoginTranslation' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_get_hosted_login_translation_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetHostedLoginTranslationResponse', + nil + ) + end # Get Legal and Support Settings - # Get the legal and support settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` - # @param settings_service_get_legal_and_support_settings_request [SettingsServiceGetLegalAndSupportSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetLegalAndSupportSettingsResponse] - def get_legal_and_support_settings(settings_service_get_legal_and_support_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_legal_and_support_settings ...' # MODIFIED - end - # verify the required parameter 'settings_service_get_legal_and_support_settings_request' is set - if @api_client.config.client_side_validation && settings_service_get_legal_and_support_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_get_legal_and_support_settings_request' when calling Api::SettingsServiceApi.get_legal_and_support_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetLegalAndSupportSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get the legal and support settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + # @param settings_service_get_legal_and_support_settings_request [SettingsServiceGetLegalAndSupportSettingsRequest] + + # @return [SettingsServiceGetLegalAndSupportSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_legal_and_support_settings(settings_service_get_legal_and_support_settings_request) + if settings_service_get_legal_and_support_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_legal_and_support_settings_request' when calling SettingsServiceApi.get_legal_and_support_settings" + end + + result = get_legal_and_support_settings_with_http_info(settings_service_get_legal_and_support_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_legal_and_support_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetLegalAndSupportSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_legal_and_support_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_legal_and_support_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_legal_and_support_settings_with_http_info(settings_service_get_legal_and_support_settings_request) + if settings_service_get_legal_and_support_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_legal_and_support_settings_request' when calling SettingsServiceApi.get_legal_and_support_settings" + end + + path = '/zitadel.settings.v2.SettingsService/GetLegalAndSupportSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_get_legal_and_support_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetLegalAndSupportSettingsResponse', + nil + ) + end # Get Lockout Settings - # Get the lockout settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Lockout settings define how many failed attempts are allowed before a user is locked out. Required permissions: - `policy.read` - # @param settings_service_get_lockout_settings_request [SettingsServiceGetLockoutSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetLockoutSettingsResponse] - def get_lockout_settings(settings_service_get_lockout_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_lockout_settings ...' # MODIFIED - end - # verify the required parameter 'settings_service_get_lockout_settings_request' is set - if @api_client.config.client_side_validation && settings_service_get_lockout_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_get_lockout_settings_request' when calling Api::SettingsServiceApi.get_lockout_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetLockoutSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get the lockout settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Lockout settings define how many failed attempts are allowed before a user is locked out. Required permissions: - `policy.read` + # @param settings_service_get_lockout_settings_request [SettingsServiceGetLockoutSettingsRequest] + + # @return [SettingsServiceGetLockoutSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_lockout_settings(settings_service_get_lockout_settings_request) + if settings_service_get_lockout_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_lockout_settings_request' when calling SettingsServiceApi.get_lockout_settings" + end + + result = get_lockout_settings_with_http_info(settings_service_get_lockout_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_lockout_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetLockoutSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_lockout_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_lockout_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_lockout_settings_with_http_info(settings_service_get_lockout_settings_request) + if settings_service_get_lockout_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_lockout_settings_request' when calling SettingsServiceApi.get_lockout_settings" + end + + path = '/zitadel.settings.v2.SettingsService/GetLockoutSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_get_lockout_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetLockoutSettingsResponse', + nil + ) + end # Get Login Settings - # Get the login settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` - # @param settings_service_get_login_settings_request [SettingsServiceGetLoginSettingsRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetLoginSettingsResponse] - def get_login_settings(settings_service_get_login_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_login_settings ...' # MODIFIED - end - # verify the required parameter 'settings_service_get_login_settings_request' is set - if @api_client.config.client_side_validation && settings_service_get_login_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_get_login_settings_request' when calling Api::SettingsServiceApi.get_login_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetLoginSettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get the login settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + # @param settings_service_get_login_settings_request [SettingsServiceGetLoginSettingsRequest] + + # @return [SettingsServiceGetLoginSettingsResponse] + # @raise [ApiError] if fails to make API call + def get_login_settings(settings_service_get_login_settings_request) + if settings_service_get_login_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_login_settings_request' when calling SettingsServiceApi.get_login_settings" + end + + result = get_login_settings_with_http_info(settings_service_get_login_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_login_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetLoginSettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_login_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_login_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_login_settings_with_http_info(settings_service_get_login_settings_request) + if settings_service_get_login_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_login_settings_request' when calling SettingsServiceApi.get_login_settings" + end + + path = '/zitadel.settings.v2.SettingsService/GetLoginSettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_get_login_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetLoginSettingsResponse', + nil + ) + end # Get Password Complexity Settings - # Get the password complexity settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` - # @param settings_service_get_password_complexity_settings_request [SettingsServiceGetPasswordComplexitySettingsRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetPasswordComplexitySettingsResponse] - def get_password_complexity_settings(settings_service_get_password_complexity_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_password_complexity_settings ...' # MODIFIED - end - # verify the required parameter 'settings_service_get_password_complexity_settings_request' is set - if @api_client.config.client_side_validation && settings_service_get_password_complexity_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_get_password_complexity_settings_request' when calling Api::SettingsServiceApi.get_password_complexity_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetPasswordComplexitySettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get the password complexity settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + # @param settings_service_get_password_complexity_settings_request [SettingsServiceGetPasswordComplexitySettingsRequest] + + # @return [SettingsServiceGetPasswordComplexitySettingsResponse] + # @raise [ApiError] if fails to make API call + def get_password_complexity_settings(settings_service_get_password_complexity_settings_request) + if settings_service_get_password_complexity_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_password_complexity_settings_request' when calling SettingsServiceApi.get_password_complexity_settings" + end + + result = get_password_complexity_settings_with_http_info(settings_service_get_password_complexity_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_password_complexity_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetPasswordComplexitySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_password_complexity_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_password_complexity_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_password_complexity_settings_with_http_info(settings_service_get_password_complexity_settings_request) + if settings_service_get_password_complexity_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_password_complexity_settings_request' when calling SettingsServiceApi.get_password_complexity_settings" + end + + path = '/zitadel.settings.v2.SettingsService/GetPasswordComplexitySettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_get_password_complexity_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetPasswordComplexitySettingsResponse', + nil + ) + end # Get Password Expiry Settings - # Get the password expiry settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` - # @param settings_service_get_password_expiry_settings_request [SettingsServiceGetPasswordExpirySettingsRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetPasswordExpirySettingsResponse] - def get_password_expiry_settings(settings_service_get_password_expiry_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_password_expiry_settings ...' # MODIFIED - end - # verify the required parameter 'settings_service_get_password_expiry_settings_request' is set - if @api_client.config.client_side_validation && settings_service_get_password_expiry_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_get_password_expiry_settings_request' when calling Api::SettingsServiceApi.get_password_expiry_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetPasswordExpirySettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get the password expiry settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + # @param settings_service_get_password_expiry_settings_request [SettingsServiceGetPasswordExpirySettingsRequest] + + # @return [SettingsServiceGetPasswordExpirySettingsResponse] + # @raise [ApiError] if fails to make API call + def get_password_expiry_settings(settings_service_get_password_expiry_settings_request) + if settings_service_get_password_expiry_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_password_expiry_settings_request' when calling SettingsServiceApi.get_password_expiry_settings" + end + + result = get_password_expiry_settings_with_http_info(settings_service_get_password_expiry_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_get_password_expiry_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetPasswordExpirySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_password_expiry_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_password_expiry_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_password_expiry_settings_with_http_info(settings_service_get_password_expiry_settings_request) + if settings_service_get_password_expiry_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_get_password_expiry_settings_request' when calling SettingsServiceApi.get_password_expiry_settings" + end + + path = '/zitadel.settings.v2.SettingsService/GetPasswordExpirySettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_get_password_expiry_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetPasswordExpirySettingsResponse', + nil + ) + end # Get Security Settings - # Get the security settings of the ZITADEL instance. Security settings include settings like enabling impersonation and embedded iframe settings. Required permissions: - `iam.policy.read` - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceGetSecuritySettingsResponse] - def get_security_settings(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.get_security_settings ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::SettingsServiceApi.get_security_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/GetSecuritySettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Get the security settings of the ZITADEL instance. Security settings include settings like enabling impersonation and embedded iframe settings. Required permissions: - `iam.policy.read` + # @param body [Object] + + # @return [SettingsServiceGetSecuritySettingsResponse] + # @raise [ApiError] if fails to make API call + def get_security_settings(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling SettingsServiceApi.get_security_settings" + end + + result = get_security_settings_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceGetSecuritySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.get_security_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#get_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_security_settings_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling SettingsServiceApi.get_security_settings" + end + + path = '/zitadel.settings.v2.SettingsService/GetSecuritySettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceGetSecuritySettingsResponse', + nil + ) + end # Set Hosted Login Translation - # Sets the input translations at the specified level (instance or organization) for the input language. Required permissions: - `iam.policy.write` - # @param settings_service_set_hosted_login_translation_request [SettingsServiceSetHostedLoginTranslationRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceSetHostedLoginTranslationResponse] - def set_hosted_login_translation(settings_service_set_hosted_login_translation_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.set_hosted_login_translation ...' # MODIFIED - end - # verify the required parameter 'settings_service_set_hosted_login_translation_request' is set - if @api_client.config.client_side_validation && settings_service_set_hosted_login_translation_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_set_hosted_login_translation_request' when calling Api::SettingsServiceApi.set_hosted_login_translation" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/SetHostedLoginTranslation' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Sets the input translations at the specified level (instance or organization) for the input language. Required permissions: - `iam.policy.write` + # @param settings_service_set_hosted_login_translation_request [SettingsServiceSetHostedLoginTranslationRequest] + + # @return [SettingsServiceSetHostedLoginTranslationResponse] + # @raise [ApiError] if fails to make API call + def set_hosted_login_translation(settings_service_set_hosted_login_translation_request) + if settings_service_set_hosted_login_translation_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_set_hosted_login_translation_request' when calling SettingsServiceApi.set_hosted_login_translation" + end + + result = set_hosted_login_translation_with_http_info(settings_service_set_hosted_login_translation_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_set_hosted_login_translation_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceSetHostedLoginTranslationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.set_hosted_login_translation", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#set_hosted_login_translation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_hosted_login_translation_with_http_info(settings_service_set_hosted_login_translation_request) + if settings_service_set_hosted_login_translation_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_set_hosted_login_translation_request' when calling SettingsServiceApi.set_hosted_login_translation" + end + + path = '/zitadel.settings.v2.SettingsService/SetHostedLoginTranslation' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_set_hosted_login_translation_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceSetHostedLoginTranslationResponse', + nil + ) + end # Set Security Settings - # Set the security settings of the instance. Required permissions: - `iam.policy.write` - # @param settings_service_set_security_settings_request [SettingsServiceSetSecuritySettingsRequest] - # @param [Hash] opts the optional parameters - # @return [SettingsServiceSetSecuritySettingsResponse] - def set_security_settings(settings_service_set_security_settings_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::SettingsServiceApi.set_security_settings ...' # MODIFIED - end - # verify the required parameter 'settings_service_set_security_settings_request' is set - if @api_client.config.client_side_validation && settings_service_set_security_settings_request.nil? - fail ArgumentError, "Missing the required parameter 'settings_service_set_security_settings_request' when calling Api::SettingsServiceApi.set_security_settings" # MODIFIED - end - # resource path - local_var_path = '/zitadel.settings.v2.SettingsService/SetSecuritySettings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Set the security settings of the instance. Required permissions: - `iam.policy.write` + # @param settings_service_set_security_settings_request [SettingsServiceSetSecuritySettingsRequest] + + # @return [SettingsServiceSetSecuritySettingsResponse] + # @raise [ApiError] if fails to make API call + def set_security_settings(settings_service_set_security_settings_request) + if settings_service_set_security_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_set_security_settings_request' when calling SettingsServiceApi.set_security_settings" + end + + result = set_security_settings_with_http_info(settings_service_set_security_settings_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(settings_service_set_security_settings_request) - - # return_type - return_type = opts[:debug_return_type] || 'SettingsServiceSetSecuritySettingsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::SettingsServiceApi.set_security_settings", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::SettingsServiceApi#set_security_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_security_settings_with_http_info(settings_service_set_security_settings_request) + if settings_service_set_security_settings_request.nil? + raise ArgumentError, + "Missing the required parameter 'settings_service_set_security_settings_request' when calling SettingsServiceApi.set_security_settings" + end + + path = '/zitadel.settings.v2.SettingsService/SetSecuritySettings' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = settings_service_set_security_settings_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'SettingsServiceSetSecuritySettingsResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/user_service_api.rb b/lib/zitadel/client/api/user_service_api.rb index a7f295b9..a9a4a26d 100644 --- a/lib/zitadel/client/api/user_service_api.rb +++ b/lib/zitadel/client/api/user_service_api.rb @@ -1,3501 +1,3201 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class UserServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # UserServiceApi provides methods for the UserService API group. + class UserServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Create a new human user # Deprecated: Use [CreateUser](apis/resources/user_service_v2/user-service-create-user.api.mdx) to create a new user of type human instead. Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. - # @param user_service_add_human_user_request [UserServiceAddHumanUserRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceAddHumanUserResponse] - def add_human_user(user_service_add_human_user_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_human_user ...' # MODIFIED - end - # verify the required parameter 'user_service_add_human_user_request' is set - if @api_client.config.client_side_validation && user_service_add_human_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_add_human_user_request' when calling Api::UserServiceApi.add_human_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/AddHumanUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_add_human_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceAddHumanUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.add_human_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#add_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_add_human_user_request [UserServiceAddHumanUserRequest] + + # @return [UserServiceAddHumanUserResponse] + # @raise [ApiError] if fails to make API call + def add_human_user(user_service_add_human_user_request) + if user_service_add_human_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_human_user_request' when calling UserServiceApi.add_human_user" + end + + result = add_human_user_with_http_info(user_service_add_human_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_human_user_with_http_info(user_service_add_human_user_request) + if user_service_add_human_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_human_user_request' when calling UserServiceApi.add_human_user" + end + + path = '/zitadel.user.v2.UserService/AddHumanUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_add_human_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceAddHumanUserResponse', + nil + ) + end # Add link to an identity provider to an user # Add link to an identity provider to an user.. - # @param user_service_add_idp_link_request [UserServiceAddIDPLinkRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceAddIDPLinkResponse] - def add_idp_link(user_service_add_idp_link_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_idp_link ...' # MODIFIED - end - # verify the required parameter 'user_service_add_idp_link_request' is set - if @api_client.config.client_side_validation && user_service_add_idp_link_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_add_idp_link_request' when calling Api::UserServiceApi.add_idp_link" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/AddIDPLink' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_add_idp_link_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceAddIDPLinkResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.add_idp_link", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#add_idp_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_add_idp_link_request [UserServiceAddIDPLinkRequest] + + # @return [UserServiceAddIDPLinkResponse] + # @raise [ApiError] if fails to make API call + def add_idp_link(user_service_add_idp_link_request) + if user_service_add_idp_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_idp_link_request' when calling UserServiceApi.add_idp_link" + end + + result = add_idp_link_with_http_info(user_service_add_idp_link_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_idp_link_with_http_info(user_service_add_idp_link_request) + if user_service_add_idp_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_idp_link_request' when calling UserServiceApi.add_idp_link" + end + + path = '/zitadel.user.v2.UserService/AddIDPLink' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_add_idp_link_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceAddIDPLinkResponse', + nil + ) + end # Add a Key - # Add a keys that can be used to securely authenticate at the Zitadel APIs using JWT profile authentication using short-lived tokens. Make sure you store the returned key safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have keys. Required permission: - user.write - # @param user_service_add_key_request [UserServiceAddKeyRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceAddKeyResponse] - def add_key(user_service_add_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_key ...' # MODIFIED - end - # verify the required parameter 'user_service_add_key_request' is set - if @api_client.config.client_side_validation && user_service_add_key_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_add_key_request' when calling Api::UserServiceApi.add_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/AddKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_add_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceAddKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.add_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#add_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Add a keys that can be used to securely authenticate at the Zitadel APIs using JWT profile authentication using short-lived tokens. Make sure you store the returned key safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have keys. Required permission: - user.write + # @param user_service_add_key_request [UserServiceAddKeyRequest] + + # @return [UserServiceAddKeyResponse] + # @raise [ApiError] if fails to make API call + def add_key(user_service_add_key_request) + if user_service_add_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_key_request' when calling UserServiceApi.add_key" + end + + result = add_key_with_http_info(user_service_add_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_key_with_http_info(user_service_add_key_request) + if user_service_add_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_key_request' when calling UserServiceApi.add_key" + end + + path = '/zitadel.user.v2.UserService/AddKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_add_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceAddKeyResponse', + nil + ) + end # Add OTP Email for a user # Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. - # @param user_service_add_otp_email_request [UserServiceAddOTPEmailRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceAddOTPEmailResponse] - def add_otp_email(user_service_add_otp_email_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_otp_email ...' # MODIFIED - end - # verify the required parameter 'user_service_add_otp_email_request' is set - if @api_client.config.client_side_validation && user_service_add_otp_email_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_add_otp_email_request' when calling Api::UserServiceApi.add_otp_email" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/AddOTPEmail' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_add_otp_email_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceAddOTPEmailResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.add_otp_email", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#add_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_add_otp_email_request [UserServiceAddOTPEmailRequest] + + # @return [UserServiceAddOTPEmailResponse] + # @raise [ApiError] if fails to make API call + def add_otp_email(user_service_add_otp_email_request) + if user_service_add_otp_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_otp_email_request' when calling UserServiceApi.add_otp_email" + end + + result = add_otp_email_with_http_info(user_service_add_otp_email_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_otp_email_with_http_info(user_service_add_otp_email_request) + if user_service_add_otp_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_otp_email_request' when calling UserServiceApi.add_otp_email" + end + + path = '/zitadel.user.v2.UserService/AddOTPEmail' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_add_otp_email_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceAddOTPEmailResponse', + nil + ) + end # Add OTP SMS for a user # Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. - # @param user_service_add_otpsms_request [UserServiceAddOTPSMSRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceAddOTPSMSResponse] - def add_otpsms(user_service_add_otpsms_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_otpsms ...' # MODIFIED - end - # verify the required parameter 'user_service_add_otpsms_request' is set - if @api_client.config.client_side_validation && user_service_add_otpsms_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_add_otpsms_request' when calling Api::UserServiceApi.add_otpsms" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/AddOTPSMS' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_add_otpsms_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceAddOTPSMSResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.add_otpsms", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#add_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_add_otpsms_request [UserServiceAddOTPSMSRequest] + + # @return [UserServiceAddOTPSMSResponse] + # @raise [ApiError] if fails to make API call + def add_otpsms(user_service_add_otpsms_request) + if user_service_add_otpsms_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_otpsms_request' when calling UserServiceApi.add_otpsms" + end + + result = add_otpsms_with_http_info(user_service_add_otpsms_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_otpsms_with_http_info(user_service_add_otpsms_request) + if user_service_add_otpsms_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_otpsms_request' when calling UserServiceApi.add_otpsms" + end + + path = '/zitadel.user.v2.UserService/AddOTPSMS' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_add_otpsms_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceAddOTPSMSResponse', + nil + ) + end # Add a Personal Access Token - # Personal access tokens (PAT) are the easiest way to authenticate to the Zitadel APIs. Make sure you store the returned PAT safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have personal access tokens. Required permission: - user.write - # @param user_service_add_personal_access_token_request [UserServiceAddPersonalAccessTokenRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceAddPersonalAccessTokenResponse] - def add_personal_access_token(user_service_add_personal_access_token_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_personal_access_token ...' # MODIFIED - end - # verify the required parameter 'user_service_add_personal_access_token_request' is set - if @api_client.config.client_side_validation && user_service_add_personal_access_token_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_add_personal_access_token_request' when calling Api::UserServiceApi.add_personal_access_token" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/AddPersonalAccessToken' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_add_personal_access_token_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceAddPersonalAccessTokenResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.add_personal_access_token", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#add_personal_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Personal access tokens (PAT) are the easiest way to authenticate to the Zitadel APIs. Make sure you store the returned PAT safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have personal access tokens. Required permission: - user.write + # @param user_service_add_personal_access_token_request [UserServiceAddPersonalAccessTokenRequest] + + # @return [UserServiceAddPersonalAccessTokenResponse] + # @raise [ApiError] if fails to make API call + def add_personal_access_token(user_service_add_personal_access_token_request) + if user_service_add_personal_access_token_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_personal_access_token_request' when calling UserServiceApi.add_personal_access_token" + end + + result = add_personal_access_token_with_http_info(user_service_add_personal_access_token_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_personal_access_token_with_http_info(user_service_add_personal_access_token_request) + if user_service_add_personal_access_token_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_personal_access_token_request' when calling UserServiceApi.add_personal_access_token" + end + + path = '/zitadel.user.v2.UserService/AddPersonalAccessToken' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_add_personal_access_token_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceAddPersonalAccessTokenResponse', + nil + ) + end # Add a Users Secret # Generates a client secret for the user. The client id is the users username. If the user already has a secret, it is overwritten. Only users of type machine can have a secret. Required permission: - user.write - # @param user_service_add_secret_request [UserServiceAddSecretRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceAddSecretResponse] - def add_secret(user_service_add_secret_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.add_secret ...' # MODIFIED - end - # verify the required parameter 'user_service_add_secret_request' is set - if @api_client.config.client_side_validation && user_service_add_secret_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_add_secret_request' when calling Api::UserServiceApi.add_secret" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/AddSecret' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_add_secret_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceAddSecretResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.add_secret", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#add_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_add_secret_request [UserServiceAddSecretRequest] + + # @return [UserServiceAddSecretResponse] + # @raise [ApiError] if fails to make API call + def add_secret(user_service_add_secret_request) + if user_service_add_secret_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_secret_request' when calling UserServiceApi.add_secret" + end + + result = add_secret_with_http_info(user_service_add_secret_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def add_secret_with_http_info(user_service_add_secret_request) + if user_service_add_secret_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_add_secret_request' when calling UserServiceApi.add_secret" + end + + path = '/zitadel.user.v2.UserService/AddSecret' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_add_secret_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceAddSecretResponse', + nil + ) + end # Create an invite code for a user - # Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. If an invite code has been created previously, it's url template and application name will be used as defaults for the new code. The new code will overwrite the previous one and make it invalid. Note: It is possible to reissue a new code only when the previous code has expired, or when the user provides a wrong code three or more times during verification. - # @param user_service_create_invite_code_request [UserServiceCreateInviteCodeRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceCreateInviteCodeResponse] - def create_invite_code(user_service_create_invite_code_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.create_invite_code ...' # MODIFIED - end - # verify the required parameter 'user_service_create_invite_code_request' is set - if @api_client.config.client_side_validation && user_service_create_invite_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_create_invite_code_request' when calling Api::UserServiceApi.create_invite_code" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/CreateInviteCode' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_create_invite_code_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceCreateInviteCodeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.create_invite_code", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#create_invite_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. If an invite code has been created previously, it's url template and application name will be used as defaults for the new code. The new code will overwrite the previous one and make it invalid. Note: It is possible to reissue a new code only when the previous code has expired, or when the user provides a wrong code three or more times during verification. + # @param user_service_create_invite_code_request [UserServiceCreateInviteCodeRequest] + + # @return [UserServiceCreateInviteCodeResponse] + # @raise [ApiError] if fails to make API call + def create_invite_code(user_service_create_invite_code_request) + if user_service_create_invite_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_create_invite_code_request' when calling UserServiceApi.create_invite_code" + end + + result = create_invite_code_with_http_info(user_service_create_invite_code_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_invite_code_with_http_info(user_service_create_invite_code_request) + if user_service_create_invite_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_create_invite_code_request' when calling UserServiceApi.create_invite_code" + end + + path = '/zitadel.user.v2.UserService/CreateInviteCode' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_create_invite_code_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceCreateInviteCodeResponse', + nil + ) + end # Create a passkey registration link for a user # Create a passkey registration link which includes a code and either return it or send it to the user.. - # @param user_service_create_passkey_registration_link_request [UserServiceCreatePasskeyRegistrationLinkRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceCreatePasskeyRegistrationLinkResponse] - def create_passkey_registration_link(user_service_create_passkey_registration_link_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.create_passkey_registration_link ...' # MODIFIED - end - # verify the required parameter 'user_service_create_passkey_registration_link_request' is set - if @api_client.config.client_side_validation && user_service_create_passkey_registration_link_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_create_passkey_registration_link_request' when calling Api::UserServiceApi.create_passkey_registration_link" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/CreatePasskeyRegistrationLink' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_create_passkey_registration_link_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceCreatePasskeyRegistrationLinkResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.create_passkey_registration_link", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#create_passkey_registration_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_create_passkey_registration_link_request [UserServiceCreatePasskeyRegistrationLinkRequest] + + # @return [UserServiceCreatePasskeyRegistrationLinkResponse] + # @raise [ApiError] if fails to make API call + def create_passkey_registration_link(user_service_create_passkey_registration_link_request) + if user_service_create_passkey_registration_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_create_passkey_registration_link_request' when calling UserServiceApi.create_passkey_registration_link" + end + + result = create_passkey_registration_link_with_http_info(user_service_create_passkey_registration_link_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_passkey_registration_link_with_http_info(user_service_create_passkey_registration_link_request) + if user_service_create_passkey_registration_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_create_passkey_registration_link_request' when calling UserServiceApi.create_passkey_registration_link" + end + + path = '/zitadel.user.v2.UserService/CreatePasskeyRegistrationLink' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_create_passkey_registration_link_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceCreatePasskeyRegistrationLinkResponse', + nil + ) + end # Create a User # Create a new human or machine user in the specified organization. Required permission: - user.write - # @param user_service_create_user_request [UserServiceCreateUserRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceCreateUserResponse] - def create_user(user_service_create_user_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.create_user ...' # MODIFIED - end - # verify the required parameter 'user_service_create_user_request' is set - if @api_client.config.client_side_validation && user_service_create_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_create_user_request' when calling Api::UserServiceApi.create_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/CreateUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_create_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceCreateUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.create_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_create_user_request [UserServiceCreateUserRequest] + + # @return [UserServiceCreateUserResponse] + # @raise [ApiError] if fails to make API call + def create_user(user_service_create_user_request) + if user_service_create_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_create_user_request' when calling UserServiceApi.create_user" + end + + result = create_user_with_http_info(user_service_create_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_user_with_http_info(user_service_create_user_request) + if user_service_create_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_create_user_request' when calling UserServiceApi.create_user" + end + + path = '/zitadel.user.v2.UserService/CreateUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_create_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceCreateUserResponse', + nil + ) + end # Deactivate user - # The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. - # @param user_service_deactivate_user_request [UserServiceDeactivateUserRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceDeactivateUserResponse] - def deactivate_user(user_service_deactivate_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.deactivate_user ...' # MODIFIED - end - # verify the required parameter 'user_service_deactivate_user_request' is set - if @api_client.config.client_side_validation && user_service_deactivate_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_deactivate_user_request' when calling Api::UserServiceApi.deactivate_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/DeactivateUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_deactivate_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceDeactivateUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.deactivate_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#deactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. + # @param user_service_deactivate_user_request [UserServiceDeactivateUserRequest] + + # @return [UserServiceDeactivateUserResponse] + # @raise [ApiError] if fails to make API call + def deactivate_user(user_service_deactivate_user_request) + if user_service_deactivate_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_deactivate_user_request' when calling UserServiceApi.deactivate_user" + end + + result = deactivate_user_with_http_info(user_service_deactivate_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def deactivate_user_with_http_info(user_service_deactivate_user_request) + if user_service_deactivate_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_deactivate_user_request' when calling UserServiceApi.deactivate_user" + end + + path = '/zitadel.user.v2.UserService/DeactivateUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_deactivate_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceDeactivateUserResponse', + nil + ) + end # Delete user - # The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. - # @param user_service_delete_user_request [UserServiceDeleteUserRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceDeleteUserResponse] - def delete_user(user_service_delete_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.delete_user ...' # MODIFIED - end - # verify the required parameter 'user_service_delete_user_request' is set - if @api_client.config.client_side_validation && user_service_delete_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_delete_user_request' when calling Api::UserServiceApi.delete_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/DeleteUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_delete_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceDeleteUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.delete_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. + # @param user_service_delete_user_request [UserServiceDeleteUserRequest] + + # @return [UserServiceDeleteUserResponse] + # @raise [ApiError] if fails to make API call + def delete_user(user_service_delete_user_request) + if user_service_delete_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_delete_user_request' when calling UserServiceApi.delete_user" + end + + result = delete_user_with_http_info(user_service_delete_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_user_with_http_info(user_service_delete_user_request) + if user_service_delete_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_delete_user_request' when calling UserServiceApi.delete_user" + end + + path = '/zitadel.user.v2.UserService/DeleteUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_delete_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceDeleteUserResponse', + nil + ) + end # Delete User Metadata - # Delete metadata objects from an user with a specific key. Required permission: - `user.write` - # @param user_service_delete_user_metadata_request [UserServiceDeleteUserMetadataRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceDeleteUserMetadataResponse] - def delete_user_metadata(user_service_delete_user_metadata_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.delete_user_metadata ...' # MODIFIED - end - # verify the required parameter 'user_service_delete_user_metadata_request' is set - if @api_client.config.client_side_validation && user_service_delete_user_metadata_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_delete_user_metadata_request' when calling Api::UserServiceApi.delete_user_metadata" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/DeleteUserMetadata' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_delete_user_metadata_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceDeleteUserMetadataResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.delete_user_metadata", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#delete_user_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Delete metadata objects from an user with a specific key. Required permission: - `user.write` + # @param user_service_delete_user_metadata_request [UserServiceDeleteUserMetadataRequest] + + # @return [UserServiceDeleteUserMetadataResponse] + # @raise [ApiError] if fails to make API call + def delete_user_metadata(user_service_delete_user_metadata_request) + if user_service_delete_user_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_delete_user_metadata_request' when calling UserServiceApi.delete_user_metadata" + end + + result = delete_user_metadata_with_http_info(user_service_delete_user_metadata_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_user_metadata_with_http_info(user_service_delete_user_metadata_request) + if user_service_delete_user_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_delete_user_metadata_request' when calling UserServiceApi.delete_user_metadata" + end + + path = '/zitadel.user.v2.UserService/DeleteUserMetadata' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_delete_user_metadata_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceDeleteUserMetadataResponse', + nil + ) + end # Generate single-use recovery codes for a user # Generate new single-use recovery codes for the authenticated user. Recovery codes can be used to recover access to the account if other second factors are not available. - # @param user_service_generate_recovery_codes_request [UserServiceGenerateRecoveryCodesRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceGenerateRecoveryCodesResponse] - def generate_recovery_codes(user_service_generate_recovery_codes_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.generate_recovery_codes ...' # MODIFIED - end - # verify the required parameter 'user_service_generate_recovery_codes_request' is set - if @api_client.config.client_side_validation && user_service_generate_recovery_codes_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_generate_recovery_codes_request' when calling Api::UserServiceApi.generate_recovery_codes" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/GenerateRecoveryCodes' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_generate_recovery_codes_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceGenerateRecoveryCodesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.generate_recovery_codes", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#generate_recovery_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_generate_recovery_codes_request [UserServiceGenerateRecoveryCodesRequest] + + # @return [UserServiceGenerateRecoveryCodesResponse] + # @raise [ApiError] if fails to make API call + def generate_recovery_codes(user_service_generate_recovery_codes_request) + if user_service_generate_recovery_codes_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_generate_recovery_codes_request' when calling UserServiceApi.generate_recovery_codes" + end + + result = generate_recovery_codes_with_http_info(user_service_generate_recovery_codes_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def generate_recovery_codes_with_http_info(user_service_generate_recovery_codes_request) + if user_service_generate_recovery_codes_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_generate_recovery_codes_request' when calling UserServiceApi.generate_recovery_codes" + end + + path = '/zitadel.user.v2.UserService/GenerateRecoveryCodes' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_generate_recovery_codes_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceGenerateRecoveryCodesResponse', + nil + ) + end # User by ID # Returns the full user object (human or machine) including the profile, email, etc.. - # @param user_service_get_user_by_id_request [UserServiceGetUserByIDRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceGetUserByIDResponse] - def get_user_by_id(user_service_get_user_by_id_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.get_user_by_id ...' # MODIFIED - end - # verify the required parameter 'user_service_get_user_by_id_request' is set - if @api_client.config.client_side_validation && user_service_get_user_by_id_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_get_user_by_id_request' when calling Api::UserServiceApi.get_user_by_id" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/GetUserByID' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_get_user_by_id_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceGetUserByIDResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.get_user_by_id", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#get_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_get_user_by_id_request [UserServiceGetUserByIDRequest] + + # @return [UserServiceGetUserByIDResponse] + # @raise [ApiError] if fails to make API call + def get_user_by_id(user_service_get_user_by_id_request) + if user_service_get_user_by_id_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_get_user_by_id_request' when calling UserServiceApi.get_user_by_id" + end + + result = get_user_by_id_with_http_info(user_service_get_user_by_id_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def get_user_by_id_with_http_info(user_service_get_user_by_id_request) + if user_service_get_user_by_id_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_get_user_by_id_request' when calling UserServiceApi.get_user_by_id" + end + + path = '/zitadel.user.v2.UserService/GetUserByID' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_get_user_by_id_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceGetUserByIDResponse', + nil + ) + end # MFA Init Skipped # Update the last time the user has skipped MFA initialization. The server timestamp is used. - # @param user_service_human_mfa_init_skipped_request [UserServiceHumanMFAInitSkippedRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceHumanMFAInitSkippedResponse] - def human_mfa_init_skipped(user_service_human_mfa_init_skipped_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.human_mfa_init_skipped ...' # MODIFIED - end - # verify the required parameter 'user_service_human_mfa_init_skipped_request' is set - if @api_client.config.client_side_validation && user_service_human_mfa_init_skipped_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_human_mfa_init_skipped_request' when calling Api::UserServiceApi.human_mfa_init_skipped" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/HumanMFAInitSkipped' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_human_mfa_init_skipped_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceHumanMFAInitSkippedResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.human_mfa_init_skipped", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#human_mfa_init_skipped\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_human_mfa_init_skipped_request [UserServiceHumanMFAInitSkippedRequest] + + # @return [UserServiceHumanMFAInitSkippedResponse] + # @raise [ApiError] if fails to make API call + def human_mfa_init_skipped(user_service_human_mfa_init_skipped_request) + if user_service_human_mfa_init_skipped_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_human_mfa_init_skipped_request' when calling UserServiceApi.human_mfa_init_skipped" + end + + result = human_mfa_init_skipped_with_http_info(user_service_human_mfa_init_skipped_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def human_mfa_init_skipped_with_http_info(user_service_human_mfa_init_skipped_request) + if user_service_human_mfa_init_skipped_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_human_mfa_init_skipped_request' when calling UserServiceApi.human_mfa_init_skipped" + end + + path = '/zitadel.user.v2.UserService/HumanMFAInitSkipped' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_human_mfa_init_skipped_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceHumanMFAInitSkippedResponse', + nil + ) + end # ListAuthenticationFactors - # @param user_service_list_authentication_factors_request [UserServiceListAuthenticationFactorsRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceListAuthenticationFactorsResponse] - def list_authentication_factors(user_service_list_authentication_factors_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_authentication_factors ...' # MODIFIED - end - # verify the required parameter 'user_service_list_authentication_factors_request' is set - if @api_client.config.client_side_validation && user_service_list_authentication_factors_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_authentication_factors_request' when calling Api::UserServiceApi.list_authentication_factors" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ListAuthenticationFactors' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_authentication_factors_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceListAuthenticationFactorsResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.list_authentication_factors", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#list_authentication_factors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_list_authentication_factors_request [UserServiceListAuthenticationFactorsRequest] + + # @return [UserServiceListAuthenticationFactorsResponse] + # @raise [ApiError] if fails to make API call + def list_authentication_factors(user_service_list_authentication_factors_request) + if user_service_list_authentication_factors_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_authentication_factors_request' when calling UserServiceApi.list_authentication_factors" + end + + result = list_authentication_factors_with_http_info(user_service_list_authentication_factors_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_authentication_factors_with_http_info(user_service_list_authentication_factors_request) + if user_service_list_authentication_factors_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_authentication_factors_request' when calling UserServiceApi.list_authentication_factors" + end + + path = '/zitadel.user.v2.UserService/ListAuthenticationFactors' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_list_authentication_factors_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceListAuthenticationFactorsResponse', + nil + ) + end # List all possible authentication methods of a user # List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. - # @param user_service_list_authentication_method_types_request [UserServiceListAuthenticationMethodTypesRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceListAuthenticationMethodTypesResponse] - def list_authentication_method_types(user_service_list_authentication_method_types_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_authentication_method_types ...' # MODIFIED - end - # verify the required parameter 'user_service_list_authentication_method_types_request' is set - if @api_client.config.client_side_validation && user_service_list_authentication_method_types_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_authentication_method_types_request' when calling Api::UserServiceApi.list_authentication_method_types" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ListAuthenticationMethodTypes' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_authentication_method_types_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceListAuthenticationMethodTypesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.list_authentication_method_types", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#list_authentication_method_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_list_authentication_method_types_request [UserServiceListAuthenticationMethodTypesRequest] + + # @return [UserServiceListAuthenticationMethodTypesResponse] + # @raise [ApiError] if fails to make API call + def list_authentication_method_types(user_service_list_authentication_method_types_request) + if user_service_list_authentication_method_types_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_authentication_method_types_request' when calling UserServiceApi.list_authentication_method_types" + end + + result = list_authentication_method_types_with_http_info(user_service_list_authentication_method_types_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_authentication_method_types_with_http_info(user_service_list_authentication_method_types_request) + if user_service_list_authentication_method_types_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_authentication_method_types_request' when calling UserServiceApi.list_authentication_method_types" + end + + path = '/zitadel.user.v2.UserService/ListAuthenticationMethodTypes' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_list_authentication_method_types_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceListAuthenticationMethodTypesResponse', + nil + ) + end # List links to an identity provider of an user # List links to an identity provider of an user. - # @param user_service_list_idp_links_request [UserServiceListIDPLinksRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceListIDPLinksResponse] - def list_idp_links(user_service_list_idp_links_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_idp_links ...' # MODIFIED - end - # verify the required parameter 'user_service_list_idp_links_request' is set - if @api_client.config.client_side_validation && user_service_list_idp_links_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_idp_links_request' when calling Api::UserServiceApi.list_idp_links" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ListIDPLinks' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_idp_links_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceListIDPLinksResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.list_idp_links", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#list_idp_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_list_idp_links_request [UserServiceListIDPLinksRequest] + + # @return [UserServiceListIDPLinksResponse] + # @raise [ApiError] if fails to make API call + def list_idp_links(user_service_list_idp_links_request) + if user_service_list_idp_links_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_idp_links_request' when calling UserServiceApi.list_idp_links" + end + + result = list_idp_links_with_http_info(user_service_list_idp_links_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_idp_links_with_http_info(user_service_list_idp_links_request) + if user_service_list_idp_links_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_idp_links_request' when calling UserServiceApi.list_idp_links" + end + + path = '/zitadel.user.v2.UserService/ListIDPLinks' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_list_idp_links_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceListIDPLinksResponse', + nil + ) + end # Search Keys # List all matching keys. By default all keys of the instance on which the caller has permission to read the owning users are returned. Make sure to include a limit and sorting for pagination. Required permission: - user.read - # @param user_service_list_keys_request [UserServiceListKeysRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceListKeysResponse] - def list_keys(user_service_list_keys_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_keys ...' # MODIFIED - end - # verify the required parameter 'user_service_list_keys_request' is set - if @api_client.config.client_side_validation && user_service_list_keys_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_keys_request' when calling Api::UserServiceApi.list_keys" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ListKeys' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_keys_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceListKeysResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.list_keys", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#list_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_list_keys_request [UserServiceListKeysRequest] + + # @return [UserServiceListKeysResponse] + # @raise [ApiError] if fails to make API call + def list_keys(user_service_list_keys_request) + if user_service_list_keys_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_keys_request' when calling UserServiceApi.list_keys" + end + + result = list_keys_with_http_info(user_service_list_keys_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_keys_with_http_info(user_service_list_keys_request) + if user_service_list_keys_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_keys_request' when calling UserServiceApi.list_keys" + end + + path = '/zitadel.user.v2.UserService/ListKeys' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_list_keys_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceListKeysResponse', + nil + ) + end # List passkeys of an user # List passkeys of an user - # @param user_service_list_passkeys_request [UserServiceListPasskeysRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceListPasskeysResponse] - def list_passkeys(user_service_list_passkeys_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_passkeys ...' # MODIFIED - end - # verify the required parameter 'user_service_list_passkeys_request' is set - if @api_client.config.client_side_validation && user_service_list_passkeys_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_passkeys_request' when calling Api::UserServiceApi.list_passkeys" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ListPasskeys' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_passkeys_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceListPasskeysResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.list_passkeys", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#list_passkeys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_list_passkeys_request [UserServiceListPasskeysRequest] + + # @return [UserServiceListPasskeysResponse] + # @raise [ApiError] if fails to make API call + def list_passkeys(user_service_list_passkeys_request) + if user_service_list_passkeys_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_passkeys_request' when calling UserServiceApi.list_passkeys" + end + + result = list_passkeys_with_http_info(user_service_list_passkeys_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_passkeys_with_http_info(user_service_list_passkeys_request) + if user_service_list_passkeys_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_passkeys_request' when calling UserServiceApi.list_passkeys" + end + + path = '/zitadel.user.v2.UserService/ListPasskeys' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_list_passkeys_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceListPasskeysResponse', + nil + ) + end # Search Personal Access Tokens # List all personal access tokens. By default all personal access tokens of the instance on which the caller has permission to read the owning users are returned. Make sure to include a limit and sorting for pagination. Required permission: - user.read - # @param user_service_list_personal_access_tokens_request [UserServiceListPersonalAccessTokensRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceListPersonalAccessTokensResponse] - def list_personal_access_tokens(user_service_list_personal_access_tokens_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_personal_access_tokens ...' # MODIFIED - end - # verify the required parameter 'user_service_list_personal_access_tokens_request' is set - if @api_client.config.client_side_validation && user_service_list_personal_access_tokens_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_personal_access_tokens_request' when calling Api::UserServiceApi.list_personal_access_tokens" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ListPersonalAccessTokens' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_personal_access_tokens_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceListPersonalAccessTokensResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.list_personal_access_tokens", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#list_personal_access_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_list_personal_access_tokens_request [UserServiceListPersonalAccessTokensRequest] + + # @return [UserServiceListPersonalAccessTokensResponse] + # @raise [ApiError] if fails to make API call + def list_personal_access_tokens(user_service_list_personal_access_tokens_request) + if user_service_list_personal_access_tokens_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_personal_access_tokens_request' when calling UserServiceApi.list_personal_access_tokens" + end + + result = list_personal_access_tokens_with_http_info(user_service_list_personal_access_tokens_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_personal_access_tokens_with_http_info(user_service_list_personal_access_tokens_request) + if user_service_list_personal_access_tokens_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_personal_access_tokens_request' when calling UserServiceApi.list_personal_access_tokens" + end + + path = '/zitadel.user.v2.UserService/ListPersonalAccessTokens' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_list_personal_access_tokens_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceListPersonalAccessTokensResponse', + nil + ) + end # List User Metadata - # List metadata of an user filtered by query. Required permission: - `user.read` - # @param user_service_list_user_metadata_request [UserServiceListUserMetadataRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceListUserMetadataResponse] - def list_user_metadata(user_service_list_user_metadata_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_user_metadata ...' # MODIFIED - end - # verify the required parameter 'user_service_list_user_metadata_request' is set - if @api_client.config.client_side_validation && user_service_list_user_metadata_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_user_metadata_request' when calling Api::UserServiceApi.list_user_metadata" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ListUserMetadata' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_user_metadata_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceListUserMetadataResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.list_user_metadata", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#list_user_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # List metadata of an user filtered by query. Required permission: - `user.read` + # @param user_service_list_user_metadata_request [UserServiceListUserMetadataRequest] + + # @return [UserServiceListUserMetadataResponse] + # @raise [ApiError] if fails to make API call + def list_user_metadata(user_service_list_user_metadata_request) + if user_service_list_user_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_user_metadata_request' when calling UserServiceApi.list_user_metadata" + end + + result = list_user_metadata_with_http_info(user_service_list_user_metadata_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_user_metadata_with_http_info(user_service_list_user_metadata_request) + if user_service_list_user_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_user_metadata_request' when calling UserServiceApi.list_user_metadata" + end + + path = '/zitadel.user.v2.UserService/ListUserMetadata' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_list_user_metadata_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceListUserMetadataResponse', + nil + ) + end # Search Users # Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. - # @param user_service_list_users_request [UserServiceListUsersRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceListUsersResponse] - def list_users(user_service_list_users_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.list_users ...' # MODIFIED - end - # verify the required parameter 'user_service_list_users_request' is set - if @api_client.config.client_side_validation && user_service_list_users_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_list_users_request' when calling Api::UserServiceApi.list_users" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ListUsers' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_list_users_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceListUsersResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.list_users", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_list_users_request [UserServiceListUsersRequest] + + # @return [UserServiceListUsersResponse] + # @raise [ApiError] if fails to make API call + def list_users(user_service_list_users_request) + if user_service_list_users_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_users_request' when calling UserServiceApi.list_users" + end + + result = list_users_with_http_info(user_service_list_users_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_users_with_http_info(user_service_list_users_request) + if user_service_list_users_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_list_users_request' when calling UserServiceApi.list_users" + end + + path = '/zitadel.user.v2.UserService/ListUsers' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_list_users_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceListUsersResponse', + nil + ) + end # Lock user - # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. - # @param user_service_lock_user_request [UserServiceLockUserRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceLockUserResponse] - def lock_user(user_service_lock_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.lock_user ...' # MODIFIED - end - # verify the required parameter 'user_service_lock_user_request' is set - if @api_client.config.client_side_validation && user_service_lock_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_lock_user_request' when calling Api::UserServiceApi.lock_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/LockUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_lock_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceLockUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.lock_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#lock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. + # @param user_service_lock_user_request [UserServiceLockUserRequest] + + # @return [UserServiceLockUserResponse] + # @raise [ApiError] if fails to make API call + def lock_user(user_service_lock_user_request) + if user_service_lock_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_lock_user_request' when calling UserServiceApi.lock_user" + end + + result = lock_user_with_http_info(user_service_lock_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def lock_user_with_http_info(user_service_lock_user_request) + if user_service_lock_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_lock_user_request' when calling UserServiceApi.lock_user" + end + + path = '/zitadel.user.v2.UserService/LockUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_lock_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceLockUserResponse', + nil + ) + end # Request a code to reset a password # Request a code to reset a password.. - # @param user_service_password_reset_request [UserServicePasswordResetRequest] - # @param [Hash] opts the optional parameters - # @return [UserServicePasswordResetResponse] - def password_reset(user_service_password_reset_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.password_reset ...' # MODIFIED - end - # verify the required parameter 'user_service_password_reset_request' is set - if @api_client.config.client_side_validation && user_service_password_reset_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_password_reset_request' when calling Api::UserServiceApi.password_reset" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/PasswordReset' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_password_reset_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServicePasswordResetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.password_reset", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#password_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_password_reset_request [UserServicePasswordResetRequest] + + # @return [UserServicePasswordResetResponse] + # @raise [ApiError] if fails to make API call + def password_reset(user_service_password_reset_request) + if user_service_password_reset_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_password_reset_request' when calling UserServiceApi.password_reset" + end + + result = password_reset_with_http_info(user_service_password_reset_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def password_reset_with_http_info(user_service_password_reset_request) + if user_service_password_reset_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_password_reset_request' when calling UserServiceApi.password_reset" + end + + path = '/zitadel.user.v2.UserService/PasswordReset' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_password_reset_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServicePasswordResetResponse', + nil + ) + end # Reactivate user - # Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. - # @param user_service_reactivate_user_request [UserServiceReactivateUserRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceReactivateUserResponse] - def reactivate_user(user_service_reactivate_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.reactivate_user ...' # MODIFIED - end - # verify the required parameter 'user_service_reactivate_user_request' is set - if @api_client.config.client_side_validation && user_service_reactivate_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_reactivate_user_request' when calling Api::UserServiceApi.reactivate_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ReactivateUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_reactivate_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceReactivateUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.reactivate_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#reactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. + # @param user_service_reactivate_user_request [UserServiceReactivateUserRequest] + + # @return [UserServiceReactivateUserResponse] + # @raise [ApiError] if fails to make API call + def reactivate_user(user_service_reactivate_user_request) + if user_service_reactivate_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_reactivate_user_request' when calling UserServiceApi.reactivate_user" + end + + result = reactivate_user_with_http_info(user_service_reactivate_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def reactivate_user_with_http_info(user_service_reactivate_user_request) + if user_service_reactivate_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_reactivate_user_request' when calling UserServiceApi.reactivate_user" + end + + path = '/zitadel.user.v2.UserService/ReactivateUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_reactivate_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceReactivateUserResponse', + nil + ) + end # Start the registration of passkey for a user # Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. - # @param user_service_register_passkey_request [UserServiceRegisterPasskeyRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRegisterPasskeyResponse] - def register_passkey(user_service_register_passkey_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.register_passkey ...' # MODIFIED - end - # verify the required parameter 'user_service_register_passkey_request' is set - if @api_client.config.client_side_validation && user_service_register_passkey_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_register_passkey_request' when calling Api::UserServiceApi.register_passkey" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RegisterPasskey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_register_passkey_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRegisterPasskeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.register_passkey", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#register_passkey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_register_passkey_request [UserServiceRegisterPasskeyRequest] + + # @return [UserServiceRegisterPasskeyResponse] + # @raise [ApiError] if fails to make API call + def register_passkey(user_service_register_passkey_request) + if user_service_register_passkey_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_register_passkey_request' when calling UserServiceApi.register_passkey" + end + + result = register_passkey_with_http_info(user_service_register_passkey_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def register_passkey_with_http_info(user_service_register_passkey_request) + if user_service_register_passkey_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_register_passkey_request' when calling UserServiceApi.register_passkey" + end + + path = '/zitadel.user.v2.UserService/RegisterPasskey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_register_passkey_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRegisterPasskeyResponse', + nil + ) + end # Start the registration of a TOTP generator for a user # Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. - # @param user_service_register_totp_request [UserServiceRegisterTOTPRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRegisterTOTPResponse] - def register_totp(user_service_register_totp_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.register_totp ...' # MODIFIED - end - # verify the required parameter 'user_service_register_totp_request' is set - if @api_client.config.client_side_validation && user_service_register_totp_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_register_totp_request' when calling Api::UserServiceApi.register_totp" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RegisterTOTP' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_register_totp_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRegisterTOTPResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.register_totp", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#register_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_register_totp_request [UserServiceRegisterTOTPRequest] + + # @return [UserServiceRegisterTOTPResponse] + # @raise [ApiError] if fails to make API call + def register_totp(user_service_register_totp_request) + if user_service_register_totp_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_register_totp_request' when calling UserServiceApi.register_totp" + end + + result = register_totp_with_http_info(user_service_register_totp_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def register_totp_with_http_info(user_service_register_totp_request) + if user_service_register_totp_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_register_totp_request' when calling UserServiceApi.register_totp" + end + + path = '/zitadel.user.v2.UserService/RegisterTOTP' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_register_totp_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRegisterTOTPResponse', + nil + ) + end # Start the registration of a u2f token for a user # Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. - # @param user_service_register_u2_f_request [UserServiceRegisterU2FRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRegisterU2FResponse] - def register_u2_f(user_service_register_u2_f_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.register_u2_f ...' # MODIFIED - end - # verify the required parameter 'user_service_register_u2_f_request' is set - if @api_client.config.client_side_validation && user_service_register_u2_f_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_register_u2_f_request' when calling Api::UserServiceApi.register_u2_f" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RegisterU2F' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_register_u2_f_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRegisterU2FResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.register_u2_f", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#register_u2_f\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_register_u2_f_request [UserServiceRegisterU2FRequest] + + # @return [UserServiceRegisterU2FResponse] + # @raise [ApiError] if fails to make API call + def register_u2_f(user_service_register_u2_f_request) + if user_service_register_u2_f_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_register_u2_f_request' when calling UserServiceApi.register_u2_f" + end + + result = register_u2_f_with_http_info(user_service_register_u2_f_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def register_u2_f_with_http_info(user_service_register_u2_f_request) + if user_service_register_u2_f_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_register_u2_f_request' when calling UserServiceApi.register_u2_f" + end + + path = '/zitadel.user.v2.UserService/RegisterU2F' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_register_u2_f_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRegisterU2FResponse', + nil + ) + end # Remove link of an identity provider to an user # Remove link of an identity provider to an user. - # @param user_service_remove_idp_link_request [UserServiceRemoveIDPLinkRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemoveIDPLinkResponse] - def remove_idp_link(user_service_remove_idp_link_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_idp_link ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_idp_link_request' is set - if @api_client.config.client_side_validation && user_service_remove_idp_link_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_idp_link_request' when calling Api::UserServiceApi.remove_idp_link" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemoveIDPLink' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_idp_link_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemoveIDPLinkResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_idp_link", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_idp_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_idp_link_request [UserServiceRemoveIDPLinkRequest] + + # @return [UserServiceRemoveIDPLinkResponse] + # @raise [ApiError] if fails to make API call + def remove_idp_link(user_service_remove_idp_link_request) + if user_service_remove_idp_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_idp_link_request' when calling UserServiceApi.remove_idp_link" + end + + result = remove_idp_link_with_http_info(user_service_remove_idp_link_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_idp_link_with_http_info(user_service_remove_idp_link_request) + if user_service_remove_idp_link_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_idp_link_request' when calling UserServiceApi.remove_idp_link" + end + + path = '/zitadel.user.v2.UserService/RemoveIDPLink' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_idp_link_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemoveIDPLinkResponse', + nil + ) + end # Remove a Key # Remove a machine users key by the given key ID and an optionally given user ID. Required permission: - user.write - # @param user_service_remove_key_request [UserServiceRemoveKeyRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemoveKeyResponse] - def remove_key(user_service_remove_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_key ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_key_request' is set - if @api_client.config.client_side_validation && user_service_remove_key_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_key_request' when calling Api::UserServiceApi.remove_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemoveKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemoveKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_key_request [UserServiceRemoveKeyRequest] + + # @return [UserServiceRemoveKeyResponse] + # @raise [ApiError] if fails to make API call + def remove_key(user_service_remove_key_request) + if user_service_remove_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_key_request' when calling UserServiceApi.remove_key" + end + + result = remove_key_with_http_info(user_service_remove_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_key_with_http_info(user_service_remove_key_request) + if user_service_remove_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_key_request' when calling UserServiceApi.remove_key" + end + + path = '/zitadel.user.v2.UserService/RemoveKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemoveKeyResponse', + nil + ) + end # Remove One-Time Password (OTP) Email from a user # Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. - # @param user_service_remove_otp_email_request [UserServiceRemoveOTPEmailRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemoveOTPEmailResponse] - def remove_otp_email(user_service_remove_otp_email_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_otp_email ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_otp_email_request' is set - if @api_client.config.client_side_validation && user_service_remove_otp_email_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_otp_email_request' when calling Api::UserServiceApi.remove_otp_email" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemoveOTPEmail' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_otp_email_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemoveOTPEmailResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_otp_email", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_otp_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_otp_email_request [UserServiceRemoveOTPEmailRequest] + + # @return [UserServiceRemoveOTPEmailResponse] + # @raise [ApiError] if fails to make API call + def remove_otp_email(user_service_remove_otp_email_request) + if user_service_remove_otp_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_otp_email_request' when calling UserServiceApi.remove_otp_email" + end + + result = remove_otp_email_with_http_info(user_service_remove_otp_email_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_otp_email_with_http_info(user_service_remove_otp_email_request) + if user_service_remove_otp_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_otp_email_request' when calling UserServiceApi.remove_otp_email" + end + + path = '/zitadel.user.v2.UserService/RemoveOTPEmail' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_otp_email_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemoveOTPEmailResponse', + nil + ) + end # Remove One-Time Password (OTP) SMS from a user # Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. - # @param user_service_remove_otpsms_request [UserServiceRemoveOTPSMSRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemoveOTPSMSResponse] - def remove_otpsms(user_service_remove_otpsms_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_otpsms ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_otpsms_request' is set - if @api_client.config.client_side_validation && user_service_remove_otpsms_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_otpsms_request' when calling Api::UserServiceApi.remove_otpsms" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemoveOTPSMS' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_otpsms_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemoveOTPSMSResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_otpsms", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_otpsms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_otpsms_request [UserServiceRemoveOTPSMSRequest] + + # @return [UserServiceRemoveOTPSMSResponse] + # @raise [ApiError] if fails to make API call + def remove_otpsms(user_service_remove_otpsms_request) + if user_service_remove_otpsms_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_otpsms_request' when calling UserServiceApi.remove_otpsms" + end + + result = remove_otpsms_with_http_info(user_service_remove_otpsms_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_otpsms_with_http_info(user_service_remove_otpsms_request) + if user_service_remove_otpsms_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_otpsms_request' when calling UserServiceApi.remove_otpsms" + end + + path = '/zitadel.user.v2.UserService/RemoveOTPSMS' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_otpsms_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemoveOTPSMSResponse', + nil + ) + end # Remove passkey from a user # Remove passkey from a user. - # @param user_service_remove_passkey_request [UserServiceRemovePasskeyRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemovePasskeyResponse] - def remove_passkey(user_service_remove_passkey_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_passkey ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_passkey_request' is set - if @api_client.config.client_side_validation && user_service_remove_passkey_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_passkey_request' when calling Api::UserServiceApi.remove_passkey" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemovePasskey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_passkey_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemovePasskeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_passkey", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_passkey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_passkey_request [UserServiceRemovePasskeyRequest] + + # @return [UserServiceRemovePasskeyResponse] + # @raise [ApiError] if fails to make API call + def remove_passkey(user_service_remove_passkey_request) + if user_service_remove_passkey_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_passkey_request' when calling UserServiceApi.remove_passkey" + end + + result = remove_passkey_with_http_info(user_service_remove_passkey_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_passkey_with_http_info(user_service_remove_passkey_request) + if user_service_remove_passkey_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_passkey_request' when calling UserServiceApi.remove_passkey" + end + + path = '/zitadel.user.v2.UserService/RemovePasskey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_passkey_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemovePasskeyResponse', + nil + ) + end # Remove a Personal Access Token # Removes a machine users personal access token by the given token ID and an optionally given user ID. Required permission: - user.write - # @param user_service_remove_personal_access_token_request [UserServiceRemovePersonalAccessTokenRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemovePersonalAccessTokenResponse] - def remove_personal_access_token(user_service_remove_personal_access_token_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_personal_access_token ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_personal_access_token_request' is set - if @api_client.config.client_side_validation && user_service_remove_personal_access_token_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_personal_access_token_request' when calling Api::UserServiceApi.remove_personal_access_token" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemovePersonalAccessToken' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_personal_access_token_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemovePersonalAccessTokenResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_personal_access_token", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_personal_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_personal_access_token_request [UserServiceRemovePersonalAccessTokenRequest] + + # @return [UserServiceRemovePersonalAccessTokenResponse] + # @raise [ApiError] if fails to make API call + def remove_personal_access_token(user_service_remove_personal_access_token_request) + if user_service_remove_personal_access_token_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_personal_access_token_request' when calling UserServiceApi.remove_personal_access_token" + end + + result = remove_personal_access_token_with_http_info(user_service_remove_personal_access_token_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_personal_access_token_with_http_info(user_service_remove_personal_access_token_request) + if user_service_remove_personal_access_token_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_personal_access_token_request' when calling UserServiceApi.remove_personal_access_token" + end + + path = '/zitadel.user.v2.UserService/RemovePersonalAccessToken' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_personal_access_token_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemovePersonalAccessTokenResponse', + nil + ) + end # Delete the user phone # Deprecated: [Update the users phone field](apis/resources/user_service_v2/user-service-update-user.api.mdx) to remove the phone number. Delete the phone number of a user. - # @param user_service_remove_phone_request [UserServiceRemovePhoneRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemovePhoneResponse] - def remove_phone(user_service_remove_phone_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_phone ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_phone_request' is set - if @api_client.config.client_side_validation && user_service_remove_phone_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_phone_request' when calling Api::UserServiceApi.remove_phone" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemovePhone' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_phone_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemovePhoneResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_phone", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_phone_request [UserServiceRemovePhoneRequest] + + # @return [UserServiceRemovePhoneResponse] + # @raise [ApiError] if fails to make API call + def remove_phone(user_service_remove_phone_request) + if user_service_remove_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_phone_request' when calling UserServiceApi.remove_phone" + end + + result = remove_phone_with_http_info(user_service_remove_phone_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_phone_with_http_info(user_service_remove_phone_request) + if user_service_remove_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_phone_request' when calling UserServiceApi.remove_phone" + end + + path = '/zitadel.user.v2.UserService/RemovePhone' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_phone_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemovePhoneResponse', + nil + ) + end # Remove recovery codes from a user # Remove all recovery codes from the authenticated user. This will disable the recovery code second factor. - # @param user_service_remove_recovery_codes_request [UserServiceRemoveRecoveryCodesRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemoveRecoveryCodesResponse] - def remove_recovery_codes(user_service_remove_recovery_codes_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_recovery_codes ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_recovery_codes_request' is set - if @api_client.config.client_side_validation && user_service_remove_recovery_codes_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_recovery_codes_request' when calling Api::UserServiceApi.remove_recovery_codes" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemoveRecoveryCodes' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_recovery_codes_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemoveRecoveryCodesResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_recovery_codes", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_recovery_codes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_recovery_codes_request [UserServiceRemoveRecoveryCodesRequest] + + # @return [UserServiceRemoveRecoveryCodesResponse] + # @raise [ApiError] if fails to make API call + def remove_recovery_codes(user_service_remove_recovery_codes_request) + if user_service_remove_recovery_codes_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_recovery_codes_request' when calling UserServiceApi.remove_recovery_codes" + end + + result = remove_recovery_codes_with_http_info(user_service_remove_recovery_codes_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_recovery_codes_with_http_info(user_service_remove_recovery_codes_request) + if user_service_remove_recovery_codes_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_recovery_codes_request' when calling UserServiceApi.remove_recovery_codes" + end + + path = '/zitadel.user.v2.UserService/RemoveRecoveryCodes' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_recovery_codes_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemoveRecoveryCodesResponse', + nil + ) + end # Remove a Users Secret # Remove the current client ID and client secret from a machine user. Required permission: - user.write - # @param user_service_remove_secret_request [UserServiceRemoveSecretRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemoveSecretResponse] - def remove_secret(user_service_remove_secret_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_secret ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_secret_request' is set - if @api_client.config.client_side_validation && user_service_remove_secret_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_secret_request' when calling Api::UserServiceApi.remove_secret" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemoveSecret' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_secret_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemoveSecretResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_secret", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_secret_request [UserServiceRemoveSecretRequest] + + # @return [UserServiceRemoveSecretResponse] + # @raise [ApiError] if fails to make API call + def remove_secret(user_service_remove_secret_request) + if user_service_remove_secret_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_secret_request' when calling UserServiceApi.remove_secret" + end + + result = remove_secret_with_http_info(user_service_remove_secret_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_secret_with_http_info(user_service_remove_secret_request) + if user_service_remove_secret_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_secret_request' when calling UserServiceApi.remove_secret" + end + + path = '/zitadel.user.v2.UserService/RemoveSecret' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_secret_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemoveSecretResponse', + nil + ) + end # Remove TOTP generator from a user # Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. - # @param user_service_remove_totp_request [UserServiceRemoveTOTPRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemoveTOTPResponse] - def remove_totp(user_service_remove_totp_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_totp ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_totp_request' is set - if @api_client.config.client_side_validation && user_service_remove_totp_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_totp_request' when calling Api::UserServiceApi.remove_totp" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemoveTOTP' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_totp_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemoveTOTPResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_totp", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_totp\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_totp_request [UserServiceRemoveTOTPRequest] + + # @return [UserServiceRemoveTOTPResponse] + # @raise [ApiError] if fails to make API call + def remove_totp(user_service_remove_totp_request) + if user_service_remove_totp_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_totp_request' when calling UserServiceApi.remove_totp" + end + + result = remove_totp_with_http_info(user_service_remove_totp_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_totp_with_http_info(user_service_remove_totp_request) + if user_service_remove_totp_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_totp_request' when calling UserServiceApi.remove_totp" + end + + path = '/zitadel.user.v2.UserService/RemoveTOTP' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_totp_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemoveTOTPResponse', + nil + ) + end # Remove u2f token from a user # Remove u2f token from a user. - # @param user_service_remove_u2_f_request [UserServiceRemoveU2FRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRemoveU2FResponse] - def remove_u2_f(user_service_remove_u2_f_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.remove_u2_f ...' # MODIFIED - end - # verify the required parameter 'user_service_remove_u2_f_request' is set - if @api_client.config.client_side_validation && user_service_remove_u2_f_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_remove_u2_f_request' when calling Api::UserServiceApi.remove_u2_f" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RemoveU2F' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_remove_u2_f_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRemoveU2FResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.remove_u2_f", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#remove_u2_f\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_remove_u2_f_request [UserServiceRemoveU2FRequest] + + # @return [UserServiceRemoveU2FResponse] + # @raise [ApiError] if fails to make API call + def remove_u2_f(user_service_remove_u2_f_request) + if user_service_remove_u2_f_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_u2_f_request' when calling UserServiceApi.remove_u2_f" + end + + result = remove_u2_f_with_http_info(user_service_remove_u2_f_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def remove_u2_f_with_http_info(user_service_remove_u2_f_request) + if user_service_remove_u2_f_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_remove_u2_f_request' when calling UserServiceApi.remove_u2_f" + end + + path = '/zitadel.user.v2.UserService/RemoveU2F' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_remove_u2_f_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRemoveU2FResponse', + nil + ) + end # Resend code to verify user email # Resend code to verify user email - # @param user_service_resend_email_code_request [UserServiceResendEmailCodeRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceResendEmailCodeResponse] - def resend_email_code(user_service_resend_email_code_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.resend_email_code ...' # MODIFIED - end - # verify the required parameter 'user_service_resend_email_code_request' is set - if @api_client.config.client_side_validation && user_service_resend_email_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_resend_email_code_request' when calling Api::UserServiceApi.resend_email_code" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ResendEmailCode' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_resend_email_code_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceResendEmailCodeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.resend_email_code", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#resend_email_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_resend_email_code_request [UserServiceResendEmailCodeRequest] + + # @return [UserServiceResendEmailCodeResponse] + # @raise [ApiError] if fails to make API call + def resend_email_code(user_service_resend_email_code_request) + if user_service_resend_email_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_resend_email_code_request' when calling UserServiceApi.resend_email_code" + end + + result = resend_email_code_with_http_info(user_service_resend_email_code_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def resend_email_code_with_http_info(user_service_resend_email_code_request) + if user_service_resend_email_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_resend_email_code_request' when calling UserServiceApi.resend_email_code" + end + + path = '/zitadel.user.v2.UserService/ResendEmailCode' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_resend_email_code_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceResendEmailCodeResponse', + nil + ) + end # Resend an invite code for a user - # Deprecated: Use [CreateInviteCode](apis/resources/user_service_v2/user-service-create-invite-code.api.mdx) instead. Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. - # @param user_service_resend_invite_code_request [UserServiceResendInviteCodeRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceResendInviteCodeResponse] - def resend_invite_code(user_service_resend_invite_code_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.resend_invite_code ...' # MODIFIED - end - # verify the required parameter 'user_service_resend_invite_code_request' is set - if @api_client.config.client_side_validation && user_service_resend_invite_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_resend_invite_code_request' when calling Api::UserServiceApi.resend_invite_code" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ResendInviteCode' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_resend_invite_code_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceResendInviteCodeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.resend_invite_code", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#resend_invite_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Deprecated: Use [CreateInviteCode](apis/resources/user_service_v2/user-service-create-invite-code.api.mdx) instead. Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. + # @param user_service_resend_invite_code_request [UserServiceResendInviteCodeRequest] + + # @return [UserServiceResendInviteCodeResponse] + # @raise [ApiError] if fails to make API call + def resend_invite_code(user_service_resend_invite_code_request) + if user_service_resend_invite_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_resend_invite_code_request' when calling UserServiceApi.resend_invite_code" + end + + result = resend_invite_code_with_http_info(user_service_resend_invite_code_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def resend_invite_code_with_http_info(user_service_resend_invite_code_request) + if user_service_resend_invite_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_resend_invite_code_request' when calling UserServiceApi.resend_invite_code" + end + + path = '/zitadel.user.v2.UserService/ResendInviteCode' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_resend_invite_code_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceResendInviteCodeResponse', + nil + ) + end # Resend code to verify user phone number # Resend code to verify user phone number. - # @param user_service_resend_phone_code_request [UserServiceResendPhoneCodeRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceResendPhoneCodeResponse] - def resend_phone_code(user_service_resend_phone_code_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.resend_phone_code ...' # MODIFIED - end - # verify the required parameter 'user_service_resend_phone_code_request' is set - if @api_client.config.client_side_validation && user_service_resend_phone_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_resend_phone_code_request' when calling Api::UserServiceApi.resend_phone_code" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/ResendPhoneCode' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_resend_phone_code_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceResendPhoneCodeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.resend_phone_code", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#resend_phone_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_resend_phone_code_request [UserServiceResendPhoneCodeRequest] + + # @return [UserServiceResendPhoneCodeResponse] + # @raise [ApiError] if fails to make API call + def resend_phone_code(user_service_resend_phone_code_request) + if user_service_resend_phone_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_resend_phone_code_request' when calling UserServiceApi.resend_phone_code" + end + + result = resend_phone_code_with_http_info(user_service_resend_phone_code_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def resend_phone_code_with_http_info(user_service_resend_phone_code_request) + if user_service_resend_phone_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_resend_phone_code_request' when calling UserServiceApi.resend_phone_code" + end + + path = '/zitadel.user.v2.UserService/ResendPhoneCode' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_resend_phone_code_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceResendPhoneCodeResponse', + nil + ) + end # Retrieve the information returned by the identity provider # Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. - # @param user_service_retrieve_identity_provider_intent_request [UserServiceRetrieveIdentityProviderIntentRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceRetrieveIdentityProviderIntentResponse] - def retrieve_identity_provider_intent(user_service_retrieve_identity_provider_intent_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.retrieve_identity_provider_intent ...' # MODIFIED - end - # verify the required parameter 'user_service_retrieve_identity_provider_intent_request' is set - if @api_client.config.client_side_validation && user_service_retrieve_identity_provider_intent_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_retrieve_identity_provider_intent_request' when calling Api::UserServiceApi.retrieve_identity_provider_intent" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/RetrieveIdentityProviderIntent' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_retrieve_identity_provider_intent_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceRetrieveIdentityProviderIntentResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.retrieve_identity_provider_intent", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#retrieve_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_retrieve_identity_provider_intent_request [UserServiceRetrieveIdentityProviderIntentRequest] + + # @return [UserServiceRetrieveIdentityProviderIntentResponse] + # @raise [ApiError] if fails to make API call + def retrieve_identity_provider_intent(user_service_retrieve_identity_provider_intent_request) + if user_service_retrieve_identity_provider_intent_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_retrieve_identity_provider_intent_request' when calling UserServiceApi.retrieve_identity_provider_intent" + end + + result = retrieve_identity_provider_intent_with_http_info(user_service_retrieve_identity_provider_intent_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def retrieve_identity_provider_intent_with_http_info(user_service_retrieve_identity_provider_intent_request) + if user_service_retrieve_identity_provider_intent_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_retrieve_identity_provider_intent_request' when calling UserServiceApi.retrieve_identity_provider_intent" + end + + path = '/zitadel.user.v2.UserService/RetrieveIdentityProviderIntent' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_retrieve_identity_provider_intent_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceRetrieveIdentityProviderIntentResponse', + nil + ) + end # Send code to verify user email # Send code to verify user email - # @param user_service_send_email_code_request [UserServiceSendEmailCodeRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceSendEmailCodeResponse] - def send_email_code(user_service_send_email_code_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.send_email_code ...' # MODIFIED - end - # verify the required parameter 'user_service_send_email_code_request' is set - if @api_client.config.client_side_validation && user_service_send_email_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_send_email_code_request' when calling Api::UserServiceApi.send_email_code" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/SendEmailCode' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_send_email_code_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceSendEmailCodeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.send_email_code", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#send_email_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_send_email_code_request [UserServiceSendEmailCodeRequest] + + # @return [UserServiceSendEmailCodeResponse] + # @raise [ApiError] if fails to make API call + def send_email_code(user_service_send_email_code_request) + if user_service_send_email_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_send_email_code_request' when calling UserServiceApi.send_email_code" + end + + result = send_email_code_with_http_info(user_service_send_email_code_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def send_email_code_with_http_info(user_service_send_email_code_request) + if user_service_send_email_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_send_email_code_request' when calling UserServiceApi.send_email_code" + end + + path = '/zitadel.user.v2.UserService/SendEmailCode' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_send_email_code_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceSendEmailCodeResponse', + nil + ) + end # Change the user email # Deprecated: [Update the users email field](apis/resources/user_service_v2/user-service-update-user.api.mdx). Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. - # @param user_service_set_email_request [UserServiceSetEmailRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceSetEmailResponse] - def set_email(user_service_set_email_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.set_email ...' # MODIFIED - end - # verify the required parameter 'user_service_set_email_request' is set - if @api_client.config.client_side_validation && user_service_set_email_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_set_email_request' when calling Api::UserServiceApi.set_email" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/SetEmail' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_set_email_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceSetEmailResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.set_email", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#set_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_set_email_request [UserServiceSetEmailRequest] + + # @return [UserServiceSetEmailResponse] + # @raise [ApiError] if fails to make API call + def set_email(user_service_set_email_request) + if user_service_set_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_set_email_request' when calling UserServiceApi.set_email" + end + + result = set_email_with_http_info(user_service_set_email_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_email_with_http_info(user_service_set_email_request) + if user_service_set_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_set_email_request' when calling UserServiceApi.set_email" + end + + path = '/zitadel.user.v2.UserService/SetEmail' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_set_email_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceSetEmailResponse', + nil + ) + end # Change password # Deprecated: [Update the users password](apis/resources/user_service_v2/user-service-update-user.api.mdx) instead. Change the password of a user with either a verification code or the current password.. - # @param user_service_set_password_request [UserServiceSetPasswordRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceSetPasswordResponse] - def set_password(user_service_set_password_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.set_password ...' # MODIFIED - end - # verify the required parameter 'user_service_set_password_request' is set - if @api_client.config.client_side_validation && user_service_set_password_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_set_password_request' when calling Api::UserServiceApi.set_password" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/SetPassword' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_set_password_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceSetPasswordResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.set_password", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#set_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_set_password_request [UserServiceSetPasswordRequest] + + # @return [UserServiceSetPasswordResponse] + # @raise [ApiError] if fails to make API call + def set_password(user_service_set_password_request) + if user_service_set_password_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_set_password_request' when calling UserServiceApi.set_password" + end + + result = set_password_with_http_info(user_service_set_password_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_password_with_http_info(user_service_set_password_request) + if user_service_set_password_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_set_password_request' when calling UserServiceApi.set_password" + end + + path = '/zitadel.user.v2.UserService/SetPassword' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_set_password_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceSetPasswordResponse', + nil + ) + end # Set the user phone # Deprecated: [Update the users phone field](apis/resources/user_service_v2/user-service-update-user.api.mdx). Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. - # @param user_service_set_phone_request [UserServiceSetPhoneRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceSetPhoneResponse] - def set_phone(user_service_set_phone_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.set_phone ...' # MODIFIED - end - # verify the required parameter 'user_service_set_phone_request' is set - if @api_client.config.client_side_validation && user_service_set_phone_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_set_phone_request' when calling Api::UserServiceApi.set_phone" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/SetPhone' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_set_phone_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceSetPhoneResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.set_phone", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#set_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_set_phone_request [UserServiceSetPhoneRequest] + + # @return [UserServiceSetPhoneResponse] + # @raise [ApiError] if fails to make API call + def set_phone(user_service_set_phone_request) + if user_service_set_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_set_phone_request' when calling UserServiceApi.set_phone" + end + + result = set_phone_with_http_info(user_service_set_phone_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_phone_with_http_info(user_service_set_phone_request) + if user_service_set_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_set_phone_request' when calling UserServiceApi.set_phone" + end + + path = '/zitadel.user.v2.UserService/SetPhone' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_set_phone_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceSetPhoneResponse', + nil + ) + end # Set User Metadata - # Sets a list of key value pairs. Existing metadata entries with matching keys are overwritten. Existing metadata entries without matching keys are untouched. To remove metadata entries, use [DeleteUserMetadata](apis/resources/user_service_v2/user-service-delete-user-metadata.api.mdx). For HTTP requests, make sure the bytes array value is base64 encoded. Required permission: - `user.write` - # @param user_service_set_user_metadata_request [UserServiceSetUserMetadataRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceSetUserMetadataResponse] - def set_user_metadata(user_service_set_user_metadata_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.set_user_metadata ...' # MODIFIED - end - # verify the required parameter 'user_service_set_user_metadata_request' is set - if @api_client.config.client_side_validation && user_service_set_user_metadata_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_set_user_metadata_request' when calling Api::UserServiceApi.set_user_metadata" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/SetUserMetadata' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_set_user_metadata_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceSetUserMetadataResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.set_user_metadata", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#set_user_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Sets a list of key value pairs. Existing metadata entries with matching keys are overwritten. Existing metadata entries without matching keys are untouched. To remove metadata entries, use [DeleteUserMetadata](apis/resources/user_service_v2/user-service-delete-user-metadata.api.mdx). For HTTP requests, make sure the bytes array value is base64 encoded. Required permission: - `user.write` + # @param user_service_set_user_metadata_request [UserServiceSetUserMetadataRequest] + + # @return [UserServiceSetUserMetadataResponse] + # @raise [ApiError] if fails to make API call + def set_user_metadata(user_service_set_user_metadata_request) + if user_service_set_user_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_set_user_metadata_request' when calling UserServiceApi.set_user_metadata" + end + + result = set_user_metadata_with_http_info(user_service_set_user_metadata_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def set_user_metadata_with_http_info(user_service_set_user_metadata_request) + if user_service_set_user_metadata_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_set_user_metadata_request' when calling UserServiceApi.set_user_metadata" + end + + path = '/zitadel.user.v2.UserService/SetUserMetadata' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_set_user_metadata_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceSetUserMetadataResponse', + nil + ) + end # Start flow with an identity provider # Start a flow with an identity provider, for external login, registration or linking.. - # @param user_service_start_identity_provider_intent_request [UserServiceStartIdentityProviderIntentRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceStartIdentityProviderIntentResponse] - def start_identity_provider_intent(user_service_start_identity_provider_intent_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.start_identity_provider_intent ...' # MODIFIED - end - # verify the required parameter 'user_service_start_identity_provider_intent_request' is set - if @api_client.config.client_side_validation && user_service_start_identity_provider_intent_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_start_identity_provider_intent_request' when calling Api::UserServiceApi.start_identity_provider_intent" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/StartIdentityProviderIntent' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_start_identity_provider_intent_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceStartIdentityProviderIntentResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.start_identity_provider_intent", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#start_identity_provider_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_start_identity_provider_intent_request [UserServiceStartIdentityProviderIntentRequest] + + # @return [UserServiceStartIdentityProviderIntentResponse] + # @raise [ApiError] if fails to make API call + def start_identity_provider_intent(user_service_start_identity_provider_intent_request) + if user_service_start_identity_provider_intent_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_start_identity_provider_intent_request' when calling UserServiceApi.start_identity_provider_intent" + end + + result = start_identity_provider_intent_with_http_info(user_service_start_identity_provider_intent_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def start_identity_provider_intent_with_http_info(user_service_start_identity_provider_intent_request) + if user_service_start_identity_provider_intent_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_start_identity_provider_intent_request' when calling UserServiceApi.start_identity_provider_intent" + end + + path = '/zitadel.user.v2.UserService/StartIdentityProviderIntent' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_start_identity_provider_intent_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceStartIdentityProviderIntentResponse', + nil + ) + end # Unlock user - # The state of the user will be changed to 'active'. The user will be able to log in again. The endpoint returns an error if the user is not in the state 'locked'. - # @param user_service_unlock_user_request [UserServiceUnlockUserRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceUnlockUserResponse] - def unlock_user(user_service_unlock_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.unlock_user ...' # MODIFIED - end - # verify the required parameter 'user_service_unlock_user_request' is set - if @api_client.config.client_side_validation && user_service_unlock_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_unlock_user_request' when calling Api::UserServiceApi.unlock_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/UnlockUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_unlock_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceUnlockUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.unlock_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#unlock_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # The state of the user will be changed to 'active'. The user will be able to log in again. The endpoint returns an error if the user is not in the state 'locked'. + # @param user_service_unlock_user_request [UserServiceUnlockUserRequest] + + # @return [UserServiceUnlockUserResponse] + # @raise [ApiError] if fails to make API call + def unlock_user(user_service_unlock_user_request) + if user_service_unlock_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_unlock_user_request' when calling UserServiceApi.unlock_user" + end + + result = unlock_user_with_http_info(user_service_unlock_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def unlock_user_with_http_info(user_service_unlock_user_request) + if user_service_unlock_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_unlock_user_request' when calling UserServiceApi.unlock_user" + end + + path = '/zitadel.user.v2.UserService/UnlockUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_unlock_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceUnlockUserResponse', + nil + ) + end # Update Human User # Deprecated: Use [UpdateUser](apis/resources/user_service_v2/user-service-update-user.api.mdx) to update a user of type human instead. Update all information from a user. - # @param user_service_update_human_user_request [UserServiceUpdateHumanUserRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceUpdateHumanUserResponse] - def update_human_user(user_service_update_human_user_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.update_human_user ...' # MODIFIED - end - # verify the required parameter 'user_service_update_human_user_request' is set - if @api_client.config.client_side_validation && user_service_update_human_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_update_human_user_request' when calling Api::UserServiceApi.update_human_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/UpdateHumanUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_update_human_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceUpdateHumanUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.update_human_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#update_human_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_update_human_user_request [UserServiceUpdateHumanUserRequest] + + # @return [UserServiceUpdateHumanUserResponse] + # @raise [ApiError] if fails to make API call + def update_human_user(user_service_update_human_user_request) + if user_service_update_human_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_update_human_user_request' when calling UserServiceApi.update_human_user" + end + + result = update_human_user_with_http_info(user_service_update_human_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_human_user_with_http_info(user_service_update_human_user_request) + if user_service_update_human_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_update_human_user_request' when calling UserServiceApi.update_human_user" + end + + path = '/zitadel.user.v2.UserService/UpdateHumanUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_update_human_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceUpdateHumanUserResponse', + nil + ) + end # Update a User # Partially update an existing user. If you change the users email or phone, you can specify how the ownership should be verified. If you change the users password, you can specify if the password should be changed again on the users next login. Required permission: - user.write - # @param user_service_update_user_request [UserServiceUpdateUserRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceUpdateUserResponse] - def update_user(user_service_update_user_request = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.update_user ...' # MODIFIED - end - # verify the required parameter 'user_service_update_user_request' is set - if @api_client.config.client_side_validation && user_service_update_user_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_update_user_request' when calling Api::UserServiceApi.update_user" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/UpdateUser' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_update_user_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceUpdateUserResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.update_user", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_update_user_request [UserServiceUpdateUserRequest] + + # @return [UserServiceUpdateUserResponse] + # @raise [ApiError] if fails to make API call + def update_user(user_service_update_user_request) + if user_service_update_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_update_user_request' when calling UserServiceApi.update_user" + end + + result = update_user_with_http_info(user_service_update_user_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def update_user_with_http_info(user_service_update_user_request) + if user_service_update_user_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_update_user_request' when calling UserServiceApi.update_user" + end + + path = '/zitadel.user.v2.UserService/UpdateUser' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_update_user_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceUpdateUserResponse', + nil + ) + end # Verify the email # Verify the email with the generated code. - # @param user_service_verify_email_request [UserServiceVerifyEmailRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceVerifyEmailResponse] - def verify_email(user_service_verify_email_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_email ...' # MODIFIED - end - # verify the required parameter 'user_service_verify_email_request' is set - if @api_client.config.client_side_validation && user_service_verify_email_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_email_request' when calling Api::UserServiceApi.verify_email" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/VerifyEmail' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_verify_email_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceVerifyEmailResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.verify_email", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_verify_email_request [UserServiceVerifyEmailRequest] + + # @return [UserServiceVerifyEmailResponse] + # @raise [ApiError] if fails to make API call + def verify_email(user_service_verify_email_request) + if user_service_verify_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_email_request' when calling UserServiceApi.verify_email" + end + + result = verify_email_with_http_info(user_service_verify_email_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_email_with_http_info(user_service_verify_email_request) + if user_service_verify_email_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_email_request' when calling UserServiceApi.verify_email" + end + + path = '/zitadel.user.v2.UserService/VerifyEmail' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_verify_email_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceVerifyEmailResponse', + nil + ) + end # Verify an invite code for a user - # Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. - # @param user_service_verify_invite_code_request [UserServiceVerifyInviteCodeRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceVerifyInviteCodeResponse] - def verify_invite_code(user_service_verify_invite_code_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_invite_code ...' # MODIFIED - end - # verify the required parameter 'user_service_verify_invite_code_request' is set - if @api_client.config.client_side_validation && user_service_verify_invite_code_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_invite_code_request' when calling Api::UserServiceApi.verify_invite_code" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/VerifyInviteCode' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_verify_invite_code_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceVerifyInviteCodeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.verify_invite_code", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_invite_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. + # @param user_service_verify_invite_code_request [UserServiceVerifyInviteCodeRequest] + + # @return [UserServiceVerifyInviteCodeResponse] + # @raise [ApiError] if fails to make API call + def verify_invite_code(user_service_verify_invite_code_request) + if user_service_verify_invite_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_invite_code_request' when calling UserServiceApi.verify_invite_code" + end + + result = verify_invite_code_with_http_info(user_service_verify_invite_code_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_invite_code_with_http_info(user_service_verify_invite_code_request) + if user_service_verify_invite_code_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_invite_code_request' when calling UserServiceApi.verify_invite_code" + end + + path = '/zitadel.user.v2.UserService/VerifyInviteCode' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_verify_invite_code_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceVerifyInviteCodeResponse', + nil + ) + end # Verify a passkey for a user # Verify the passkey registration with the public key credential.. - # @param user_service_verify_passkey_registration_request [UserServiceVerifyPasskeyRegistrationRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceVerifyPasskeyRegistrationResponse] - def verify_passkey_registration(user_service_verify_passkey_registration_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_passkey_registration ...' # MODIFIED - end - # verify the required parameter 'user_service_verify_passkey_registration_request' is set - if @api_client.config.client_side_validation && user_service_verify_passkey_registration_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_passkey_registration_request' when calling Api::UserServiceApi.verify_passkey_registration" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/VerifyPasskeyRegistration' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_verify_passkey_registration_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceVerifyPasskeyRegistrationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.verify_passkey_registration", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_passkey_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_verify_passkey_registration_request [UserServiceVerifyPasskeyRegistrationRequest] + + # @return [UserServiceVerifyPasskeyRegistrationResponse] + # @raise [ApiError] if fails to make API call + def verify_passkey_registration(user_service_verify_passkey_registration_request) + if user_service_verify_passkey_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_passkey_registration_request' when calling UserServiceApi.verify_passkey_registration" + end + + result = verify_passkey_registration_with_http_info(user_service_verify_passkey_registration_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_passkey_registration_with_http_info(user_service_verify_passkey_registration_request) + if user_service_verify_passkey_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_passkey_registration_request' when calling UserServiceApi.verify_passkey_registration" + end + + path = '/zitadel.user.v2.UserService/VerifyPasskeyRegistration' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_verify_passkey_registration_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceVerifyPasskeyRegistrationResponse', + nil + ) + end # Verify the phone number # Verify the phone number with the generated code. - # @param user_service_verify_phone_request [UserServiceVerifyPhoneRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceVerifyPhoneResponse] - def verify_phone(user_service_verify_phone_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_phone ...' # MODIFIED - end - # verify the required parameter 'user_service_verify_phone_request' is set - if @api_client.config.client_side_validation && user_service_verify_phone_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_phone_request' when calling Api::UserServiceApi.verify_phone" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/VerifyPhone' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_verify_phone_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceVerifyPhoneResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.verify_phone", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_phone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_verify_phone_request [UserServiceVerifyPhoneRequest] + + # @return [UserServiceVerifyPhoneResponse] + # @raise [ApiError] if fails to make API call + def verify_phone(user_service_verify_phone_request) + if user_service_verify_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_phone_request' when calling UserServiceApi.verify_phone" + end + + result = verify_phone_with_http_info(user_service_verify_phone_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_phone_with_http_info(user_service_verify_phone_request) + if user_service_verify_phone_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_phone_request' when calling UserServiceApi.verify_phone" + end + + path = '/zitadel.user.v2.UserService/VerifyPhone' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_verify_phone_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceVerifyPhoneResponse', + nil + ) + end # Verify a TOTP generator for a user # Verify the TOTP registration with a generated code.. - # @param user_service_verify_totp_registration_request [UserServiceVerifyTOTPRegistrationRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceVerifyTOTPRegistrationResponse] - def verify_totp_registration(user_service_verify_totp_registration_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_totp_registration ...' # MODIFIED - end - # verify the required parameter 'user_service_verify_totp_registration_request' is set - if @api_client.config.client_side_validation && user_service_verify_totp_registration_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_totp_registration_request' when calling Api::UserServiceApi.verify_totp_registration" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/VerifyTOTPRegistration' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_verify_totp_registration_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceVerifyTOTPRegistrationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.verify_totp_registration", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_totp_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @param user_service_verify_totp_registration_request [UserServiceVerifyTOTPRegistrationRequest] + + # @return [UserServiceVerifyTOTPRegistrationResponse] + # @raise [ApiError] if fails to make API call + def verify_totp_registration(user_service_verify_totp_registration_request) + if user_service_verify_totp_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_totp_registration_request' when calling UserServiceApi.verify_totp_registration" + end + + result = verify_totp_registration_with_http_info(user_service_verify_totp_registration_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_totp_registration_with_http_info(user_service_verify_totp_registration_request) + if user_service_verify_totp_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_totp_registration_request' when calling UserServiceApi.verify_totp_registration" + end + + path = '/zitadel.user.v2.UserService/VerifyTOTPRegistration' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_verify_totp_registration_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceVerifyTOTPRegistrationResponse', + nil + ) + end # Verify a u2f token for a user # Verify the u2f token registration with the public key credential.. - # @param user_service_verify_u2_f_registration_request [UserServiceVerifyU2FRegistrationRequest] - # @param [Hash] opts the optional parameters - # @return [UserServiceVerifyU2FRegistrationResponse] - def verify_u2_f_registration(user_service_verify_u2_f_registration_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::UserServiceApi.verify_u2_f_registration ...' # MODIFIED - end - # verify the required parameter 'user_service_verify_u2_f_registration_request' is set - if @api_client.config.client_side_validation && user_service_verify_u2_f_registration_request.nil? - fail ArgumentError, "Missing the required parameter 'user_service_verify_u2_f_registration_request' when calling Api::UserServiceApi.verify_u2_f_registration" # MODIFIED - end - # resource path - local_var_path = '/zitadel.user.v2.UserService/VerifyU2FRegistration' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_service_verify_u2_f_registration_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserServiceVerifyU2FRegistrationResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::UserServiceApi.verify_u2_f_registration", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::UserServiceApi#verify_u2_f_registration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @param user_service_verify_u2_f_registration_request [UserServiceVerifyU2FRegistrationRequest] + + # @return [UserServiceVerifyU2FRegistrationResponse] + # @raise [ApiError] if fails to make API call + def verify_u2_f_registration(user_service_verify_u2_f_registration_request) + if user_service_verify_u2_f_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_u2_f_registration_request' when calling UserServiceApi.verify_u2_f_registration" + end + + result = verify_u2_f_registration_with_http_info(user_service_verify_u2_f_registration_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data + end + + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def verify_u2_f_registration_with_http_info(user_service_verify_u2_f_registration_request) + if user_service_verify_u2_f_registration_request.nil? + raise ArgumentError, + "Missing the required parameter 'user_service_verify_u2_f_registration_request' when calling UserServiceApi.verify_u2_f_registration" + end + + path = '/zitadel.user.v2.UserService/VerifyU2FRegistration' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = user_service_verify_u2_f_registration_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'UserServiceVerifyU2FRegistrationResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api/web_key_service_api.rb b/lib/zitadel/client/api/web_key_service_api.rb index 03f175bf..3c1e2c78 100644 --- a/lib/zitadel/client/api/web_key_service_api.rb +++ b/lib/zitadel/client/api/web_key_service_api.rb @@ -1,254 +1,234 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'cgi' - -module Zitadel::Client::Api - class WebKeyServiceApi - attr_accessor :api_client +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + module Api + + # WebKeyServiceApi provides methods for the WebKeyService API group. + class WebKeyServiceApi < BaseApi + def initialize(api_client = nil, config = ::Zitadel::Client::Configuration.default, authenticator = nil) + super + end - def initialize(api_client = ApiClient.default) - @api_client = api_client - end # Activate Web Key - # Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` - # @param web_key_service_activate_web_key_request [WebKeyServiceActivateWebKeyRequest] - # @param [Hash] opts the optional parameters - # @return [WebKeyServiceActivateWebKeyResponse] - def activate_web_key(web_key_service_activate_web_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.activate_web_key ...' # MODIFIED - end - # verify the required parameter 'web_key_service_activate_web_key_request' is set - if @api_client.config.client_side_validation && web_key_service_activate_web_key_request.nil? - fail ArgumentError, "Missing the required parameter 'web_key_service_activate_web_key_request' when calling Api::WebKeyServiceApi.activate_web_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.webkey.v2.WebKeyService/ActivateWebKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` + # @param web_key_service_activate_web_key_request [WebKeyServiceActivateWebKeyRequest] + + # @return [WebKeyServiceActivateWebKeyResponse] + # @raise [ApiError] if fails to make API call + def activate_web_key(web_key_service_activate_web_key_request) + if web_key_service_activate_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'web_key_service_activate_web_key_request' when calling WebKeyServiceApi.activate_web_key" + end + + result = activate_web_key_with_http_info(web_key_service_activate_web_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(web_key_service_activate_web_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'WebKeyServiceActivateWebKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::WebKeyServiceApi.activate_web_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::WebKeyServiceApi#activate_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def activate_web_key_with_http_info(web_key_service_activate_web_key_request) + if web_key_service_activate_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'web_key_service_activate_web_key_request' when calling WebKeyServiceApi.activate_web_key" + end + + path = '/zitadel.webkey.v2.WebKeyService/ActivateWebKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = web_key_service_activate_web_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'WebKeyServiceActivateWebKeyResponse', + nil + ) + end # Create Web Key - # Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` - # @param web_key_service_create_web_key_request [WebKeyServiceCreateWebKeyRequest] - # @param [Hash] opts the optional parameters - # @return [WebKeyServiceCreateWebKeyResponse] - def create_web_key(web_key_service_create_web_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.create_web_key ...' # MODIFIED - end - # verify the required parameter 'web_key_service_create_web_key_request' is set - if @api_client.config.client_side_validation && web_key_service_create_web_key_request.nil? - fail ArgumentError, "Missing the required parameter 'web_key_service_create_web_key_request' when calling Api::WebKeyServiceApi.create_web_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.webkey.v2.WebKeyService/CreateWebKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` + # @param web_key_service_create_web_key_request [WebKeyServiceCreateWebKeyRequest] + + # @return [WebKeyServiceCreateWebKeyResponse] + # @raise [ApiError] if fails to make API call + def create_web_key(web_key_service_create_web_key_request) + if web_key_service_create_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'web_key_service_create_web_key_request' when calling WebKeyServiceApi.create_web_key" + end + + result = create_web_key_with_http_info(web_key_service_create_web_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(web_key_service_create_web_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'WebKeyServiceCreateWebKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::WebKeyServiceApi.create_web_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::WebKeyServiceApi#create_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def create_web_key_with_http_info(web_key_service_create_web_key_request) + if web_key_service_create_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'web_key_service_create_web_key_request' when calling WebKeyServiceApi.create_web_key" + end + + path = '/zitadel.webkey.v2.WebKeyService/CreateWebKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = web_key_service_create_web_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'WebKeyServiceCreateWebKeyResponse', + nil + ) + end # Delete Web Key - # Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` - # @param web_key_service_delete_web_key_request [WebKeyServiceDeleteWebKeyRequest] - # @param [Hash] opts the optional parameters - # @return [WebKeyServiceDeleteWebKeyResponse] - def delete_web_key(web_key_service_delete_web_key_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.delete_web_key ...' # MODIFIED - end - # verify the required parameter 'web_key_service_delete_web_key_request' is set - if @api_client.config.client_side_validation && web_key_service_delete_web_key_request.nil? - fail ArgumentError, "Missing the required parameter 'web_key_service_delete_web_key_request' when calling Api::WebKeyServiceApi.delete_web_key" # MODIFIED - end - # resource path - local_var_path = '/zitadel.webkey.v2.WebKeyService/DeleteWebKey' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` + # @param web_key_service_delete_web_key_request [WebKeyServiceDeleteWebKeyRequest] + + # @return [WebKeyServiceDeleteWebKeyResponse] + # @raise [ApiError] if fails to make API call + def delete_web_key(web_key_service_delete_web_key_request) + if web_key_service_delete_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'web_key_service_delete_web_key_request' when calling WebKeyServiceApi.delete_web_key" + end + + result = delete_web_key_with_http_info(web_key_service_delete_web_key_request) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(web_key_service_delete_web_key_request) - - # return_type - return_type = opts[:debug_return_type] || 'WebKeyServiceDeleteWebKeyResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::WebKeyServiceApi.delete_web_key", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::WebKeyServiceApi#delete_web_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data - end + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def delete_web_key_with_http_info(web_key_service_delete_web_key_request) + if web_key_service_delete_web_key_request.nil? + raise ArgumentError, + "Missing the required parameter 'web_key_service_delete_web_key_request' when calling WebKeyServiceApi.delete_web_key" + end + + path = '/zitadel.webkey.v2.WebKeyService/DeleteWebKey' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = web_key_service_delete_web_key_request + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'WebKeyServiceDeleteWebKeyResponse', + nil + ) + end # List Web Keys - # List all web keys and their states. Required permission: - `iam.web_key.read` - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [WebKeyServiceListWebKeysResponse] - def list_web_keys(body = {}, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: Api::WebKeyServiceApi.list_web_keys ...' # MODIFIED - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling Api::WebKeyServiceApi.list_web_keys" # MODIFIED - end - # resource path - local_var_path = '/zitadel.webkey.v2.WebKeyService/ListWebKeys' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type + # List all web keys and their states. Required permission: - `iam.web_key.read` + # @param body [Object] + + # @return [WebKeyServiceListWebKeysResponse] + # @raise [ApiError] if fails to make API call + def list_web_keys(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling WebKeyServiceApi.list_web_keys" + end + + result = list_web_keys_with_http_info(body) + # This operation declares a non-void return type. When the server + # responds with an empty/undecodable body (204, empty 200), the + # unwrapped convenience method has no value to return. Surface this + # loudly as a typed ApiError instead of handing back a silent nil, + # so callers see the same catchable error across all SDKs. + if result.data.nil? + raise ::Zitadel::Client::ApiError.new( + message: 'Expected a non-empty response body but the server returned no decodable content', + status_code: result.status_code, + response_headers: result.headers, + response_body: result.raw_body + ) + end + result.data end - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'WebKeyServiceListWebKeysResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['zitadelAccessToken'] - - new_options = opts.merge( - :operation => :"Api::WebKeyServiceApi.list_web_keys", # MODIFIED - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: Api::WebKeyServiceApi#list_web_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" # MODIFIED - end - return data + # @return [ApiResult] + # @raise [ApiError] if fails to make API call + def list_web_keys_with_http_info(body) + if body.nil? + raise ArgumentError, + "Missing the required parameter 'body' when calling WebKeyServiceApi.list_web_keys" + end + + path = '/zitadel.webkey.v2.WebKeyService/ListWebKeys' + # @type var query_params: Hash[String, untyped] + query_params = {} + # @type var header_params: Hash[String, String] + header_params = {} + request_body = body + + invoke_api_for_result( + :POST, path, query_params, header_params, request_body, + ['application/json'], + 'application/json', + 'WebKeyServiceListWebKeysResponse', + nil + ) + end end end end diff --git a/lib/zitadel/client/api_client.rb b/lib/zitadel/client/api_client.rb index 43715e4e..cd671b81 100644 --- a/lib/zitadel/client/api_client.rb +++ b/lib/zitadel/client/api_client.rb @@ -1,381 +1,25 @@ # frozen_string_literal: true -# rubocop:disable Style/ClassVars -# rubocop:disable Metrics/AbcSize -# rubocop:disable Metrics/CyclomaticComplexity -# rubocop:disable Metrics/MethodLength -# rubocop:disable Metrics/PerceivedComplexity -# rubocop:disable Metrics/ClassLength - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'time' -require 'typhoeus' -require 'uri' - -module Zitadel - module Client - # ApiClient handles all HTTP interactions with the Zitadel API. - # - # It is responsible for: - # - Constructing and signing requests via the configured authenticator - # - Executing HTTP calls and handling errors (timeouts, non-2xx responses) - # - Streaming file downloads into temporary files - # - Deserializing JSON responses into Ruby types and model objects - # - # === Usage Example: - # config = Zitadel::Client::Configuration.new do |c| - # c.authenticator = Zitadel::Client::ClientCredentialsAuthenticator.builder(base_url, id, secret).build - # end - # client = Zitadel::Client::ApiClient.new(config) - # data, status, headers = client.call_api(:get, '/users', query_params: { limit: 10 }) - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash[String, String]] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to the - # default configuration. - def initialize(config = Configuration.new) - @config = config - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => config.user_agent - }.merge(config.default_headers || {}) - end - - # noinspection RubyClassVariableUsageInspection,RbsMissingTypeSignature - # @return [Zitadel::Client::ApiClient] - def self.default - @@default ||= ApiClient.new - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (which may be a Tempfile or nil), response status code and response headers. - # noinspection RbsMissingTypeSignature - def call_api(http_method, path, opts = {}) - request = build_request(http_method, path, opts) - tempfile = nil - (download_file(request) { tempfile = _1 }) if opts[:return_type] == 'File' - response = request.run - - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" if @config.debugging - - unless response.success? - if response.timed_out? - raise 'Connection timed out' - elsif response.return_code != :ok - raise "Network error (#{response.return_code}): #{response.return_message}" - else - raise ApiError.new(response.code, response.headers, response.body) - end - end - - data = if opts[:return_type] == 'File' - tempfile - elsif opts[:return_type] - deserialize(response, opts[:return_type]) - end - [data, response.code, response.headers] - end - - def build_request(http_method, path, opts = {}) - url = URI.join("#{@config.authenticator.send(:host).chomp('/')}/", path).to_s - http_method = http_method.to_sym.downcase - - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - follow_location = opts[:follow_location] || true - header_params = @default_headers.merge(opts[:header_params] || {}).merge(@config.authenticator.send(:auth_headers)) - - req_opts = { - method: http_method, - headers: header_params, - params: query_params, - params_encoding: @config.params_encoding, - timeout: @config.timeout, - ssl_verifypeer: @config.verify_ssl, - ssl_verifyhost: (@config.verify_ssl_host ? 2 : 0), - sslcert: @config.cert_file, - sslkey: @config.key_file, - verbose: @config.debugging, - followlocation: follow_location - } - - # set custom cert, if provided - req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert - - # set proxy, if provided - req_opts[:proxy] = @config.proxy_url if @config.proxy_url - - if %i[post patch put delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update body: req_body - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" if @config.debugging - end - - Typhoeus::Request.new(url, req_opts) - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - # noinspection RubyMismatchedReturnType,RubyArgCount,RbsMissingTypeSignature - def build_request_body(header_params, form_params, body) - # http form - if %w[application/x-www-form-urlencoded multipart/form-data].include?(header_params['Content-Type']) - data = {} - form_params.each do |key, value| - data[key] = case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - value - else - value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - # - # @return [Tempfile] the tempfile generated - # noinspection RbsMissingTypeSignature - def download_file(request) - tempfile = nil - encoding = nil - - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix += '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - end - - request.on_body do |chunk| - chunk.force_encoding(encoding) if encoding - ensure_tempfile(tempfile).write(chunk) - end - - request.on_complete do - t = ensure_tempfile(tempfile) - t.close - # noinspection RubyNilAnalysis - @config.logger.info "Temp file written to #{t.path}, please copy the file to a proper folder " \ - "with e.g. `FileUtils.cp(t.path, '/new/file/path')` otherwise the temp file " \ - "will be deleted automatically with GC. It's also recommended to delete the temp file " \ - 'explicitly with `t.delete`' - yield t if block_given? - end - end - - def ensure_tempfile(temp) - temp || (raise 'Tempfile not created') - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - # noinspection RbsMissingTypeSignature - def json_mime?(mime) - (mime == '*/*') || !(mime =~ %r{^Application/.*json(?!p)(;.*)?}i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - # noinspection RbsMissingTypeSignature - def deserialize(response, return_type) - body = response.body - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body.to_s if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - raise "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", symbolize_names: true)[0] - rescue JSON::ParserError => e - raise e unless %w[String Date Time].include?(return_type) - - data = body - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - # noinspection RubyArgCount,RubyMismatchedArgumentType,RbsMissingTypeSignature - def convert_to_type(data, return_type) - return nil if data.nil? - - # noinspection RegExpRedundantEscape - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'Time' - # parse date time (expecting ISO 8601 format) - Time.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = ::Regexp.last_match(1) - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\z/ - # e.g. Hash - sub_type = ::Regexp.last_match(1) - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models (e.g. Pet) or oneOf - klass = Models.const_get(return_type) - klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - # noinspection RubyMismatchedReturnType,RbsMissingTypeSignature - def sanitize_filename(filename) - filename.split(%r{[/\\]}).last - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - # noinspection RubyArgCount,RbsMissingTypeSignature - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - - # use JSON when present, otherwise use all the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - # noinspection RubyArgCount,RbsMissingTypeSignature - def select_header_content_type(content_types) - # return nil by default - return if content_types.nil? || content_types.empty? - - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc.) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - # noinspection RubyMismatchedReturnType,RbsMissingTypeSignature - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - - local_body = if model.is_a?(Array) - model.map { |m| object_to_hash(m) } - else - object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - # noinspection RubyMismatchedReturnType,RbsMissingTypeSignature - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - # noinspection RbsMissingTypeSignature - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - raise "unknown collection format: #{collection_format.inspect}" - end - end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + # Abstract base class for HTTP clients. Subclasses must implement + # +send_request+ to perform the actual HTTP call. + # + # @param no_redirect [Boolean] when true, the implementation MUST NOT + # follow any 3xx redirect and MUST raise +ApiError+ if the server + # returns one. Used by the OAuth2 token endpoint POST so that + # credentials in the body are never silently replayed to a redirect + # target. Defaults to false. + class ApiClient + def send_request(method, url, headers, body, no_redirect: false) + raise NotImplementedError, "#{self.class}#send_request must be implemented" end end end - -# rubocop:enable Style/ClassVars -# rubocop:enable Metrics/AbcSize -# rubocop:enable Metrics/CyclomaticComplexity -# rubocop:enable Metrics/MethodLength -# rubocop:enable Metrics/PerceivedComplexity -# rubocop:enable Metrics/ClassLength diff --git a/lib/zitadel/client/api_error.rb b/lib/zitadel/client/api_error.rb index dc84f395..6b3f741b 100644 --- a/lib/zitadel/client/api_error.rb +++ b/lib/zitadel/client/api_error.rb @@ -1,31 +1,65 @@ # frozen_string_literal: true -module Zitadel - module Client - ## - # Represents an HTTP error returned from the Zitadel API. - # - # Exposes the HTTP status code, response headers, and response body. - class ApiError < ZitadelError - # @return [Integer] HTTP status code - attr_reader :code - - # @return [Hash{String=>Array}] HTTP response headers - attr_reader :response_headers - - # @return [String, Typhoeus::Response] HTTP response body - attr_reader :response_body - - ## - # @param code [Integer] HTTP status code - # @param response_headers [Hash{String=>Array}] HTTP response headers - # @param response_body [String, Typhoeus::Response] HTTP response body - def initialize(code, response_headers, response_body) - super("Error #{code}") - @code = code - @response_headers = response_headers - @response_body = response_body +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require_relative 'zitadel_error' + +module Zitadel::Client + # Represents an error returned by the API, including the HTTP status code, + # response headers, and response body. + class ApiError < ZitadelError + attr_reader :status_code, :response_headers, :response_body, :error_body + + # Usage examples: + # ApiError.new + # ApiError.new('message') + # ApiError.new(status_code: 500, response_headers: {}, response_body: '') + # ApiError.new(status_code: 404, message: 'Not Found') + def initialize(arg = nil) + if arg.is_a? Hash + if arg.key?(:message) || arg.key?('message') + super(arg[:message] || arg['message']) + else + super() + end + + arg.each do |k, v| + instance_variable_set :"@#{k}", v + end + else + super + @message = arg end end + + # Override to_s to display a friendly error message + def to_s + message + end + + # Deserialize the response body into a typed error object. + # + # @param klass [String] the target type name for deserialization + # @return [Object, nil] the deserialized error body, or nil if the body is empty + def typed_error_body(klass) + ObjectSerializer.deserialize(response_body, klass) + end + + # Build a human-readable error message from the stored attributes. + def message + msg = @message.nil? ? 'Error message: the server returns an error' : @message + + msg += "\nHTTP status code: #{status_code}" if status_code + msg += "\nResponse headers: #{response_headers}" if response_headers + msg += "\nResponse body: #{response_body}" if response_body + + msg + end end end diff --git a/lib/zitadel/client/api_response.rb b/lib/zitadel/client/api_response.rb new file mode 100644 index 00000000..5b2779ea --- /dev/null +++ b/lib/zitadel/client/api_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + # Wraps an HTTP response with status code, body, and headers. + class ApiHttpResponse + attr_reader :status_code, :body, :headers + + def initialize(status_code:, body:, headers:) + @status_code = status_code + @body = body + @headers = headers + end + end +end diff --git a/lib/zitadel/client/api_result.rb b/lib/zitadel/client/api_result.rb new file mode 100644 index 00000000..396316a1 --- /dev/null +++ b/lib/zitadel/client/api_result.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + # Represents a typed API response with deserialized data, status code, + # raw body, and headers. Returned by +with_http_info+ methods. + class ApiResult + # @return [Integer] + attr_reader :status_code + + # @return [Object, nil] + attr_reader :data + + # @return [String] + attr_reader :raw_body + + # @return [Hash{String => String}] + attr_reader :headers + + # @param status_code [Integer] + # @param data [Object, nil] + # @param raw_body [String] + # @param headers [Hash{String => String}] + def initialize(status_code:, data:, raw_body:, headers:) + @status_code = status_code + @data = data + @raw_body = raw_body + @headers = headers.freeze + end + end +end diff --git a/lib/zitadel/client/auth/authenticator.rb b/lib/zitadel/client/auth/authenticator.rb index 7135e43d..a2d42354 100644 --- a/lib/zitadel/client/auth/authenticator.rb +++ b/lib/zitadel/client/auth/authenticator.rb @@ -1,82 +1,40 @@ # frozen_string_literal: true -require 'time' - -module Zitadel - module Client - module Auth - ## - # Abstract base class for authenticators. - # - # This class defines the basic structure for any authenticator by requiring the implementation - # of a method to retrieve authentication headers, and provides a way to store and retrieve the host. - # - class Authenticator - protected - - attr_reader :host - - ## - # Initializes the Authenticator with the specified host. - # - # @param host [String] the base URL or endpoint for the service. - # - def initialize(host) - @host = host - end - - ## - # Retrieves the authentication headers to be sent with requests. - # - # Subclasses must override this method to return the appropriate headers. - # - # @raise [NotImplementedError] Always raised to require implementation in a subclass. - # - # @return [Hash{String => String}] - # - def auth_headers - # :nocov: - raise NotImplementedError, - "#{self.class}#get_auth_headers is an abstract method. Please override it in a subclass." - # :nocov: - end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Auth + # Base class for providing authentication credentials to the API client. + # Subclasses supply the API host URL and authorization headers. + class Authenticator + # Returns the base URL of the API. + # @return [String] + def host + raise NotImplementedError, "#{self.class}#host must be implemented" end - ## - # Abstract builder class for constructing OAuth authenticator instances. - # - # This builder provides common configuration options such as the OpenId instance and authentication scopes. - # - class OAuthAuthenticatorBuilder - protected - - attr_reader :open_id, :auth_scopes - - ## - # Initializes the OAuthAuthenticatorBuilder with a given host. - # - # @param host [String] the base URL for the OAuth provider. - # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # - def initialize(host, transport_options: nil) - transport_options ||= TransportOptions.defaults - @transport_options = transport_options - @open_id = OpenId.new(host, transport_options: transport_options) - @auth_scopes = Set.new(%w[openid urn:zitadel:iam:org:project:id:zitadel:aud]) - end + # Returns the authentication headers to include in every request. + # @return [Hash{String => String}] + def auth_headers + raise NotImplementedError, "#{self.class}#auth_headers must be implemented" + end - public + # Returns query parameters to include for authentication. + # @return [Hash{String => String}] + def query_params + {} + end - ## - # Sets the authentication scopes for the OAuth authenticator. - # - # @param scopes [Array] a variable number of scope strings. - # @return [self] the builder instance to allow for method chaining. - # - def scopes(*scopes) - @auth_scopes = Set.new(scopes) - self - end + # Returns cookie parameters to include for authentication. + # @return [Hash{String => String}] + def cookie_params + {} end end end diff --git a/lib/zitadel/client/auth/base_authenticator.rb b/lib/zitadel/client/auth/base_authenticator.rb new file mode 100644 index 00000000..63ff5cf1 --- /dev/null +++ b/lib/zitadel/client/auth/base_authenticator.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Auth + # Abstract base class providing default implementations for optional + # Authenticator methods. Concrete authenticators should extend this class. + class BaseAuthenticator < Authenticator + # Returns the base URL of the API. + # Subclasses must override this method. + # @return [String] + def host + raise NotImplementedError, "#{self.class}#host must be implemented" + end + + # Returns the authentication headers to include in every request. + # Subclasses must override this method. + # @return [Hash{String => String}] + def auth_headers + raise NotImplementedError, "#{self.class}#auth_headers must be implemented" + end + + # Returns query parameters to include for authentication. + # @return [Hash{String => String}] + def query_params + {} + end + + # Returns cookie parameters to include for authentication. + # @return [Hash{String => String}] + def cookie_params + {} + end + end + end +end diff --git a/lib/zitadel/client/auth/bearer_authenticator.rb b/lib/zitadel/client/auth/bearer_authenticator.rb new file mode 100644 index 00000000..73d477fd --- /dev/null +++ b/lib/zitadel/client/auth/bearer_authenticator.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Auth + # Authenticator for HTTP Bearer token authentication. + class BearerAuthenticator < BaseAuthenticator + attr_reader :host + + # @param host [String] API base URL + # @param token [String] Bearer token + def initialize(host, token) + super() + # Reject an empty/blank token: it would otherwise produce a literal + # "Authorization: Bearer " header that silently fails auth, mirroring + # the api-key authenticator's own empty-value guard. + if token.nil? || token.to_s.strip.empty? + raise ArgumentError, 'Bearer token must not be empty' + end + + # RFC 7230 §3.2.6 — field-value is HTAB / SP / VCHAR / obs-text. + # Reject anything outside printable ASCII + TAB so callers see a + # clear error rather than HTTP header injection from CR/LF or + # silently-mangled non-ASCII bytes. + if token.match?(/[^\t\x20-\x7E]/) + raise ArgumentError, + 'Bearer token must contain only printable ASCII characters (RFC 7230 §3.2.6)' + end + @host = host + @token = token + end + + # Redact the token from the default object representation so logging or + # inspecting an authenticator never leaks the credential. + def inspect + "#<#{self.class.name} host=#{@host.inspect} token=\"***\">" + end + alias to_s inspect + + # @return [Hash{String => String}] + def auth_headers + # Dedupe "Bearer " prefix (case-insensitive ASCII): tokens read + # from env files are commonly stored already-prefixed; emitting + # "Bearer Bearer xyz" would otherwise silently break auth. + value = @token + if value.length >= 7 && value[0, 7].downcase == 'bearer ' + value = value[7..] || '' + end + { 'Authorization' => "Bearer #{value}" } + end + end + end +end diff --git a/lib/zitadel/client/auth/client_credentials_authenticator.rb b/lib/zitadel/client/auth/client_credentials_authenticator.rb index 22d3b0e0..b547f3e7 100644 --- a/lib/zitadel/client/auth/client_credentials_authenticator.rb +++ b/lib/zitadel/client/auth/client_credentials_authenticator.rb @@ -3,26 +3,21 @@ module Zitadel module Client module Auth - # ClientCredentialsAuthenticator implements the client credentials flow. + # OAuth authenticator implementing the client-credentials flow (RFC 6749 §4.4). + # + # Mints a bearer token by POSTing client_id / client_secret to the + # provider's token endpoint through the SDK's shared transport. See + # {OAuthAuthenticator} for the caching and HTTP-injection contract. class ClientCredentialsAuthenticator < Auth::OAuthAuthenticator - # Constructs a ClientCredentialsAuthenticator using client credentials flow. - # - # @param open_id [OpenId] The OpenId instance with OAuth endpoint info. + GRANT_TYPE = 'client_credentials' + + # @param open_id [OpenId] Resolved OpenID configuration for the provider. # @param client_id [String] The OAuth client identifier. # @param client_secret [String] The OAuth client secret. # @param auth_scopes [Set] The scope(s) for the token request. - # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - def initialize(open_id, client_id, client_secret, auth_scopes, transport_options: nil) - transport_options ||= TransportOptions.defaults - - conn_opts = transport_options.to_connection_opts - - # noinspection RubyArgCount - super(open_id, auth_scopes, OAuth2::Client.new(client_id, client_secret, { - site: open_id.host_endpoint, - token_url: open_id.token_endpoint, - connection_opts: conn_opts - }), transport_options: transport_options) + def initialize(open_id, client_id, client_secret, auth_scopes) + super(open_id, client_id, auth_scopes.to_a.join(' ')) + @client_secret = client_secret end # Returns a new builder for constructing a ClientCredentialsAuthenticator. @@ -31,7 +26,7 @@ def initialize(open_id, client_id, client_secret, auth_scopes, transport_options # @param client_id [String] The OAuth client identifier. # @param client_secret [String] The OAuth client secret. # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # @return [ClientCredentialsAuthenticatorBuilder] A builder instance. + # @return [ClientCredentialsAuthenticatorBuilder] def self.builder(host, client_id, client_secret, transport_options: nil) ClientCredentialsAuthenticatorBuilder.new(host, client_id, client_secret, transport_options: transport_options) @@ -39,34 +34,35 @@ def self.builder(host, client_id, client_secret, transport_options: nil) protected - # Overrides the base get_grant to return client credentials grant parameters. + # @return [String] + def grant_type + GRANT_TYPE + end - # @return [OAuth2::AccessToken] A hash containing the grant type. - def get_grant(client, auth_scopes) - client.client_credentials.get_token({ scope: auth_scopes }) + # @return [Hash{String => String}] + def access_token_options + { + 'client_id' => @client_id, + 'client_secret' => @client_secret, + 'scope' => @scope + } end - # Builder class for ClientCredentialsAuthenticator. + # Builder for {ClientCredentialsAuthenticator}. class ClientCredentialsAuthenticatorBuilder < OAuthAuthenticatorBuilder - # Initializes the builder with host, client ID, and client secret. - # # @param host [String] The OAuth provider's base URL. # @param client_id [String] The OAuth client identifier. # @param client_secret [String] The OAuth client secret. # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. def initialize(host, client_id, client_secret, transport_options: nil) - # noinspection RubyArgCount super(host, transport_options: transport_options) @client_id = client_id @client_secret = client_secret end - # Constructs and returns a ClientCredentialsAuthenticator using the configured parameters. - # - # @return [ClientCredentialsAuthenticator] A configured instance. + # @return [ClientCredentialsAuthenticator] def build - ClientCredentialsAuthenticator.new(open_id, @client_id, @client_secret, auth_scopes, - transport_options: @transport_options) + ClientCredentialsAuthenticator.new(open_id, @client_id, @client_secret, auth_scopes) end end end diff --git a/lib/zitadel/client/auth/http_aware_authenticator.rb b/lib/zitadel/client/auth/http_aware_authenticator.rb new file mode 100644 index 00000000..57955c93 --- /dev/null +++ b/lib/zitadel/client/auth/http_aware_authenticator.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Auth + # Extension of {Authenticator} for authentication schemes that require + # making HTTP requests (e.g. OAuth2 token exchange, OpenID Connect discovery). + # + # Implementations receive a shared {ApiClient} instance so that + # authentication-related HTTP calls (token endpoints, discovery documents) + # use the same transport configuration (proxy, TLS, timeouts) as regular + # API calls. + # + # The {ApiClient} is injected by the Zitadel class after construction, + # via {#api_client=}. Implementations must not make HTTP calls before + # the client is injected. + # + # Only OAuth2 and OpenID Connect authenticators include this module. + # Simple authenticators (Basic, Bearer, API Key) do not need HTTP access + # and inherit from {Authenticator} directly. + module HttpAwareAuthenticator + # Inject the shared API client for making HTTP requests. + # + # Called by the Zitadel constructor after the {ApiClient} has been + # created with the user's {TransportOptions}. Implementations should + # store this reference and use it for all outbound HTTP calls + # (token exchange, discovery, etc.). + # + # @param client [ApiClient] the shared API client instance + # @return [void] + def api_client=(client) + raise NotImplementedError, "#{self.class}#api_client= must be implemented" + end + end + end +end diff --git a/lib/zitadel/client/auth/no_auth_authenticator.rb b/lib/zitadel/client/auth/no_auth_authenticator.rb index 07a1ba8a..65ef704d 100644 --- a/lib/zitadel/client/auth/no_auth_authenticator.rb +++ b/lib/zitadel/client/auth/no_auth_authenticator.rb @@ -3,29 +3,22 @@ module Zitadel module Client module Auth - ## - # A simple authenticator that performs no authentication. + # A no-op authenticator that performs no authentication. # - # This authenticator is useful for cases where no token or credentials are required. - # It simply returns an empty dictionary for authentication headers. - # - class NoAuthAuthenticator < Authenticator - ## - # Initializes the NoAuthAuthenticator with a default host. - # + # Useful for testing and unauthenticated endpoints: it has no + # host-dependent state and never mints a token, so it returns an empty set + # of auth headers. + class NoAuthAuthenticator < BaseAuthenticator + # @return [String] + attr_reader :host + # @param host [String] the base URL for the service. Defaults to "http://localhost". - # def initialize(host = 'http://localhost') - super + super() + @host = host end - protected - - ## - # Returns an empty dictionary since no authentication is performed. - # # @return [Hash{String => String}] an empty hash. - # def auth_headers {} end diff --git a/lib/zitadel/client/auth/o_auth_authenticator.rb b/lib/zitadel/client/auth/o_auth_authenticator.rb index 093c317f..2673856f 100644 --- a/lib/zitadel/client/auth/o_auth_authenticator.rb +++ b/lib/zitadel/client/auth/o_auth_authenticator.rb @@ -1,99 +1,243 @@ # frozen_string_literal: true -require 'time' -require 'oauth2' - -OAuth2.configure do |config| - # noinspection RubyResolve - config.silence_extra_tokens_warning = true -end +require 'json' +require 'uri' module Zitadel module Client module Auth - ## - # Base class for OAuth-based authentication using an OAuth2 client. + # Abstract base class for OAuth-based, token-minting authenticators. # - # Attributes: - # open_id: An object providing OAuth endpoint information. - # auth_session: An OAuth2Session instance used for fetching tokens. + # Mints a bearer token by POSTing an OAuth2 grant (client-credentials or a + # signed JWT-bearer assertion) to the provider's token endpoint, then + # attaches the resulting access token on every API request. The minted + # token is cached together with its expiry and only re-minted once it is + # within the refresh skew of expiring. # - class OAuthAuthenticator < Authenticator - protected + # Token-minting requires an outbound HTTP call, so this class includes + # {HttpAwareAuthenticator}: the shared {ApiClient} is injected by the + # {Client} constructor and the token POST is sent through it. Sharing the + # SDK transport means token exchange honours the same proxy, TLS, timeout + # and redirect configuration as regular API calls. + # + # Subclasses contribute the +grant_type+ and the grant-specific token + # request parameters (scope, client_secret, assertion, ...). + class OAuthAuthenticator < BaseAuthenticator + include HttpAwareAuthenticator - ## - # Constructs an OAuthAuthenticator. - # - # @param open_id [OpenId] An object that must implement `get_host_endpoint` and `get_token_endpoint`. - # @param auth_scopes [Set] The scope(s) for the token request. - # @param auth_session [OAuth2::Client] The OAuth2 client instance used for token requests. - # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # - def initialize(open_id, auth_scopes, auth_session, transport_options: nil) - super(open_id.host_endpoint) + # Seconds before expiry at which a cached token is treated as stale and + # re-minted. + REFRESH_SKEW_SECONDS = 300 + + # @param open_id [OpenId] Resolved OpenID configuration (host + token endpoint). + # @param client_id [String] The OAuth2 client identifier. + # @param scope [String] Space-delimited scope string for the token request. + def initialize(open_id, client_id, scope) + super() @open_id = open_id - @transport_options = transport_options || TransportOptions.defaults - @token = nil - @auth_session = auth_session - @auth_scopes = auth_scopes.to_a.join(' ') + @client_id = client_id + @scope = scope + @api_client = nil + @access_token = nil + @expires_at = 0.0 @mutex = Thread::Mutex.new end - ## - # Returns the current access token, refreshing it if necessary. - # - # @return [String] The current access token. + # Inject the shared API client used for the token exchange. + # @!attribute [w] api_client + # @param client [ApiClient] + # @return [void] + attr_writer :api_client + + # @return [String] + def host + @open_id.host_endpoint + end + + # @return [Hash{String => String}] + def auth_headers + { 'Authorization' => "Bearer #{auth_token}" } + end + + # Return a valid access token, minting (or re-minting) one if the cache + # is empty or within the refresh skew of expiring. # + # @return [String] + # @raise [ApiError] if the token cannot be obtained. def auth_token @mutex.synchronize do - refresh_token if @token.nil? || @token.expired? + if @access_token.nil? || + (@expires_at != 0 && Time.now.to_f >= (@expires_at - REFRESH_SKEW_SECONDS)) + refresh_token + end - raise 'Token is nil after refresh' if @token.nil? + raise ApiError.new(message: 'Token is nil even after attempting to refresh.') if @access_token.nil? - return @token.token + @access_token end end - ## - # Retrieves authentication headers. + # Mask the cached token so it never leaks through inspect / logging. + def inspect + masked = @access_token.nil? ? nil : '***' + "#<#{self.class.name} host=#{host.inspect} client_id=#{@client_id.inspect} " \ + "scope=#{@scope.inspect} access_token=#{masked.inspect} expires_at=#{@expires_at.inspect}>" + end + alias to_s inspect + + protected + + # The OAuth2 grant_type value sent in the token request. + # @return [String] + def grant_type + raise NotImplementedError, "#{self.class}#grant_type must be implemented" + end + + # Grant-specific token-request parameters (e.g. scope, assertion). + # @return [Hash{String => String}] + def access_token_options + raise NotImplementedError, "#{self.class}#access_token_options must be implemented" + end + + private + + # Exchange the configured grant for a fresh access token and cache it. # - # @return [Hash{String => String}] A hash containing the 'Authorization' header. + # POSTs an +application/x-www-form-urlencoded+ body to the token endpoint + # through the injected {ApiClient}. Wraps any failure in a {ZitadelError} + # so callers see a single catchable error type. # - def auth_headers - { 'Authorization' => "Bearer #{auth_token}" } + # @return [String] the freshly minted access token. + # @raise [ZitadelError] if the client is not yet injected or the exchange fails. + def refresh_token + response = post_token_request + payload = parse_token_response(response) + + @access_token = payload['access_token'] + @expires_at = expires_at_from(payload['expires_in']) + @access_token + rescue ApiError, ZitadelError + raise + rescue StandardError => e + raise ZitadelError.new("Failed to refresh token: #{e.message}"), cause: e end - ## - # Builds and returns a hash of grant parameters required for the token request. + # POST the configured grant to the token endpoint through the injected + # client and return the raw response. # - # The base class will invoke this method by passing its OAuth2 client. - # The subclass implementation should return the result of either: - # client.client_credentials.get_token(scope: scopes) - # or - # client.assertion.get_token(claims) + # @return [ApiResponse] + # @raise [ZitadelError] if no ApiClient has been injected. + def post_token_request + require_api_client! + params = { 'grant_type' => grant_type }.merge(access_token_options) + @api_client.send_request( + 'POST', + @open_id.token_endpoint, + { 'Content-Type' => 'application/x-www-form-urlencoded', 'Accept' => 'application/json' }, + URI.encode_www_form(params), + # Never replay a token POST across a redirect — a malicious 307/308 + # could otherwise leak the assertion/secret. + no_redirect: true + ) + end + + # @raise [ZitadelError] unless the shared ApiClient has been injected. + def require_api_client! + return unless @api_client.nil? + + raise ZitadelError, + 'OAuthAuthenticator has no ApiClient; it must be used via ' \ + 'Zitadel::Client::Client, which injects the shared transport before any token exchange.' + end + + # Validate the token-endpoint response and return the decoded payload. # - # @param auth_client [OAuth2::Client] The OAuth2 client instance. - # @param [String] auth_scopes - # @return [OAuth2::AccessToken] A hash of parameters used to fetch a token. + # @param response [ApiResponse] + # @return [Hash] the parsed JSON payload containing the access token. + # @raise [ApiError] on a non-2xx status, invalid JSON, or a missing access_token. + def parse_token_response(response) + if response.status_code < 200 || response.status_code >= 300 + raise token_error("token endpoint returned HTTP #{response.status_code}", response) + end + + payload = decode_token_payload(response) + unless payload.is_a?(Hash) && payload['access_token'].is_a?(String) + raise token_error('token endpoint response did not contain an access_token.', response) + end + + payload + end + + # Parse the response body as JSON, mapping a parse failure onto an {ApiError}. # - def get_grant(auth_client, auth_scopes) - # :nocov: - raise NotImplementedError, "#{self.class}#get_grant must be implemented" - # :nocov: + # @param response [ApiResponse] + # @return [Object] the decoded JSON document. + # @raise [ApiError] if the body is not valid JSON. + def decode_token_payload(response) + JSON.parse(response.body) + rescue JSON::ParserError => e + raise token_error('token endpoint response was not valid JSON.', response), cause: e end - ## - # Refreshes the access token using the OAuth flow. + # Build an {ApiError} describing a token-refresh failure. # - # It uses `get_grant` to obtain all necessary parameters for the token request. + # @param detail [String] human-readable failure detail. + # @param response [ApiResponse] the offending response. + # @return [ApiError] + def token_error(detail, response) + ApiError.new( + message: "Token refresh failed: #{detail}", + status_code: response.status_code, + response_headers: response.headers, + response_body: response.body + ) + end + + # Compute the absolute expiry timestamp from an +expires_in+ value, + # falling back to +0.0+ (never expires) when it is absent or invalid. # - # @return [OAuth2::AccessToken] A new Token instance. - # @raise [RuntimeError] if the token refresh fails. + # @param expires_in [Object] the token endpoint's expires_in field. + # @return [Float] + def expires_at_from(expires_in) + return 0.0 unless expires_in.is_a?(Numeric) && expires_in.positive? + + lifetime = Float(expires_in) # : Float + Time.now.to_f + lifetime + end + end + + # Abstract builder for constructing OAuth authenticator instances. + # + # Provides common configuration: the resolved {OpenId} instance (fetched + # eagerly via OpenID discovery using the supplied transport options) and + # the authentication scopes. + class OAuthAuthenticatorBuilder + DEFAULT_SCOPES = %w[openid urn:zitadel:iam:org:project:id:zitadel:aud].freeze + + # @return [OpenId] + attr_reader :open_id + + # @return [Set] + attr_reader :auth_scopes + + # @return [TransportOptions] + attr_reader :transport_options + + # @param host [String] The base URL for the OAuth provider. + # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. + def initialize(host, transport_options: nil) + @transport_options = transport_options || TransportOptions.builder.build + @open_id = OpenId.new(host, transport_options: @transport_options) + @auth_scopes = DEFAULT_SCOPES.to_set + end + + # Sets the authentication scopes for the OAuth authenticator. # - def refresh_token - @token = get_grant(@auth_session, @auth_scopes) - rescue StandardError => e - raise ZitadelError.new("Failed to refresh token: #{e.message}"), cause: e + # @param auth_scopes [Array] scope strings. + # @return [self] + def scopes(*auth_scopes) + @auth_scopes = auth_scopes.to_set + self end end end diff --git a/lib/zitadel/client/auth/open_id.rb b/lib/zitadel/client/auth/open_id.rb index b3000880..1fcc36dd 100644 --- a/lib/zitadel/client/auth/open_id.rb +++ b/lib/zitadel/client/auth/open_id.rb @@ -25,52 +25,84 @@ class OpenId # @raise [RuntimeError] if the OpenID configuration cannot be fetched or the token_endpoint is missing. # # noinspection HttpUrlsUsage - # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity def initialize(hostname, transport_options: nil) - transport_options ||= TransportOptions.defaults + transport_options ||= TransportOptions.builder.build hostname = "https://#{hostname}" unless hostname.start_with?('http://', 'https://') @host_endpoint = hostname - well_known_url = self.class.build_well_known_url(hostname) - uri = URI.parse(well_known_url) - http = if transport_options.proxy_url - proxy_uri = URI.parse(transport_options.proxy_url) - Net::HTTP.new(uri.host.to_s, uri.port, proxy_uri.host, proxy_uri.port, - proxy_uri.user, proxy_uri.password) - else - Net::HTTP.new(uri.host.to_s, uri.port) - end - http.use_ssl = (uri.scheme == 'https') - if transport_options.insecure - http.verify_mode = OpenSSL::SSL::VERIFY_NONE - elsif transport_options.ca_cert_path - store = OpenSSL::X509::Store.new - store.set_default_paths - store.add_file(transport_options.ca_cert_path) - http.cert_store = store - http.verify_mode = OpenSSL::SSL::VERIFY_PEER - end + uri = URI.parse(self.class.build_well_known_url(hostname)) + @token_endpoint = fetch_token_endpoint(uri, transport_options) + end + + ## + # Builds the well-known OpenID configuration URL for the given hostname. + # + # @param hostname [String] the hostname for the OpenID provider. + # @return [String] the well-known configuration URL. + # + def self.build_well_known_url(hostname) + URI.join(hostname, '/.well-known/openid-configuration').to_s + end + + private + + ## + # Fetches the discovery document and returns its +token_endpoint+. + # + # @param uri [URI::Generic] the well-known configuration URL. + # @param transport_options [TransportOptions] TLS, proxy and header config. + # @return [String] the discovered token endpoint. + # @raise [RuntimeError] if the fetch fails or no token_endpoint is present. + def fetch_token_endpoint(uri, transport_options) + http = build_http_client(uri, transport_options) request = Net::HTTP::Get.new(uri) transport_options.default_headers.each { |k, v| request[k] = v } response = http.request(request) raise "Failed to fetch OpenID configuration: HTTP #{response.code}" unless response.code.to_i == 200 - config = JSON.parse(response.body) - token_endpoint = config['token_endpoint'] + token_endpoint = JSON.parse(response.body)['token_endpoint'] raise 'token_endpoint not found in OpenID configuration' unless token_endpoint - @token_endpoint = token_endpoint + token_endpoint end - # rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity ## - # Builds the well-known OpenID configuration URL for the given hostname. - # - # @param hostname [String] the hostname for the OpenID provider. - # @return [String] the well-known configuration URL. + # Builds an +Net::HTTP+ client honouring the proxy and TLS settings. # - def self.build_well_known_url(hostname) - URI.join(hostname, '/.well-known/openid-configuration').to_s + # @param uri [URI::Generic] the target URL. + # @param transport_options [TransportOptions] TLS and proxy config. + # @return [Net::HTTP] the configured (not yet started) HTTP client. + # noinspection HttpUrlsUsage + def build_http_client(uri, transport_options) + http = new_http(uri, transport_options.proxy) + http.use_ssl = (uri.scheme == 'https') + configure_tls(http, transport_options) + http + end + + ## + # Instantiates +Net::HTTP+, routing through the proxy when configured. + def new_http(uri, proxy) + return Net::HTTP.new(uri.host.to_s, uri.port) unless proxy + + proxy_uri = URI.parse(proxy) + Net::HTTP.new(uri.host.to_s, uri.port, proxy_uri.host, proxy_uri.port, + proxy_uri.user, proxy_uri.password) + end + + ## + # Applies the TLS verification policy (disabled, or peer-verified + # against an optional custom CA bundle) to the HTTP client. + def configure_tls(http, transport_options) + if !transport_options.verify_ssl + http.verify_mode = OpenSSL::SSL::VERIFY_NONE + elsif transport_options.ca_cert_path + store = OpenSSL::X509::Store.new + store.set_default_paths + store.add_file(transport_options.ca_cert_path) + http.cert_store = store + http.verify_mode = OpenSSL::SSL::VERIFY_PEER + end end end end diff --git a/lib/zitadel/client/auth/personal_access_token_authenticator.rb b/lib/zitadel/client/auth/personal_access_token_authenticator.rb index 0afcb1a8..eac12b0d 100644 --- a/lib/zitadel/client/auth/personal_access_token_authenticator.rb +++ b/lib/zitadel/client/auth/personal_access_token_authenticator.rb @@ -3,34 +3,45 @@ module Zitadel module Client module Auth - ## # Personal Access Token Authenticator. # - # Uses a static personal access token for API authentication. - # - class PersonalAccessTokenAuthenticator < Authenticator - ## - # Initializes the PersonalAccessTokenAuthenticator with host and token. - # + # Uses a static personal access token (PAT) for API authentication. A PAT + # is a long-lived bearer credential minted out-of-band in the Zitadel + # console, so no token exchange is required: the token is attached verbatim + # on every request. This authenticator therefore extends + # {BaseAuthenticator} directly and does NOT need {HttpAwareAuthenticator}. + class PersonalAccessTokenAuthenticator < BaseAuthenticator + # @return [String] + attr_reader :host + # @param host [String] the base URL for the service. # @param token [String] the personal access token. - # def initialize(host, token) - # noinspection RubyArgCount - super(Utils::UrlUtil.build_hostname(host)) + super() + @host = self.class.build_hostname(host) @token = token end - protected - - ## - # Returns the authentication headers using the personal access token. - # - # @return [Hash{String => String}] a hash containing the 'Authorization' header. - # + # @return [Hash{String => String}] def auth_headers { 'Authorization' => "Bearer #{@token}" } end + + # Mask the token so it never leaks through inspect / logging. + def inspect + "#<#{self.class.name} host=#{@host.inspect} token=\"***\">" + end + alias to_s inspect + + # Normalises a host into an absolute base URL, defaulting to https. + # @param host [String] + # @return [String] + def self.build_hostname(host) + host = host.strip + # noinspection HttpUrlsUsage + host = "https://#{host}" unless host.start_with?('http://', 'https://') + host + end end end end diff --git a/lib/zitadel/client/auth/web_token_authenticator.rb b/lib/zitadel/client/auth/web_token_authenticator.rb index 8f5d5972..0e8fc40c 100644 --- a/lib/zitadel/client/auth/web_token_authenticator.rb +++ b/lib/zitadel/client/auth/web_token_authenticator.rb @@ -1,61 +1,51 @@ # frozen_string_literal: true -require 'time' +require 'json' +require 'jwt' require 'openssl' module Zitadel module Client module Auth - # ----------------------------------------------------------------------------- - # WebTokenAuthenticator - # ----------------------------------------------------------------------------- - - # OAuth authenticator implementing the JWT bearer flow. + # JWT-bearer authenticator using the JWT Bearer Grant (RFC 7523). # - # This implementation builds a JWT assertion dynamically in get_grant(). + # Signs a short-lived JWT assertion with the +jwt+ gem and exchanges it at + # the provider's token endpoint for an access token. The exchange is sent + # through the SDK's shared transport; see {OAuthAuthenticator} for the + # caching and HTTP-injection contract. class WebTokenAuthenticator < Auth::OAuthAuthenticator - # Constructs a WebTokenAuthenticator. + GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:jwt-bearer' + + # The signing inputs for the JWT assertion, grouped into a single value + # so the authenticator and its builder pass them around as one object + # instead of a long positional parameter list. # - # @param open_id [OpenId] The OpenId instance with OAuth endpoint information. + # @!attribute [r] issuer + # @return [String] the JWT issuer (iss) claim. + # @!attribute [r] subject + # @return [String] the JWT subject (sub) claim. + # @!attribute [r] audience + # @return [String] the JWT audience (aud) claim. + # @!attribute [r] private_key + # @return [OpenSSL::PKey::RSA] the RSA key used to sign the assertion. + # @!attribute [r] lifetime + # @return [Integer] the assertion lifetime in seconds. + # @!attribute [r] algorithm + # @return [String] the JWT signing algorithm. + # @!attribute [r] key_id + # @return [String, nil] the optional key id (kid) header. + JwtAssertion = Data.define(:issuer, :subject, :audience, :private_key, :lifetime, :algorithm, :key_id) + + # @param open_id [OpenId] Resolved OpenID configuration for the provider. + # @param client_id [String] The OAuth2 client identifier. # @param auth_scopes [Set] The scope(s) for the token request. - # @param jwt_issuer [String] The JWT issuer. - # @param jwt_subject [String] The JWT subject. - # @param jwt_audience [String] The JWT audience. - # @param private_key [String] The private key used to sign the JWT. - # @param jwt_lifetime [Integer] Lifetime of the JWT in seconds (default 3600 seconds). - # @param jwt_algorithm [String] The JWT signing algorithm (default "RS256"). - # @param key_id [String, nil] Optional key identifier for the JWT header (default: nil). - # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # rubocop:disable Metrics/ParameterLists, Metrics/MethodLength - def initialize(open_id, auth_scopes, jwt_issuer, jwt_subject, jwt_audience, private_key, - jwt_lifetime: 3600, jwt_algorithm: 'RS256', key_id: nil, transport_options: nil) - transport_options ||= TransportOptions.defaults - - conn_opts = transport_options.to_connection_opts - - # noinspection RubyArgCount,RubyMismatchedArgumentType - super(open_id, auth_scopes, OAuth2::Client.new('zitadel', 'zitadel', { - site: open_id.host_endpoint, - token_url: open_id.token_endpoint, - connection_opts: conn_opts - }), transport_options: transport_options) - @jwt_issuer = jwt_issuer - @jwt_subject = jwt_subject - @jwt_audience = jwt_audience - @jwt_lifetime = jwt_lifetime - @jwt_algorithm = jwt_algorithm - @key_id = key_id - # noinspection RubyMismatchedVariableType - @private_key = if private_key.is_a?(String) - OpenSSL::PKey::RSA.new(private_key) - else - private_key - end + # @param assertion [JwtAssertion] The JWT signing inputs. + def initialize(open_id, client_id, auth_scopes, assertion) + super(open_id, client_id, auth_scopes.to_a.join(' ')) + @assertion = assertion end - # rubocop:enable Metrics/ParameterLists, Metrics/MethodLength - - # Creates a WebTokenAuthenticator instance from a JSON configuration file. + # Creates a WebTokenAuthenticator from a service-account JSON file. # # The JSON file must be formatted as follows: # @@ -69,113 +59,127 @@ def initialize(open_id, auth_scopes, jwt_issuer, jwt_subject, jwt_audience, priv # @param host [String] Base URL for the API endpoints. # @param json_path [String] File path to the JSON configuration file. # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # @return [WebTokenAuthenticator] A new instance of WebTokenAuthenticator. + # @return [WebTokenAuthenticator] # @raise [RuntimeError] If the file cannot be read, the JSON is invalid, or required keys are missing. - # rubocop:disable Metrics/MethodLength def self.from_json(host, json_path, transport_options: nil) - config = JSON.parse(File.read(json_path)) - rescue Errno::ENOENT => e - raise "Unable to read JSON file at #{json_path}: #{e.message}" - rescue JSON::ParserError => e - raise "Invalid JSON in file at #{json_path}: #{e.message}" - else + config = parse_json_file(json_path) raise "Expected a JSON object, got #{config.class}" unless config.is_a?(Hash) user_id, private_key, key_id = config.values_at('userId', 'key', 'keyId') raise "Missing required keys 'userId', 'keyId' or 'key'" unless user_id && key_id && private_key - WebTokenAuthenticator.builder(host, user_id, private_key, transport_options: transport_options) - .key_identifier(key_id).build + builder(host, user_id, private_key, transport_options: transport_options) + .key_identifier(key_id).build + end + + # Reads and parses the service-account JSON file. + # + # @param json_path [String] File path to the JSON configuration file. + # @return [Object] the parsed JSON document. + # @raise [RuntimeError] If the file cannot be read or the JSON is invalid. + def self.parse_json_file(json_path) + JSON.parse(File.read(json_path)) + rescue Errno::ENOENT => e + raise "Unable to read JSON file at #{json_path}: #{e.message}" + rescue JSON::ParserError => e + raise "Invalid JSON in file at #{json_path}: #{e.message}" end - # rubocop:enable Metrics/MethodLength # Returns a builder for constructing a WebTokenAuthenticator. # # @param host [String] The base URL for the OAuth provider. - # @param user_id [String] The user identifier (used as both the issuer and subject). + # @param user_id [String] The user identifier (used as both issuer and subject). # @param private_key [String] The private key used to sign the JWT. # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # @return [WebTokenAuthenticatorBuilder] A builder instance. + # @return [WebTokenAuthenticatorBuilder] def self.builder(host, user_id, private_key, transport_options: nil) - WebTokenAuthenticatorBuilder.new(host, user_id, user_id, host, private_key, - transport_options: transport_options) + WebTokenAuthenticatorBuilder.new(host, user_id, private_key, transport_options: transport_options) end protected - # Overrides the base get_grant to return client credentials grant parameters. - # - # @return [OAuth2::AccessToken] A hash containing the grant type. - # rubocop:disable Metrics/MethodLength - def get_grant(client, auth_scopes) - client.assertion.get_token( - { iss: @jwt_issuer, - sub: @jwt_subject, - aud: @jwt_audience, - iat: Time.now.utc.to_i, - exp: (Time.now.utc + @jwt_lifetime).to_i }, - { - algorithm: @jwt_algorithm, - key: @private_key, - kid: @key_id - }, - { - scope: auth_scopes - } - ) + # @return [String] + def grant_type + GRANT_TYPE end - # rubocop:enable Metrics/MethodLength - - # ----------------------------------------------------------------------------- - # WebTokenAuthenticatorBuilder - # ----------------------------------------------------------------------------- + # Builds the grant-specific parameters for the JWT-bearer flow, signing a + # fresh assertion with time-sensitive claims on each token request. + # + # @return [Hash{String => String}] + def access_token_options + { 'scope' => @scope, 'assertion' => encode_assertion(@assertion) } + rescue StandardError => e + raise ZitadelError, "Failed to generate JWT assertion: #{e.message}" + end - # Builder for WebTokenAuthenticator. + # Signs a JWT assertion with freshly stamped time claims. # - # Provides a fluent API for configuring and constructing a WebTokenAuthenticator instance. + # @param assertion [JwtAssertion] the signing inputs. + # @return [String] the signed compact JWT. + def encode_assertion(assertion) + now = Time.now.utc + claims = { + iss: assertion.issuer, sub: assertion.subject, aud: assertion.audience, + iat: now.to_i, exp: (now + assertion.lifetime).to_i + } + headers = assertion.key_id.nil? ? {} : { 'kid' => assertion.key_id } + JWT.encode(claims, assertion.private_key, assertion.algorithm, headers) + end + + # Builder for {WebTokenAuthenticator}. class WebTokenAuthenticatorBuilder < OAuthAuthenticatorBuilder - # Initializes the WebTokenAuthenticatorBuilder with required parameters. + # The issuer and subject claims both default to the user id; the + # audience defaults to the host. Callers configure a user id and a + # host, not three separate claim strings. # - # @param host [String] The base URL for API endpoints. - # @param jwt_issuer [String] The issuer claim for the JWT. - # @param jwt_subject [String] The subject claim for the JWT. - # @param jwt_audience [String] The audience claim for the JWT. + # @param host [String] The base URL for API endpoints (and audience claim). + # @param user_id [String] The user id used as both issuer and subject claim. # @param private_key [String] The PEM-formatted private key used for signing the JWT. # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # rubocop:disable Metrics/ParameterLists - def initialize(host, jwt_issuer, jwt_subject, jwt_audience, private_key, transport_options: nil) - # noinspection RubyArgCount + def initialize(host, user_id, private_key, transport_options: nil) super(host, transport_options: transport_options) - @jwt_issuer = jwt_issuer - @jwt_subject = jwt_subject - @jwt_audience = jwt_audience + @jwt_issuer = user_id + @jwt_subject = user_id + @jwt_audience = host @private_key = private_key @jwt_lifetime = 3600 + @jwt_algorithm = 'RS256' + @key_id = nil end - # rubocop:enable Metrics/ParameterLists # Sets the JWT token lifetime in seconds. - # - # @param seconds [Integer] Lifetime of the JWT in seconds. - # @return [WebTokenAuthenticatorBuilder] The builder instance. + # @param seconds [Integer] + # @return [self] def token_lifetime_seconds(seconds) @jwt_lifetime = seconds self end + # Sets the JWT signing algorithm. + # @param jwt_algorithm [String] + # @return [self] + def jwt_algorithm(jwt_algorithm) + @jwt_algorithm = jwt_algorithm + self + end + + # Sets the optional key id (kid) header. + # @param key_id [String, nil] + # @return [self] def key_identifier(key_id) @key_id = key_id self end - # Constructs and returns a new WebTokenAuthenticator instance using the configured parameters. - # - # @return [WebTokenAuthenticator] A configured instance. + # @return [WebTokenAuthenticator] def build - WebTokenAuthenticator.new(open_id, auth_scopes, @jwt_issuer, @jwt_subject, @jwt_audience, - @private_key, jwt_lifetime: @jwt_lifetime, key_id: @key_id, - transport_options: @transport_options) + key = @private_key.is_a?(String) ? OpenSSL::PKey::RSA.new(@private_key) : @private_key + assertion = JwtAssertion.new( + issuer: @jwt_issuer, subject: @jwt_subject, audience: @jwt_audience, + private_key: key, lifetime: @jwt_lifetime, algorithm: @jwt_algorithm, key_id: @key_id + ) + WebTokenAuthenticator.new(open_id, 'zitadel', auth_scopes, assertion) end end end diff --git a/lib/zitadel/client/auth/zitadel_access_token_authenticator.rb b/lib/zitadel/client/auth/zitadel_access_token_authenticator.rb new file mode 100644 index 00000000..9d57580e --- /dev/null +++ b/lib/zitadel/client/auth/zitadel_access_token_authenticator.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Auth + # Scheme-specific authenticator for the ZitadelAccessTokenAuthenticator security scheme. + class ZitadelAccessTokenAuthenticator < BearerAuthenticator + def initialize(host:, token:) + super( + host, + token + ) + end + end + end +end diff --git a/lib/zitadel/client/configuration.rb b/lib/zitadel/client/configuration.rb index 8fc93f94..f774a429 100644 --- a/lib/zitadel/client/configuration.rb +++ b/lib/zitadel/client/configuration.rb @@ -1,199 +1,115 @@ # frozen_string_literal: true -module Zitadel - module Client - ## - # Configuration class for the Zitadel::Client SDK. - # - # This class defines all client-level options including timeouts, - # logging, SSL behavior, and validation controls. It allows you - # to customize how API calls are made and handled internally. - # - # Example: - # - # config = Zitadel::Client::Configuration.new do |c| - # c.debugging = true - # c.timeout = 10 - # c.verify_ssl = true - # end - # - # noinspection RubyTooManyInstanceVariablesInspection - class Configuration - USER_AGENT = [ - "zitadel-client/#{VERSION}", - - [ - 'lang=ruby', - "lang_version=#{RUBY_VERSION}", - "os=#{RUBY_PLATFORM}", - "arch=#{RbConfig::CONFIG['host_cpu']}" - ].join('; ') - .prepend('(').concat(')') - ].join(' ') - - ## - # The authentication strategy used to authorize requests. - # - # This is typically an instance of a class implementing an interface - # like `#authenticate(request)`, such as `NoAuthAuthenticator` or - # a custom implementation. - # - # @return [Authenticator] the authenticator instance - attr_reader :authenticator - - ## - # Enables or disables debug logging. - # - # When enabled, HTTP request and response details are logged - # via the configured `logger` instance. - # - # @return [Boolean] - attr_accessor :debugging - - ## - # The logger used to output debugging information. - # - # Defaults to `Rails.logger` if Rails is defined; otherwise, - # logs to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - ## - # Directory path used to temporarily store files returned - # by API responses (e.g., when downloading files). - # - # @return [String] - attr_accessor :temp_folder_path - - ## - # Request timeout duration in seconds. - # - # If set to `0`, requests will never time out. - # - # @return [Integer] - attr_accessor :timeout - - ## - # Enables or disables client-side request validation. - # - # When disabled, validation of input parameters is skipped. - # Defaults to `true`. - # - # @return [Boolean] - attr_accessor :client_side_validation +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + # API-level configuration for generated client classes. + # + # Holds the base URL and default headers that are applied to every API + # request. Transport-level settings (TLS, proxy, timeouts) belong in + # {TransportOptions} and are configured on the {DefaultApiClient}. + # + # This class is immutable. Use {Configuration.builder} to create instances: + # + # config = ::Zitadel::Client::Configuration.builder + # .base_url('https://api.example.com') + # .default_header('Authorization', 'Bearer token') + # .build + class Configuration + # The base URL for all API requests. Defaults to the first server URL + # from the OpenAPI specification. + # @return [String] + attr_reader :base_url + + # Default headers included in every API request. These headers are + # merged after transport-level headers from {TransportOptions} but + # before operation-specific headers and authentication headers. + # @return [Hash{String => String}] + attr_reader :default_headers + + # @api private + def initialize(base_url:, default_headers:) + @base_url = base_url + @default_headers = default_headers.freeze + freeze + end - ## - # Controls whether SSL certificates are verified when - # making HTTPS requests. - # - # Set to `false` to bypass certificate verification. Defaults to `true`. - # **Note:** This should always be `true` in production. - # - # @return [Boolean] - attr_accessor :verify_ssl + # Create a new builder for constructing {Configuration} instances. + # @return [Builder] + def self.builder + Builder.new + end - ## - # Controls whether SSL hostnames are verified during - # HTTPS communication. - # - # Set to `false` to skip hostname verification. Defaults to `true`. - # **Note:** Disabling this weakens transport security. - # - # @return [Boolean] - attr_accessor :verify_ssl_host + class << self + attr_writer :default - ## - # Path to the certificate file used to verify the peer. - # - # This is used in place of system-level certificate stores. - # - # @return [String] - # - # @see https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145 - attr_accessor :ssl_ca_cert - - ## - # Path to the client certificate file for mutual TLS (mTLS). - # - # This is optional and only required when server expects - # client-side certificates. - # - # @return [String] - attr_accessor :cert_file + # Return the default configuration instance, creating it lazily if needed. + # @return [Configuration] + def default + @default ||= builder.build + end + end - ## - # Path to the private key file for the client certificate. - # - # Used with `cert_file` during mutual TLS authentication. - # - # @return [String] - attr_accessor :key_file + # Builder for creating immutable {Configuration} instances. + class Builder + def initialize + @base_url = 'https://zitadel.com' + @default_headers = {} #: Hash[String, String] + end - ## - # Custom encoding strategy for query parameters that are arrays. - # - # Set this if your server expects a specific collection format - # (e.g., `multi`, `csv`, etc.). Defaults to `nil`. - # - # @return [Symbol, nil] - # - # @see https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding + # Set the base URL for all API requests. + # @param val [String] the base URL + # @return [self] + def base_url(val) + @base_url = val + self + end - ## - # The User-Agent header to be sent with HTTP requests. - # - # Set this to identify your client or library when making requests. - # - # @return [String, nil] - attr_accessor :user_agent + # Add a single default header to include in every API request. + # @param name [String] header name + # @param value [String] header value + # @return [self] + def default_header(name, value) + @default_headers[name] = value + self + end - ## - # Additional headers to include in every HTTP request. - # - # These headers are merged with the default headers set by the API client. - # Defaults to an empty hash. - # - # @return [Hash{String => String}] - attr_accessor :default_headers + # Add multiple default headers to include in every API request. + # @param headers [Hash{String => String}] map of header names to values + # @return [self] + def default_headers(headers) + @default_headers.merge!(headers) + self + end - ## - # Proxy URL to use for HTTP requests. + # Set the base URL from a server configuration with optional variable overrides. # - # When set, all HTTP requests will be routed through the specified proxy. - # The URL should include the scheme, host, and port (e.g., "http://proxy:8080"). + # Resolves the server URL template with the given variable values (or + # defaults) and uses the result as the base URL for all API requests. + # Enum validation is performed by {ServerConfiguration#url}. # - # @return [String, nil] - attr_accessor :proxy_url - - # rubocop:disable Metrics/MethodLength - def initialize(authenticator = Auth::NoAuthAuthenticator.new) - @authenticator = authenticator - @client_side_validation = true - @verify_ssl = true - @verify_ssl_host = true - @cert_file = nil - @key_file = nil - @default_headers = {} - @proxy_url = nil - @timeout = 0 - @params_encoding = nil - @debugging = false - @logger = nil - @user_agent = USER_AGENT - - yield(self) if block_given? + # @param server_config [ServerConfiguration] the server configuration to use + # @param variables [Hash{String => String}] variable name to value overrides + # @return [self] + # @raise [ArgumentError] if an override value is not in the variable's enum + def server(server_config, variables = {}) + @base_url = server_config.url(variables) + self end - # rubocop:enable Metrics/MethodLength - - ## - # Allows modifying the current instance using a configuration block. - # - # @yieldparam [Configuration] self - def configure - yield(self) if block_given? + # Build and return an immutable {Configuration} instance. + # @return [Configuration] + def build + Configuration.new( + base_url: @base_url, + default_headers: @default_headers.dup + ) end end end diff --git a/lib/zitadel/client/default_api_client.rb b/lib/zitadel/client/default_api_client.rb new file mode 100644 index 00000000..587f89f9 --- /dev/null +++ b/lib/zitadel/client/default_api_client.rb @@ -0,0 +1,559 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'faraday' +require 'faraday/follow_redirects' +require 'json' +require 'securerandom' +require 'openssl' +require 'base64' +require 'stringio' +require 'zlib' +require 'uri' +begin + require 'brotli' +rescue LoadError + nil +end +begin + require 'zstd-ruby' +rescue LoadError + nil +end +begin + require 'mime/types' +rescue LoadError + nil +end + +module Zitadel::Client + # Default HTTP client implementation backed by Faraday. + # + # Applies transport-level settings from {TransportOptions}: TLS + # verification, custom CA certificates, proxy routing, timeouts, redirect + # handling, User-Agent injection, X-Request-ID injection, and + # transport-level default headers. + # + # Header merge order (lowest to highest priority): + # 1. {TransportOptions#default_headers} -- transport-level defaults + # 2. Caller-provided headers (from BaseApi -- includes config defaults, auth, operation headers) + # 3. {TransportOptions#user_agent} -- injected if not already set + # 4. {TransportOptions#inject_request_id} -- injected if not already set + class DefaultApiClient < ApiClient + # Bucket 3.1: extra header names stripped on cross-origin redirects in + # addition to the static +{Authorization, Cookie, Proxy-Authorization}+ + # set. Populated at codegen time from `securitySchemes` entries whose + # `type` is `apiKey` and `in` is `header`, so a malicious 302 cannot + # leak the API key to a different host. Entries are already lowercase + # so the cross-origin filter can compare case-insensitively. + EXTRA_SENSITIVE_HEADER_NAMES = %w[].freeze + + # Create a client with default transport settings. + # + # Equivalent to +DefaultApiClient.new(TransportOptions.builder.build)+. + # + # @overload initialize + # Creates a client with default transport settings. + # @overload initialize(transport_options) + # Creates a client configured from the given {TransportOptions}. + # @param transport_options [TransportOptions] transport configuration to apply + def initialize(transport_options = nil) + super() + @transport_options = transport_options || TransportOptions.builder.build + @closed = false + validate_ca_cert_path(@transport_options.ca_cert_path) + end + + # Send an HTTP request with transport-level settings applied. + # + # Merges headers according to the priority order documented on the class, + # then dispatches via Faraday. + # + # @param method [Symbol] HTTP method (:get, :post, :put, :delete, etc.) + # @param url [String] fully qualified URL + # @param headers [Hash{String => String}] caller-provided headers + # @param body [Object, nil] request body + # @param no_redirect [Boolean] when true, do not follow redirects; the + # first 3xx response is returned to the caller as-is. Used by the + # OAuth2 token-endpoint POST so credentials in the form body are + # never silently replayed to a redirect target — the token manager + # inspects and rejects the 3xx itself (Bucket 3.2). + # @return [ApiHttpResponse] the HTTP response + def send_request(method, url, headers, body, no_redirect: false) + # Bucket 3: using the client after #close has released its connection + # pool is a caller error. Surface it loudly as an ApiError instead of + # lazily rebuilding a connection (which would make close a silent + # no-op), matching the uniform closed-flag contract across SDKs. + raise ApiError, 'ApiClient has been closed and can no longer send requests' if @closed + + merged = @transport_options.default_headers.dup.merge(headers) + merged['User-Agent'] ||= @transport_options.user_agent if @transport_options.user_agent + merged['X-Request-ID'] ||= SecureRandom.uuid if @transport_options.inject_request_id + + if body.is_a?(Hash) + boundary = SecureRandom.uuid + merged['Content-Type'] = "multipart/form-data; boundary=#{boundary}" + serialized_body = build_multipart_body(body, boundary) + elsif body.nil? + merged.delete('Content-Type') + serialized_body = nil + # Some servers / WAFs treat POST/PUT/PATCH with no body and no + # Content-Length as malformed (411 Length Required) or behave + # inconsistently. Send an empty-string body on body-bearing + # verbs so Faraday/Net::HTTP emit an explicit + # `Content-Length: 0`, matching Kotlin's `ByteArray(0)` and the + # other 11 SDKs. + upper = method.to_s.upcase + if %w[POST PUT PATCH].include?(upper) + serialized_body = '' + merged['Content-Length'] ||= '0' + end + else + serialized_body = body + end + + merged['Accept-Encoding'] ||= self.class.supported_encodings + + begin + response = connection.run_request(method.downcase.to_sym, url, serialized_body, merged) + # Gap BH: Faraday's follow_redirects middleware re-sends Authorization / + # Cookie / Proxy-Authorization across cross-origin 3xx redirects by + # default, which leaks bearer tokens to attacker-controlled hosts via + # malicious 302. We disable the middleware in build_connection and + # follow Location: headers manually here, stripping the sensitive + # headers when the next URL's origin (scheme + host + port) differs + # from the original. + # Bucket 3.2: `no_redirect: true` (the OAuth2 token endpoint POST + # does this) means "do not follow redirects; return the 3xx as-is". + # The redirect loop is skipped and the first 3xx surfaces to the + # caller verbatim. The OAuth2 token manager inspects and rejects the + # 3xx itself, so a credential-bearing body is never silently + # replayed to a redirect target. + if @transport_options.follow_redirects && !no_redirect + max_redirects = @transport_options.max_redirects || 20 + original_url = url + hops = 0 + current_method = method + current_body = serialized_body + current_headers = merged.dup + while hops < max_redirects && redirect_status?(response.status) + location = response.headers['location'] + break if location.nil? || location.empty? + + next_url = resolve_url(url, location) + break if next_url.nil? + + next_uri = safe_parse_uri(next_url) + # Bucket 3: a Location header pointing at a non-http(s) scheme + # (file:, javascript:, data:, ...) is an SSRF / local-file + # exfiltration vector. Refuse loudly with an ApiError instead of + # silently returning the 3xx response, matching the other SDKs. + if next_uri.nil? || !%w[http https].include?(next_uri.scheme) + raise ApiError, "Refusing to follow redirect to non-http(s) URL: #{next_url}" + end + + cross_origin = !same_origin?(original_url, next_url) + + # Gap T3: pick follow-up method+body per RFC 7231 §6.4.4 / RFC 7538. + # 307 + 308: preserve original method and body. + # 303: force GET, drop the body (and Content-Type/Length). + # 301 + 302: historical browser behaviour — switch to GET for + # non-GET/HEAD requests, drop the body. + status_code = response.status.to_i + method_str = current_method.to_s.upcase + preserve_method = [307, 308].include?(status_code) || + %w[GET HEAD].include?(method_str) + if preserve_method && status_code != 303 + next_method = current_method + next_body = current_body + else + next_method = :get + next_body = nil + end + + # Bucket 3.3: an HTTPS -> HTTP redirect is a TLS downgrade. If + # the follow-up request still carries a body (the 307/308 + # path, or the GET/HEAD same-method path), replaying it over + # cleartext would leak sensitive form data the application + # sent under TLS. Refuse the downgrade only when there is + # actually a body to replay — 301/302/303 demotions to GET + # drop the body and are allowed. + if !next_body.nil? && https_to_http_downgrade?(url, next_url) + raise ApiError, "Refusing to replay body across HTTPS -> HTTP " \ + "redirect (TLS downgrade): #{next_url}" + end + + redirect_headers = current_headers.dup + if cross_origin + # Bucket 3.1: in addition to the static + # {authorization, cookie, proxy-authorization} set, strip + # any `apiKey, in=header` names harvested from the OpenAPI + # document at codegen time. Without this an `X-Api-Key` + # header would otherwise be silently replayed to an + # attacker-controlled host on a malicious 302. + redirect_headers.delete_if do |k, _v| + lower = k.to_s.downcase + %w[authorization cookie proxy-authorization].include?(lower) || + EXTRA_SENSITIVE_HEADER_NAMES.include?(lower) + end + end + if next_body.nil? + redirect_headers.delete_if do |k, _v| + %w[content-type content-length].include?(k.to_s.downcase) + end + end + url = next_url + current_method = next_method + current_body = next_body + current_headers = redirect_headers + response = connection.run_request(next_method.to_s.downcase.to_sym, next_url, next_body, redirect_headers) + hops += 1 + end + # Bucket 3: if we exhausted the redirect budget while the server is + # still returning a 3xx, the request never reached a final + # resource. Surface this loudly as an ApiError instead of silently + # returning the last redirect response as if it were the answer, + # matching the other SDKs. + if redirect_status?(response.status) + raise ApiError, "Exceeded maximum number of redirects (#{max_redirects})" + end + end + # Decompress inside the rescue so a malformed Content-Encoding body + # (a truncated/garbage gzip/deflate/br/zstd payload) surfaces as an + # SDK ApiError rather than leaking a raw Zlib::GzipFile::Error / + # Zlib::Error / decoder exception to the caller. + content_type = response.headers['content-type'].to_s + decoded_body = decompress_body(response.body, response.headers['content-encoding']) + rescue Faraday::ConnectionFailed, Faraday::TimeoutError, Faraday::SSLError => e + raise ApiError, e.message + rescue Zlib::Error => e + raise ApiError, "Failed to decompress response body: #{e.message}" + end + response_body = if text_content_type?(content_type) + decode_text_body(decoded_body.to_s, content_type) + else + Base64.strict_encode64(decoded_body.to_s) + end + + # Gap BE+BF: response header keys are normalised to lowercase so + # callers can look them up consistently regardless of the casing the + # server used (HTTP header names are case-insensitive per RFC 7230 + # section 3.2, and HTTP/2 mandates lowercase on the wire). Repeated + # header lines (for example multiple Link or Set-Cookie headers) are + # joined with ", " to preserve order per RFC 7230 section 3.2.2. + # Faraday already collapses repeated headers into either a comma- + # joined string or an array depending on the header; here we + # normalise both shapes. The joined form is not directly parseable + # for Set-Cookie; callers needing structured cookie access should + # use HTTP::Cookie.parse or read the raw Faraday::Utils::Headers. + normalized_headers = {} #: Hash[String, String] + response.headers.each do |name, value| + joined = value.is_a?(Array) ? value.join(', ') : value.to_s + normalized_headers[name.to_s.downcase] = joined + end + + ApiHttpResponse.new( + status_code: response.status, + body: response_body, + headers: normalized_headers + ) + end + + # Releases the Faraday connection and its underlying socket pool and + # marks the client closed. Subsequent calls to {#send_request} raise an + # {ApiError} rather than silently rebuilding a connection. It is safe to + # call this method repeatedly (idempotent). + def close + conn = @connection + @connection = nil + @closed = true + conn.close if conn.respond_to?(:close) + end + + # Returns the list of supported content encodings. + # @return [String] + def self.supported_encodings + encodings = 'gzip, deflate' + encodings += ', br' if defined?(Brotli) + encodings += ', zstd' if defined?(Zstd) + encodings + end + + private + + # Bucket T4: fail fast on a user-supplied CA cert that cannot be read or + # parsed rather than silently falling back to the system trust store. If + # the caller explicitly asked for SSL pinning we must not pretend it + # succeeded -- validate the PEM eagerly at construction. + def validate_ca_cert_path(ca_cert_path) + return if ca_cert_path.nil? + + begin + pem = File.read(ca_cert_path) + rescue SystemCallError => e + raise ApiError, %(failed to read CA certificate from "#{ca_cert_path}": #{e.message}) + end + + begin + OpenSSL::X509::Certificate.new(pem) + rescue OpenSSL::X509::CertificateError => e + raise ApiError, + %(failed to parse CA certificate from "#{ca_cert_path}": no PEM blocks found or unparseable: #{e.message}) + end + end + + def text_content_type?(content_type) + media_type = content_type.split(';').first.to_s.strip.downcase + return true if media_type.empty? + return true if media_type.start_with?('text/') + + %w[application/json application/xml application/javascript].include?(media_type) || + media_type.end_with?('+json') || + media_type.end_with?('+xml') + end + + # Decode a textual response body using the charset advertised in the + # +Content-Type+ header, falling back to UTF-8 when the charset is + # absent or unknown. + # + # @param body [String] raw response body bytes + # @param content_type [String] the response +Content-Type+ header value + # @return [String] the decoded body as a UTF-8 string + def decode_text_body(body, content_type) + encoding = detect_encoding(content_type) + bytes = body.dup.force_encoding(encoding) + bytes.encode(Encoding::UTF_8, invalid: :replace, undef: :replace) + rescue EncodingError + body.dup.force_encoding(Encoding::UTF_8) + end + + # Parse the +charset=...+ parameter from a Content-Type header value + # and resolve it to a Ruby +Encoding+ instance. Defaults to UTF-8 when + # no charset is provided or the charset is not recognised. + # + # @param content_type [String] the +Content-Type+ header value + # @return [Encoding] the resolved character encoding + def detect_encoding(content_type) + return Encoding::UTF_8 if content_type.nil? + + match = content_type.match(/charset\s*=\s*"?([^";\s]+)"?/i) + return Encoding::UTF_8 if match.nil? + + charset = match[1].to_s + return Encoding::UTF_8 if charset.empty? + + Encoding.find(charset) || Encoding::UTF_8 + rescue ArgumentError + Encoding::UTF_8 + end + + def decompress_body(body, encoding) + return body if body.nil? || body.empty? + + case encoding&.downcase + when 'gzip', 'x-gzip' + Zlib::GzipReader.new(StringIO.new(body)).read + when 'deflate' + Zlib::Inflate.inflate(body) + when 'br' + defined?(Brotli) ? Brotli.inflate(body) : body + when 'zstd' + defined?(Zstd) ? Zstd.decompress(body) : body + else + body + end + end + + # Returns the cached Faraday connection, building it on first use. + # The connection is built once per ApiClient instance to preserve the + # underlying socket pool / keepalive across requests; the build step is + # delegated to {#build_connection} so tests can stub it per-instance. + def connection + @connection ||= build_connection + end + + def build_connection + Faraday.new do |f| + f.proxy = @transport_options.proxy if @transport_options.proxy + f.ssl.verify = @transport_options.verify_ssl + f.ssl.ca_file = @transport_options.ca_cert_path if @transport_options.ca_cert_path + + if @transport_options.timeout + timeout_secs = @transport_options.timeout / 1000.0 + f.options.timeout = timeout_secs + f.options.open_timeout = timeout_secs + end + + # Gap BH: do not register the Faraday follow_redirects middleware + # here -- it carries Authorization across cross-origin 3xx, leaking + # bearer tokens. We follow redirects ourselves in send_request with + # a same-origin check. + end + end + + # Return true for HTTP 3xx redirect status codes that carry a Location header. + def redirect_status?(code) + [301, 302, 303, 307, 308].include?(code.to_i) + end + + # Resolve a (possibly relative) Location header value against the previous URL. + def resolve_url(base, location) + URI.join(base, location).to_s + rescue StandardError + nil + end + + # Safely parse a URL, returning nil on invalid input. + def safe_parse_uri(url) + URI.parse(url) + rescue StandardError + nil + end + + # Compare two URLs by scheme + host + effective port. Use to_s to coerce + # nil components to "" — keeps cyclomatic complexity below rubocop's + # default threshold (avoids relying on the global Metrics/CyclomaticComplexity + # disable, which has proven unreliable inside the CI rubocop docker image). + def same_origin?(url_a, url_b) + uri_a = safe_parse_uri(url_a) + uri_b = safe_parse_uri(url_b) + return false if uri_a.nil? || uri_b.nil? + return false unless uri_a.scheme.to_s.downcase == uri_b.scheme.to_s.downcase + return false unless uri_a.host.to_s.downcase == uri_b.host.to_s.downcase + + effective_port(uri_a) == effective_port(uri_b) + end + + # Return the URI's explicit port or the default port for its scheme. + def effective_port(uri) + uri.port || (uri.scheme == 'https' ? 443 : 80) + end + + # Bucket 3.3: returns true when +url_a+ is an https URL and +url_b+ is + # a plain http URL — i.e. a TLS downgrade. Used by the redirect loop + # to refuse replaying a non-nil request body across the downgrade. + def https_to_http_downgrade?(url_a, url_b) + uri_a = safe_parse_uri(url_a) + uri_b = safe_parse_uri(url_b) + return false if uri_a.nil? || uri_b.nil? + + uri_a.scheme.to_s.downcase == 'https' && uri_b.scheme.to_s.downcase == 'http' + end + + def build_multipart_body(form_parts, boundary) + # @type var parts: Array[String] + parts = [] + form_parts.each do |name, value| + if value.is_a?(Array) + value.each { |item| parts << multipart_part(name, item, boundary).b } + else + parts << multipart_part(name, value, boundary).b + end + end + parts.push("--#{boundary}--\r\n".b) + parts.join + end + + def multipart_part(name, value, boundary) + safe_name = sanitize_multipart_field_name(name) + if value.respond_to?(:read) + filename = if value.respond_to?(:path) && value.path + File.basename(value.path.to_s) + else + name.to_s + end + data = begin + value.read + ensure + value.close if value.respond_to?(:close) + end + disposition = build_content_disposition(safe_name, filename) + part_mime = sniff_part_mime(filename) + header = "--#{boundary}\r\n#{disposition}\r\n" \ + "Content-Type: #{part_mime}\r\n\r\n" + header.b + data.b + "\r\n".b + elsif value.respond_to?(:to_hash) + json_str = JSON.generate(value.to_hash) + "--#{boundary}\r\nContent-Disposition: form-data; name=\"#{safe_name}\"\r\n" \ + "Content-Type: application/json\r\n\r\n#{json_str}\r\n" + else + "--#{boundary}\r\nContent-Disposition: form-data; name=\"#{safe_name}\"\r\n\r\n#{value}\r\n" + end + end + + # Gap W2: validate and escape a multipart form field name before + # interpolating it into a Content-Disposition header. Rejects CR/LF/NUL + # (header-injection) and backslash-escapes embedded quotes and + # backslashes so a malicious field name cannot break out of the + # +name="..."+ parameter. + def sanitize_multipart_field_name(name) + str = name.to_s + if str.match?(/[\r\n\0]/) + raise ArgumentError, + "multipart field name must not contain CR, LF, or NUL bytes: #{str.inspect}" + end + str.gsub(/([\\"])/) { |c| "\\#{c}" } + end + + # Build a Content-Disposition header value for a multipart file part. + # + # Rejects filenames containing CR, LF, or NUL to prevent header injection, + # backslash-escapes embedded quotes and backslashes, and emits an + # RFC 5987 +filename*+ parameter alongside the ASCII +filename+ fallback + # when the filename contains non-ASCII bytes. + # + # @param name [String, Symbol] form field name + # @param filename [String] proposed filename + # @return [String] the Content-Disposition header value + # @raise [ArgumentError] if +filename+ contains CR, LF, or NUL + def build_content_disposition(name, filename) + fname = filename.to_s + if fname.match?(/[\r\n\0]/) + raise ArgumentError, + "multipart filename must not contain CR, LF, or NUL bytes: #{fname.inspect}" + end + + ascii_safe = fname.dup.force_encoding(Encoding::UTF_8) + escaped = fname.gsub(/([\\"])/) { |c| "\\#{c}" } + base = %(Content-Disposition: form-data; name="#{name}"; filename="#{escaped}") + if ascii_safe.valid_encoding? && !ascii_safe.ascii_only? + encoded = URI.encode_www_form_component(ascii_safe).gsub('+', '%20') + base + %(; filename*=UTF-8''#{encoded}) + else + base + end + end + + # Map a filename to a Content-Type by extension. + # + # Uses the +mime-types+ gem if available; otherwise falls back to a small + # built-in lookup table. Returns +application/octet-stream+ when no + # mapping is found. + # + # @param filename [String] the filename to inspect + # @return [String] the resolved MIME type + def sniff_part_mime(filename) + fname = filename.to_s + if defined?(MIME::Types) + types = MIME::Types.type_for(fname) + return types.first.to_s unless types.empty? + end + ext = File.extname(fname).downcase + case ext + when '.png' then 'image/png' + when '.jpg', '.jpeg' then 'image/jpeg' + when '.gif' then 'image/gif' + when '.pdf' then 'application/pdf' + when '.json' then 'application/json' + else 'application/octet-stream' + end + end + end +end diff --git a/lib/zitadel/client/errors/bad_request_error.rb b/lib/zitadel/client/errors/bad_request_error.rb new file mode 100644 index 00000000..b1b42748 --- /dev/null +++ b/lib/zitadel/client/errors/bad_request_error.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Errors + # Exception for HTTP 400 Bad Request. + class BadRequestError < ClientError + def initialize(message: nil, response_body: nil, response_headers: nil, error_body: nil) + super({ + status_code: 400, + message: message, + response_body: response_body, + response_headers: response_headers, + error_body: error_body + }) + end + end + end +end diff --git a/lib/zitadel/client/errors/client_error.rb b/lib/zitadel/client/errors/client_error.rb new file mode 100644 index 00000000..6e51ccd5 --- /dev/null +++ b/lib/zitadel/client/errors/client_error.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Errors + # Exception for HTTP 4xx client errors. + class ClientError < ::Zitadel::Client::ApiError + end + end +end diff --git a/lib/zitadel/client/errors/conflict_error.rb b/lib/zitadel/client/errors/conflict_error.rb new file mode 100644 index 00000000..e116fb76 --- /dev/null +++ b/lib/zitadel/client/errors/conflict_error.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Errors + # Exception for HTTP 409 Conflict. + class ConflictError < ClientError + def initialize(message: nil, response_body: nil, response_headers: nil, error_body: nil) + super({ + status_code: 409, + message: message, + response_body: response_body, + response_headers: response_headers, + error_body: error_body + }) + end + end + end +end diff --git a/lib/zitadel/client/errors/forbidden_error.rb b/lib/zitadel/client/errors/forbidden_error.rb new file mode 100644 index 00000000..62478603 --- /dev/null +++ b/lib/zitadel/client/errors/forbidden_error.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Errors + # Exception for HTTP 403 Forbidden. + class ForbiddenError < ClientError + def initialize(message: nil, response_body: nil, response_headers: nil, error_body: nil) + super({ + status_code: 403, + message: message, + response_body: response_body, + response_headers: response_headers, + error_body: error_body + }) + end + end + end +end diff --git a/lib/zitadel/client/errors/internal_server_error.rb b/lib/zitadel/client/errors/internal_server_error.rb new file mode 100644 index 00000000..8cbca946 --- /dev/null +++ b/lib/zitadel/client/errors/internal_server_error.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Errors + # Exception for HTTP 500 Internal Server Error. + class InternalServerError < ServerError + def initialize(message: nil, response_body: nil, response_headers: nil, error_body: nil) + super({ + status_code: 500, + message: message, + response_body: response_body, + response_headers: response_headers, + error_body: error_body + }) + end + end + end +end diff --git a/lib/zitadel/client/errors/not_found_error.rb b/lib/zitadel/client/errors/not_found_error.rb new file mode 100644 index 00000000..b25ae1e7 --- /dev/null +++ b/lib/zitadel/client/errors/not_found_error.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Errors + # Exception for HTTP 404 Not Found. + class NotFoundError < ClientError + def initialize(message: nil, response_body: nil, response_headers: nil, error_body: nil) + super({ + status_code: 404, + message: message, + response_body: response_body, + response_headers: response_headers, + error_body: error_body + }) + end + end + end +end diff --git a/lib/zitadel/client/errors/server_error.rb b/lib/zitadel/client/errors/server_error.rb new file mode 100644 index 00000000..7e862d44 --- /dev/null +++ b/lib/zitadel/client/errors/server_error.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Errors + # Exception for HTTP 5xx server errors. + class ServerError < ::Zitadel::Client::ApiError + end + end +end diff --git a/lib/zitadel/client/errors/unauthorized_error.rb b/lib/zitadel/client/errors/unauthorized_error.rb new file mode 100644 index 00000000..63e62fe4 --- /dev/null +++ b/lib/zitadel/client/errors/unauthorized_error.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Errors + # Exception for HTTP 401 Unauthorized. + class UnauthorizedError < ClientError + def initialize(message: nil, response_body: nil, response_headers: nil, error_body: nil) + super({ + status_code: 401, + message: message, + response_body: response_body, + response_headers: response_headers, + error_body: error_body + }) + end + end + end +end diff --git a/lib/zitadel/client/errors/unprocessable_entity_error.rb b/lib/zitadel/client/errors/unprocessable_entity_error.rb new file mode 100644 index 00000000..07d2b40f --- /dev/null +++ b/lib/zitadel/client/errors/unprocessable_entity_error.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + module Errors + # Exception for HTTP 422 Unprocessable Entity. + class UnprocessableEntityError < ClientError + def initialize(message: nil, response_body: nil, response_headers: nil, error_body: nil) + super({ + status_code: 422, + message: message, + response_body: response_body, + response_headers: response_headers, + error_body: error_body + }) + end + end + end +end diff --git a/lib/zitadel/client/header_selector.rb b/lib/zitadel/client/header_selector.rb new file mode 100644 index 00000000..772ac4d2 --- /dev/null +++ b/lib/zitadel/client/header_selector.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + # Selects Accept and Content-Type headers for API requests based on + # the MIME types declared in the OpenAPI specification. + # + # @api private + class HeaderSelector # :nodoc: + JSON_MIME_PATTERN = %r{^application/(json|[\w!\#$&.+\-^_]+\+json)\s*(;|$)}i + + # Select headers for an API request. + # + # @param accept [Array] array of acceptable MIME types for the response + # @param content_type [String] the Content-Type for the request body + # @param is_multipart [Boolean] whether this is a multipart request + # @return [Hash] map of header names to values + def select_headers(accept, content_type, is_multipart) + # @type var headers: Hash[String, String] + headers = {} + + accept_header = select_accept_header(accept) + headers['Accept'] = accept_header unless accept_header.nil? || accept_header.empty? + + unless is_multipart + content_type = 'application/json' if content_type.nil? || content_type.empty? + headers['Content-Type'] = content_type + end + + headers + end + + # Detects whether a string contains a valid JSON mime type. + # + # @param search_string [String] the MIME type string to check + # @return [Boolean] true if the string represents a JSON MIME type + def json_mime?(search_string) + return false if search_string.nil? + + JSON_MIME_PATTERN.match?(search_string) + end + + private + + # Return the header 'Accept' based on an array of Accept provided. + # + # Filters out nil and empty entries, then joins the remaining media + # types in their original declaration order with ", ". No quality + # weights are applied and no reordering is performed. + # + # @param accept [Array] Array of header + # @return [String, nil] Accept (e.g. "image/jpeg, image/png, application/json") + def select_accept_header(accept) + return nil if accept.nil? + + filtered_accept = accept.select { |s| !s.nil? && !s.empty? } + + return '' if filtered_accept.empty? + + filtered_accept.join(', ') + end + end +end diff --git a/lib/zitadel/client/models/.openapi b/lib/zitadel/client/models/.openapi deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/zitadel/client/models/action_service_activate_public_key_request.rb b/lib/zitadel/client/models/action_service_activate_public_key_request.rb index 28ae8679..6f82731f 100644 --- a/lib/zitadel/client/models/action_service_activate_public_key_request.rb +++ b/lib/zitadel/client/models/action_service_activate_public_key_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceActivatePublicKeyRequest - # TargetID is the unique identifier of the target to activate the public key for. - attr_accessor :target_id - - # KeyID is the unique identifier of the public key to activate. - attr_accessor :key_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_id' => :'targetId', - :'key_id' => :'keyId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_id' => :'String', - :'key_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceActivatePublicKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceActivatePublicKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_id') - self.target_id = attributes[:'target_id'] - end - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_id == o.target_id && - key_id == o.key_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_id, key_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceActivatePublicKeyRequest. + class ActionServiceActivatePublicKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_id: 'targetId', + key_id: 'keyId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_id: 'String', + key_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # TargetID is the unique identifier of the target to activate the public key for. + # @example null + attribute :target_id, Types::Any.optional.meta(omittable: true) + # KeyID is the unique identifier of the public key to activate. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_activate_public_key_response.rb b/lib/zitadel/client/models/action_service_activate_public_key_response.rb index 6b12034f..04d3b419 100644 --- a/lib/zitadel/client/models/action_service_activate_public_key_response.rb +++ b/lib/zitadel/client/models/action_service_activate_public_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceActivatePublicKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceActivatePublicKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceActivatePublicKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceActivatePublicKeyResponse. + class ActionServiceActivatePublicKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_add_public_key_request.rb b/lib/zitadel/client/models/action_service_add_public_key_request.rb index e43cc7b9..6e03de6a 100644 --- a/lib/zitadel/client/models/action_service_add_public_key_request.rb +++ b/lib/zitadel/client/models/action_service_add_public_key_request.rb @@ -1,236 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceAddPublicKeyRequest - # The unique identifier of the target to add the public key to. - attr_accessor :target_id - - # The public key in PEM format. It must be either an RSA or an EC public key. - attr_accessor :public_key - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_id' => :'targetId', - :'public_key' => :'publicKey', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_id' => :'String', - :'public_key' => :'String', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceAddPublicKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceAddPublicKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_id') - self.target_id = attributes[:'target_id'] - end - - if attributes.key?(:'public_key') - self.public_key = attributes[:'public_key'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_id == o.target_id && - public_key == o.public_key && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_id, public_key, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceAddPublicKeyRequest. + class ActionServiceAddPublicKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_id: 'targetId', + public_key: 'publicKey', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_id: 'String', + public_key: 'String', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + public_key: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the target to add the public key to. + # @example null + attribute :target_id, Types::Any.optional.meta(omittable: true) + # The public key in PEM format. It must be either an RSA or an EC public key. + # @example null + attribute :public_key, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_add_public_key_response.rb b/lib/zitadel/client/models/action_service_add_public_key_response.rb index e1f2c913..3adbb6dc 100644 --- a/lib/zitadel/client/models/action_service_add_public_key_response.rb +++ b/lib/zitadel/client/models/action_service_add_public_key_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceAddPublicKeyResponse - # The KeyID is the unique identifier of the newly added public key. The ID is also used a `kid` in the JWT header for payload encryption. This allows the target to identify the correct key to use for decryption. - attr_accessor :key_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_id' => :'keyId', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_id' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceAddPublicKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceAddPublicKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_id == o.key_id && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_id, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceAddPublicKeyResponse. + class ActionServiceAddPublicKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_id: 'keyId', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_id: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The KeyID is the unique identifier of the newly added public key. The ID is also used a `kid` in the JWT header for payload encryption. This allows the target to identify the correct key to use for decryption. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_any.rb b/lib/zitadel/client/models/action_service_any.rb index 6f5c02da..afaf17c4 100644 --- a/lib/zitadel/client/models/action_service_any.rb +++ b/lib/zitadel/client/models/action_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class ActionServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class ActionServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_condition.rb b/lib/zitadel/client/models/action_service_condition.rb index 0eed6f44..7ea450f6 100644 --- a/lib/zitadel/client/models/action_service_condition.rb +++ b/lib/zitadel/client/models/action_service_condition.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceCondition - attr_accessor :event - - attr_accessor :function - - attr_accessor :request - - attr_accessor :response - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'event' => :'event', - :'function' => :'function', - :'request' => :'request', - :'response' => :'response' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'event' => :'ActionServiceEventExecution', - :'function' => :'ActionServiceFunctionExecution', - :'request' => :'ActionServiceRequestExecution', - :'response' => :'ActionServiceResponseExecution' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceCondition` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceCondition`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'event') - self.event = attributes[:'event'] - end - - if attributes.key?(:'function') - self.function = attributes[:'function'] - end - - if attributes.key?(:'request') - self.request = attributes[:'request'] - end - - if attributes.key?(:'response') - self.response = attributes[:'response'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - event == o.event && - function == o.function && - request == o.request && - response == o.response - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [event, function, request, response].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceCondition. + class ActionServiceCondition < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + event: 'event', + function: 'function', + request: 'request', + response: 'response' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + event: 'ActionServiceEventExecution', + function: 'ActionServiceFunctionExecution', + request: 'ActionServiceRequestExecution', + response: 'ActionServiceResponseExecution' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :event, Types::Any.optional.meta(omittable: true) + # @example null + attribute :function, Types::Any.optional.meta(omittable: true) + # @example null + attribute :request, Types::Any.optional.meta(omittable: true) + # @example null + attribute :response, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_connect_error.rb b/lib/zitadel/client/models/action_service_connect_error.rb index 7fc864c3..45b71063 100644 --- a/lib/zitadel/client/models/action_service_connect_error.rb +++ b/lib/zitadel/client/models/action_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class ActionServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class ActionServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_create_target_request.rb b/lib/zitadel/client/models/action_service_create_target_request.rb index 0409a54b..2edff1ef 100644 --- a/lib/zitadel/client/models/action_service_create_target_request.rb +++ b/lib/zitadel/client/models/action_service_create_target_request.rb @@ -1,293 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceCreateTargetRequest - attr_accessor :name - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :timeout - - # The URL of the endpoint to call. - attr_accessor :endpoint - - attr_accessor :payload_type - - attr_accessor :rest_async - - attr_accessor :rest_call - - attr_accessor :rest_webhook - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'timeout' => :'timeout', - :'endpoint' => :'endpoint', - :'payload_type' => :'payloadType', - :'rest_async' => :'restAsync', - :'rest_call' => :'restCall', - :'rest_webhook' => :'restWebhook' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'timeout' => :'String', - :'endpoint' => :'String', - :'payload_type' => :'ActionServicePayloadType', - :'rest_async' => :'Object', - :'rest_call' => :'ActionServiceRESTCall', - :'rest_webhook' => :'ActionServiceRESTWebhook' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceCreateTargetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceCreateTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'endpoint') - self.endpoint = attributes[:'endpoint'] - end - - if attributes.key?(:'payload_type') - self.payload_type = attributes[:'payload_type'] - end - - if attributes.key?(:'rest_async') - self.rest_async = attributes[:'rest_async'] - end - - if attributes.key?(:'rest_call') - self.rest_call = attributes[:'rest_call'] - end - - if attributes.key?(:'rest_webhook') - self.rest_webhook = attributes[:'rest_webhook'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - timeout == o.timeout && - endpoint == o.endpoint && - payload_type == o.payload_type && - rest_async == o.rest_async && - rest_call == o.rest_call && - rest_webhook == o.rest_webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, timeout, endpoint, payload_type, rest_async, rest_call, rest_webhook].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceCreateTargetRequest. + class ActionServiceCreateTargetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + timeout: 'timeout', + endpoint: 'endpoint', + payload_type: 'payloadType', + rest_async: 'restAsync', + rest_call: 'restCall', + rest_webhook: 'restWebhook' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + timeout: 'ISO8601::Duration', + endpoint: 'String', + payload_type: 'ActionServicePayloadType', + rest_async: 'Object', + rest_call: 'ActionServiceRESTCall', + rest_webhook: 'ActionServiceRESTWebhook' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :timeout, Types::Any.optional.meta(omittable: true) + # The URL of the endpoint to call. + # @example null + attribute :endpoint, Types::Any.optional.meta(omittable: true) + # @example null + attribute :payload_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_async, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_call, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_webhook, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_create_target_response.rb b/lib/zitadel/client/models/action_service_create_target_response.rb index 8fd7c9b2..56a57cc1 100644 --- a/lib/zitadel/client/models/action_service_create_target_response.rb +++ b/lib/zitadel/client/models/action_service_create_target_response.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceCreateTargetResponse - # The unique identifier of the newly created target. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Key used to sign and check payload sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256. - attr_accessor :signing_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'signing_key' => :'signingKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'signing_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceCreateTargetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceCreateTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'signing_key') - self.signing_key = attributes[:'signing_key'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - signing_key == o.signing_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, signing_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceCreateTargetResponse. + class ActionServiceCreateTargetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + signing_key: 'signingKey' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + signing_key: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the newly created target. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # Key used to sign and check payload sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256. + # @example null + attribute :signing_key, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_deactivate_public_key_request.rb b/lib/zitadel/client/models/action_service_deactivate_public_key_request.rb index f6443bbf..bca0870a 100644 --- a/lib/zitadel/client/models/action_service_deactivate_public_key_request.rb +++ b/lib/zitadel/client/models/action_service_deactivate_public_key_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceDeactivatePublicKeyRequest - # TargetID is the unique identifier of the target to deactivate the public key for. - attr_accessor :target_id - - # KeyID is the unique identifier of the public key to deactivate. - attr_accessor :key_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_id' => :'targetId', - :'key_id' => :'keyId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_id' => :'String', - :'key_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceDeactivatePublicKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceDeactivatePublicKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_id') - self.target_id = attributes[:'target_id'] - end - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_id == o.target_id && - key_id == o.key_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_id, key_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceDeactivatePublicKeyRequest. + class ActionServiceDeactivatePublicKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_id: 'targetId', + key_id: 'keyId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_id: 'String', + key_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # TargetID is the unique identifier of the target to deactivate the public key for. + # @example null + attribute :target_id, Types::Any.optional.meta(omittable: true) + # KeyID is the unique identifier of the public key to deactivate. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_deactivate_public_key_response.rb b/lib/zitadel/client/models/action_service_deactivate_public_key_response.rb index 00fca7cd..41a34cdf 100644 --- a/lib/zitadel/client/models/action_service_deactivate_public_key_response.rb +++ b/lib/zitadel/client/models/action_service_deactivate_public_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceDeactivatePublicKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceDeactivatePublicKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceDeactivatePublicKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceDeactivatePublicKeyResponse. + class ActionServiceDeactivatePublicKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_delete_target_request.rb b/lib/zitadel/client/models/action_service_delete_target_request.rb index db545c49..7104aa9a 100644 --- a/lib/zitadel/client/models/action_service_delete_target_request.rb +++ b/lib/zitadel/client/models/action_service_delete_target_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceDeleteTargetRequest - # The unique identifier of the target to delete. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceDeleteTargetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceDeleteTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceDeleteTargetRequest. + class ActionServiceDeleteTargetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the target to delete. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_delete_target_response.rb b/lib/zitadel/client/models/action_service_delete_target_response.rb index 9ae89fe5..64762bd7 100644 --- a/lib/zitadel/client/models/action_service_delete_target_response.rb +++ b/lib/zitadel/client/models/action_service_delete_target_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceDeleteTargetResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceDeleteTargetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceDeleteTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceDeleteTargetResponse. + class ActionServiceDeleteTargetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_event_execution.rb b/lib/zitadel/client/models/action_service_event_execution.rb index 65d80b01..62c35c1c 100644 --- a/lib/zitadel/client/models/action_service_event_execution.rb +++ b/lib/zitadel/client/models/action_service_event_execution.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceEventExecution - # Define all events as condition. After any event is created, the execution is triggered. - attr_accessor :all - - # Define a specific event as condition. After this event is created, the execution is triggered. - attr_accessor :event - - # Define an event group as condition. After any event under this group is created, the execution is triggered. - attr_accessor :group - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'all' => :'all', - :'event' => :'event', - :'group' => :'group' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'all' => :'Boolean', - :'event' => :'String', - :'group' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceEventExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceEventExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'all') - self.all = attributes[:'all'] - end - - if attributes.key?(:'event') - self.event = attributes[:'event'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - all == o.all && - event == o.event && - group == o.group - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [all, event, group].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceEventExecution. + class ActionServiceEventExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + all: 'all', + event: 'event', + group: 'group' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + all: 'Boolean', + event: 'String', + group: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Define all events as condition. After any event is created, the execution is triggered. + # @example null + attribute :all, Types::Any.optional.meta(omittable: true) + # Define a specific event as condition. After this event is created, the execution is triggered. + # @example null + attribute :event, Types::Any.optional.meta(omittable: true) + # Define an event group as condition. After any event under this group is created, the execution is triggered. + # @example null + attribute :group, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_execution.rb b/lib/zitadel/client/models/action_service_execution.rb index 8eb5a90c..7ed1e3d5 100644 --- a/lib/zitadel/client/models/action_service_execution.rb +++ b/lib/zitadel/client/models/action_service_execution.rb @@ -1,247 +1,88 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceExecution - attr_accessor :condition - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Ordered list of targets called during the execution. The order of the targets in this list defines the order of execution. If one of the targets fails, depending on the target's type and settings, the execution might be interrupted and the following targets will not be called. - attr_accessor :targets - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'condition' => :'condition', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'targets' => :'targets' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'condition' => :'ActionServiceCondition', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'targets' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'targets') - if (value = attributes[:'targets']).is_a?(Array) - self.targets = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - condition == o.condition && - creation_date == o.creation_date && - change_date == o.change_date && - targets == o.targets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [condition, creation_date, change_date, targets].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceExecution. + class ActionServiceExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + condition: 'condition', + creation_date: 'creationDate', + change_date: 'changeDate', + targets: 'targets' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + condition: 'ActionServiceCondition', + creation_date: 'Time', + change_date: 'Time', + targets: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :condition, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # Ordered list of targets called during the execution. The order of the targets in this list defines the order of execution. If one of the targets fails, depending on the target's type and settings, the execution might be interrupted and the following targets will not be called. + # @example null + attribute :targets, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_execution_field_name.rb b/lib/zitadel/client/models/action_service_execution_field_name.rb index 30e696eb..69f0d179 100644 --- a/lib/zitadel/client/models/action_service_execution_field_name.rb +++ b/lib/zitadel/client/models/action_service_execution_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ActionServiceExecutionFieldName - EXECUTION_FIELD_NAME_UNSPECIFIED = "EXECUTION_FIELD_NAME_UNSPECIFIED".freeze - EXECUTION_FIELD_NAME_ID = "EXECUTION_FIELD_NAME_ID".freeze - EXECUTION_FIELD_NAME_CREATED_DATE = "EXECUTION_FIELD_NAME_CREATED_DATE".freeze - EXECUTION_FIELD_NAME_CHANGED_DATE = "EXECUTION_FIELD_NAME_CHANGED_DATE".freeze - - def self.all_vars - @all_vars ||= [EXECUTION_FIELD_NAME_UNSPECIFIED, EXECUTION_FIELD_NAME_ID, EXECUTION_FIELD_NAME_CREATED_DATE, EXECUTION_FIELD_NAME_CHANGED_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ActionServiceExecutionFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServiceExecutionFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ActionServiceExecutionFieldName. + class ActionServiceExecutionFieldName + EXECUTION_FIELD_NAME_UNSPECIFIED = 'EXECUTION_FIELD_NAME_UNSPECIFIED' + EXECUTION_FIELD_NAME_ID = 'EXECUTION_FIELD_NAME_ID' + EXECUTION_FIELD_NAME_CREATED_DATE = 'EXECUTION_FIELD_NAME_CREATED_DATE' + EXECUTION_FIELD_NAME_CHANGED_DATE = 'EXECUTION_FIELD_NAME_CHANGED_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [EXECUTION_FIELD_NAME_UNSPECIFIED, EXECUTION_FIELD_NAME_ID, EXECUTION_FIELD_NAME_CREATED_DATE, EXECUTION_FIELD_NAME_CHANGED_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ActionServiceExecutionFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/action_service_execution_search_filter.rb b/lib/zitadel/client/models/action_service_execution_search_filter.rb index 2b826ab5..3cfa3171 100644 --- a/lib/zitadel/client/models/action_service_execution_search_filter.rb +++ b/lib/zitadel/client/models/action_service_execution_search_filter.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceExecutionSearchFilter - attr_accessor :execution_type_filter - - attr_accessor :in_conditions_filter - - attr_accessor :target_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'execution_type_filter' => :'executionTypeFilter', - :'in_conditions_filter' => :'inConditionsFilter', - :'target_filter' => :'targetFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'execution_type_filter' => :'ActionServiceExecutionTypeFilter', - :'in_conditions_filter' => :'ActionServiceInConditionsFilter', - :'target_filter' => :'ActionServiceTargetFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceExecutionSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceExecutionSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'execution_type_filter') - self.execution_type_filter = attributes[:'execution_type_filter'] - end - - if attributes.key?(:'in_conditions_filter') - self.in_conditions_filter = attributes[:'in_conditions_filter'] - end - - if attributes.key?(:'target_filter') - self.target_filter = attributes[:'target_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - execution_type_filter == o.execution_type_filter && - in_conditions_filter == o.in_conditions_filter && - target_filter == o.target_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [execution_type_filter, in_conditions_filter, target_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceExecutionSearchFilter. + class ActionServiceExecutionSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + execution_type_filter: 'executionTypeFilter', + in_conditions_filter: 'inConditionsFilter', + target_filter: 'targetFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + execution_type_filter: 'ActionServiceExecutionTypeFilter', + in_conditions_filter: 'ActionServiceInConditionsFilter', + target_filter: 'ActionServiceTargetFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :execution_type_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_conditions_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :target_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_execution_type.rb b/lib/zitadel/client/models/action_service_execution_type.rb index 848a1cd1..c6cc7551 100644 --- a/lib/zitadel/client/models/action_service_execution_type.rb +++ b/lib/zitadel/client/models/action_service_execution_type.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class ActionServiceExecutionType - EXECUTION_TYPE_UNSPECIFIED = "EXECUTION_TYPE_UNSPECIFIED".freeze - EXECUTION_TYPE_REQUEST = "EXECUTION_TYPE_REQUEST".freeze - EXECUTION_TYPE_RESPONSE = "EXECUTION_TYPE_RESPONSE".freeze - EXECUTION_TYPE_EVENT = "EXECUTION_TYPE_EVENT".freeze - EXECUTION_TYPE_FUNCTION = "EXECUTION_TYPE_FUNCTION".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ActionServiceExecutionType. + class ActionServiceExecutionType + EXECUTION_TYPE_UNSPECIFIED = 'EXECUTION_TYPE_UNSPECIFIED' + EXECUTION_TYPE_REQUEST = 'EXECUTION_TYPE_REQUEST' + EXECUTION_TYPE_RESPONSE = 'EXECUTION_TYPE_RESPONSE' + EXECUTION_TYPE_EVENT = 'EXECUTION_TYPE_EVENT' + EXECUTION_TYPE_FUNCTION = 'EXECUTION_TYPE_FUNCTION' - def self.all_vars - @all_vars ||= [EXECUTION_TYPE_UNSPECIFIED, EXECUTION_TYPE_REQUEST, EXECUTION_TYPE_RESPONSE, EXECUTION_TYPE_EVENT, EXECUTION_TYPE_FUNCTION].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [EXECUTION_TYPE_UNSPECIFIED, EXECUTION_TYPE_REQUEST, EXECUTION_TYPE_RESPONSE, EXECUTION_TYPE_EVENT, EXECUTION_TYPE_FUNCTION].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ActionServiceExecutionType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServiceExecutionType" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ActionServiceExecutionType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/action_service_execution_type_filter.rb b/lib/zitadel/client/models/action_service_execution_type_filter.rb index 8ac13bc2..750cb402 100644 --- a/lib/zitadel/client/models/action_service_execution_type_filter.rb +++ b/lib/zitadel/client/models/action_service_execution_type_filter.rb @@ -1,237 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceExecutionTypeFilter - attr_accessor :execution_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'execution_type' => :'executionType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'execution_type' => :'ActionServiceExecutionType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceExecutionTypeFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceExecutionTypeFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'execution_type') - self.execution_type = attributes[:'execution_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - execution_type == o.execution_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [execution_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceExecutionTypeFilter. + class ActionServiceExecutionTypeFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + execution_type: 'executionType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + execution_type: 'ActionServiceExecutionType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :execution_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_function_execution.rb b/lib/zitadel/client/models/action_service_function_execution.rb index 3a72b054..1d662de5 100644 --- a/lib/zitadel/client/models/action_service_function_execution.rb +++ b/lib/zitadel/client/models/action_service_function_execution.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Executed on the specified function - class ActionServiceFunctionExecution - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceFunctionExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceFunctionExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Executed on the specified function + class ActionServiceFunctionExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_get_target_request.rb b/lib/zitadel/client/models/action_service_get_target_request.rb index 90e42120..0143e866 100644 --- a/lib/zitadel/client/models/action_service_get_target_request.rb +++ b/lib/zitadel/client/models/action_service_get_target_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceGetTargetRequest - # The unique identifier of the target to retrieve. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceGetTargetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceGetTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceGetTargetRequest. + class ActionServiceGetTargetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the target to retrieve. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_get_target_response.rb b/lib/zitadel/client/models/action_service_get_target_response.rb index f4b787c7..97f7927a 100644 --- a/lib/zitadel/client/models/action_service_get_target_response.rb +++ b/lib/zitadel/client/models/action_service_get_target_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceGetTargetResponse - attr_accessor :target - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target' => :'target' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target' => :'ActionServiceTarget' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceGetTargetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceGetTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target') - self.target = attributes[:'target'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target == o.target - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceGetTargetResponse. + class ActionServiceGetTargetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target: 'target' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target: 'ActionServiceTarget' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :target, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_in_conditions_filter.rb b/lib/zitadel/client/models/action_service_in_conditions_filter.rb index 0a452cab..ba55a915 100644 --- a/lib/zitadel/client/models/action_service_in_conditions_filter.rb +++ b/lib/zitadel/client/models/action_service_in_conditions_filter.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceInConditionsFilter - # Defines the conditions to query for. - attr_accessor :conditions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'conditions' => :'conditions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'conditions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceInConditionsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceInConditionsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'conditions') - if (value = attributes[:'conditions']).is_a?(Array) - self.conditions = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - conditions == o.conditions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [conditions].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceInConditionsFilter. + class ActionServiceInConditionsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + conditions: 'conditions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + conditions: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Defines the conditions to query for. + # @example null + attribute :conditions, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_in_i_ds_filter.rb b/lib/zitadel/client/models/action_service_in_i_ds_filter.rb deleted file mode 100644 index a72b736f..00000000 --- a/lib/zitadel/client/models/action_service_in_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ActionServiceInIDsFilter - # Defines the ids to query for. - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceInIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceInIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/action_service_in_ids_filter.rb b/lib/zitadel/client/models/action_service_in_ids_filter.rb new file mode 100644 index 00000000..48432608 --- /dev/null +++ b/lib/zitadel/client/models/action_service_in_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceInIDsFilter. + class ActionServiceInIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/action_service_in_target_i_ds_filter.rb b/lib/zitadel/client/models/action_service_in_target_i_ds_filter.rb deleted file mode 100644 index a9ed2f70..00000000 --- a/lib/zitadel/client/models/action_service_in_target_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ActionServiceInTargetIDsFilter - # Defines the ids to query for. - attr_accessor :target_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_ids' => :'targetIds' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceInTargetIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceInTargetIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_ids') - if (value = attributes[:'target_ids']).is_a?(Array) - self.target_ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_ids == o.target_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/action_service_in_target_ids_filter.rb b/lib/zitadel/client/models/action_service_in_target_ids_filter.rb new file mode 100644 index 00000000..fec8dd86 --- /dev/null +++ b/lib/zitadel/client/models/action_service_in_target_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceInTargetIDsFilter. + class ActionServiceInTargetIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_ids: 'targetIds' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :target_ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/action_service_list_execution_functions_response.rb b/lib/zitadel/client/models/action_service_list_execution_functions_response.rb index 1fb34073..9fc1aa16 100644 --- a/lib/zitadel/client/models/action_service_list_execution_functions_response.rb +++ b/lib/zitadel/client/models/action_service_list_execution_functions_response.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceListExecutionFunctionsResponse - # All available functions to use in conditions. - attr_accessor :functions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'functions' => :'functions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'functions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListExecutionFunctionsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListExecutionFunctionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'functions') - if (value = attributes[:'functions']).is_a?(Array) - self.functions = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - functions == o.functions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [functions].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceListExecutionFunctionsResponse. + class ActionServiceListExecutionFunctionsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + functions: 'functions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + functions: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # All available functions to use in conditions. + # @example null + attribute :functions, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_list_execution_methods_response.rb b/lib/zitadel/client/models/action_service_list_execution_methods_response.rb index 88ceafb7..2f213112 100644 --- a/lib/zitadel/client/models/action_service_list_execution_methods_response.rb +++ b/lib/zitadel/client/models/action_service_list_execution_methods_response.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceListExecutionMethodsResponse - # All available methods to use in conditions. - attr_accessor :methods - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'methods' => :'methods' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'methods' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListExecutionMethodsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListExecutionMethodsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'methods') - if (value = attributes[:'methods']).is_a?(Array) - self.methods = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - methods == o.methods - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [methods].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceListExecutionMethodsResponse. + class ActionServiceListExecutionMethodsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + methods: 'methods' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + methods: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # All available methods to use in conditions. + # @example null + attribute :methods, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_list_execution_services_response.rb b/lib/zitadel/client/models/action_service_list_execution_services_response.rb index 9c4ec7c6..5d035214 100644 --- a/lib/zitadel/client/models/action_service_list_execution_services_response.rb +++ b/lib/zitadel/client/models/action_service_list_execution_services_response.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceListExecutionServicesResponse - # All available services to use in conditions. - attr_accessor :services - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'services' => :'services' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'services' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListExecutionServicesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListExecutionServicesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'services') - if (value = attributes[:'services']).is_a?(Array) - self.services = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - services == o.services - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [services].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceListExecutionServicesResponse. + class ActionServiceListExecutionServicesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + services: 'services' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + services: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # All available services to use in conditions. + # @example null + attribute :services, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_list_executions_request.rb b/lib/zitadel/client/models/action_service_list_executions_request.rb index 1da37ef7..94b9672d 100644 --- a/lib/zitadel/client/models/action_service_list_executions_request.rb +++ b/lib/zitadel/client/models/action_service_list_executions_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceListExecutionsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ActionServicePaginationRequest', - :'sorting_column' => :'ActionServiceExecutionFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListExecutionsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListExecutionsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceListExecutionsRequest. + class ActionServiceListExecutionsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ActionServicePaginationRequest', + sorting_column: 'ActionServiceExecutionFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_list_executions_response.rb b/lib/zitadel/client/models/action_service_list_executions_response.rb index f6ef873f..d7ed4dc5 100644 --- a/lib/zitadel/client/models/action_service_list_executions_response.rb +++ b/lib/zitadel/client/models/action_service_list_executions_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceListExecutionsResponse - attr_accessor :pagination - - # List of all executions matching the query. - attr_accessor :executions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'executions' => :'executions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ActionServicePaginationResponse', - :'executions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListExecutionsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListExecutionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'executions') - if (value = attributes[:'executions']).is_a?(Array) - self.executions = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - executions == o.executions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, executions].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceListExecutionsResponse. + class ActionServiceListExecutionsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + executions: 'executions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ActionServicePaginationResponse', + executions: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # List of all executions matching the query. + # @example null + attribute :executions, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_list_public_keys_request.rb b/lib/zitadel/client/models/action_service_list_public_keys_request.rb index 4e6507cf..c72feec4 100644 --- a/lib/zitadel/client/models/action_service_list_public_keys_request.rb +++ b/lib/zitadel/client/models/action_service_list_public_keys_request.rb @@ -1,268 +1,87 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceListPublicKeysRequest - # TargetID is the unique identifier of the target to list the public keys for. - attr_accessor :target_id - - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_id' => :'targetId', - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_id' => :'String', - :'pagination' => :'ActionServicePaginationRequest', - :'sorting_column' => :'ActionServicePublicKeyFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListPublicKeysRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListPublicKeysRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_id') - self.target_id = attributes[:'target_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_id == o.target_id && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_id, pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceListPublicKeysRequest. + class ActionServiceListPublicKeysRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_id: 'targetId', + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_id: 'String', + pagination: 'ActionServicePaginationRequest', + sorting_column: 'ActionServicePublicKeyFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # TargetID is the unique identifier of the target to list the public keys for. + # @example null + attribute :target_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_list_public_keys_response.rb b/lib/zitadel/client/models/action_service_list_public_keys_response.rb index b70d6ac1..0dd4f047 100644 --- a/lib/zitadel/client/models/action_service_list_public_keys_response.rb +++ b/lib/zitadel/client/models/action_service_list_public_keys_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceListPublicKeysResponse - attr_accessor :pagination - - # List of all public keys for the target. - attr_accessor :public_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'public_keys' => :'publicKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ActionServicePaginationResponse', - :'public_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListPublicKeysResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListPublicKeysResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'public_keys') - if (value = attributes[:'public_keys']).is_a?(Array) - self.public_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - public_keys == o.public_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, public_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceListPublicKeysResponse. + class ActionServiceListPublicKeysResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + public_keys: 'publicKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ActionServicePaginationResponse', + public_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # List of all public keys for the target. + # @example null + attribute :public_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_list_targets_request.rb b/lib/zitadel/client/models/action_service_list_targets_request.rb index 1cc49194..d9651845 100644 --- a/lib/zitadel/client/models/action_service_list_targets_request.rb +++ b/lib/zitadel/client/models/action_service_list_targets_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceListTargetsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ActionServicePaginationRequest', - :'sorting_column' => :'ActionServiceTargetFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListTargetsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListTargetsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceListTargetsRequest. + class ActionServiceListTargetsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ActionServicePaginationRequest', + sorting_column: 'ActionServiceTargetFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_list_targets_response.rb b/lib/zitadel/client/models/action_service_list_targets_response.rb index cea50b3f..44a97750 100644 --- a/lib/zitadel/client/models/action_service_list_targets_response.rb +++ b/lib/zitadel/client/models/action_service_list_targets_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceListTargetsResponse - attr_accessor :pagination - - # List of all targets matching the query. - attr_accessor :targets - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'targets' => :'targets' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ActionServicePaginationResponse', - :'targets' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceListTargetsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceListTargetsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'targets') - if (value = attributes[:'targets']).is_a?(Array) - self.targets = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - targets == o.targets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, targets].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceListTargetsResponse. + class ActionServiceListTargetsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + targets: 'targets' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ActionServicePaginationResponse', + targets: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # List of all targets matching the query. + # @example null + attribute :targets, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_pagination_request.rb b/lib/zitadel/client/models/action_service_pagination_request.rb index ec7cb9b4..8692109d 100644 --- a/lib/zitadel/client/models/action_service_pagination_request.rb +++ b/lib/zitadel/client/models/action_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServicePaginationRequest. + class ActionServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_pagination_response.rb b/lib/zitadel/client/models/action_service_pagination_response.rb index 466d31e8..9249a42b 100644 --- a/lib/zitadel/client/models/action_service_pagination_response.rb +++ b/lib/zitadel/client/models/action_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServicePaginationResponse. + class ActionServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_payload_type.rb b/lib/zitadel/client/models/action_service_payload_type.rb index 829603ee..018e5149 100644 --- a/lib/zitadel/client/models/action_service_payload_type.rb +++ b/lib/zitadel/client/models/action_service_payload_type.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ActionServicePayloadType - PAYLOAD_TYPE_UNSPECIFIED = "PAYLOAD_TYPE_UNSPECIFIED".freeze - PAYLOAD_TYPE_JSON = "PAYLOAD_TYPE_JSON".freeze - PAYLOAD_TYPE_JWT = "PAYLOAD_TYPE_JWT".freeze - PAYLOAD_TYPE_JWE = "PAYLOAD_TYPE_JWE".freeze - - def self.all_vars - @all_vars ||= [PAYLOAD_TYPE_UNSPECIFIED, PAYLOAD_TYPE_JSON, PAYLOAD_TYPE_JWT, PAYLOAD_TYPE_JWE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ActionServicePayloadType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServicePayloadType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ActionServicePayloadType. + class ActionServicePayloadType + PAYLOAD_TYPE_UNSPECIFIED = 'PAYLOAD_TYPE_UNSPECIFIED' + PAYLOAD_TYPE_JSON = 'PAYLOAD_TYPE_JSON' + PAYLOAD_TYPE_JWT = 'PAYLOAD_TYPE_JWT' + PAYLOAD_TYPE_JWE = 'PAYLOAD_TYPE_JWE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PAYLOAD_TYPE_UNSPECIFIED, PAYLOAD_TYPE_JSON, PAYLOAD_TYPE_JWT, PAYLOAD_TYPE_JWE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ActionServicePayloadType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/action_service_public_key.rb b/lib/zitadel/client/models/action_service_public_key.rb index 43f10822..6c847189 100644 --- a/lib/zitadel/client/models/action_service_public_key.rb +++ b/lib/zitadel/client/models/action_service_public_key.rb @@ -1,276 +1,106 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServicePublicKey - # KeyID is the unique identifier of the public key. It's also used as the `kid` field in the JWE header when the payload type is set to `PAYLOAD_TYPE_JWE`. - attr_accessor :key_id - - # Active indicates whether the public key is active and used for payload encryption. Only one public key can be active at a time. - attr_accessor :active - - # The public key in PEM format. - attr_accessor :public_key - - # Fingerprint is the fingerprint of the public key. It's prefixed with the hashing algorithm used and base64 encoded without padding, e.g. `SHA256:STqK+Sd4qgdu+UjiwI8NBjOD6P7UqQ42EZYIdySEyTw`. The fingerprint can be used to easily compare the public key with other sources. - attr_accessor :fingerprint - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_id' => :'keyId', - :'active' => :'active', - :'public_key' => :'publicKey', - :'fingerprint' => :'fingerprint', - :'expiration_date' => :'expirationDate', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_id' => :'String', - :'active' => :'Boolean', - :'public_key' => :'String', - :'fingerprint' => :'String', - :'expiration_date' => :'Time', - :'creation_date' => :'Time', - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServicePublicKey` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServicePublicKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - - if attributes.key?(:'active') - self.active = attributes[:'active'] - end - - if attributes.key?(:'public_key') - self.public_key = attributes[:'public_key'] - end - - if attributes.key?(:'fingerprint') - self.fingerprint = attributes[:'fingerprint'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_id == o.key_id && - active == o.active && - public_key == o.public_key && - fingerprint == o.fingerprint && - expiration_date == o.expiration_date && - creation_date == o.creation_date && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_id, active, public_key, fingerprint, expiration_date, creation_date, change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServicePublicKey. + class ActionServicePublicKey < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_id: 'keyId', + active: 'active', + public_key: 'publicKey', + fingerprint: 'fingerprint', + expiration_date: 'expirationDate', + creation_date: 'creationDate', + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_id: 'String', + active: 'Boolean', + public_key: 'String', + fingerprint: 'String', + expiration_date: 'Time', + creation_date: 'Time', + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + public_key: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # KeyID is the unique identifier of the public key. It's also used as the `kid` field in the JWE header when the payload type is set to `PAYLOAD_TYPE_JWE`. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) + # Active indicates whether the public key is active and used for payload encryption. Only one public key can be active at a time. + # @example null + attribute :active, Types::Any.optional.meta(omittable: true) + # The public key in PEM format. + # @example null + attribute :public_key, Types::Any.optional.meta(omittable: true) + # Fingerprint is the fingerprint of the public key. It's prefixed with the hashing algorithm used and base64 encoded without padding, e.g. `SHA256:STqK+Sd4qgdu+UjiwI8NBjOD6P7UqQ42EZYIdySEyTw`. The fingerprint can be used to easily compare the public key with other sources. + # @example null + attribute :fingerprint, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_public_key_field_name.rb b/lib/zitadel/client/models/action_service_public_key_field_name.rb index e9ef8536..d807336f 100644 --- a/lib/zitadel/client/models/action_service_public_key_field_name.rb +++ b/lib/zitadel/client/models/action_service_public_key_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ActionServicePublicKeyFieldName - PUBLIC_KEY_FIELD_NAME_UNSPECIFIED = "PUBLIC_KEY_FIELD_NAME_UNSPECIFIED".freeze - PUBLIC_KEY_FIELD_NAME_CREATION_DATE = "PUBLIC_KEY_FIELD_NAME_CREATION_DATE".freeze - PUBLIC_KEY_FIELD_NAME_CHANGE_DATE = "PUBLIC_KEY_FIELD_NAME_CHANGE_DATE".freeze - PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE = "PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE".freeze - - def self.all_vars - @all_vars ||= [PUBLIC_KEY_FIELD_NAME_UNSPECIFIED, PUBLIC_KEY_FIELD_NAME_CREATION_DATE, PUBLIC_KEY_FIELD_NAME_CHANGE_DATE, PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ActionServicePublicKeyFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServicePublicKeyFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ActionServicePublicKeyFieldName. + class ActionServicePublicKeyFieldName + PUBLIC_KEY_FIELD_NAME_UNSPECIFIED = 'PUBLIC_KEY_FIELD_NAME_UNSPECIFIED' + PUBLIC_KEY_FIELD_NAME_CREATION_DATE = 'PUBLIC_KEY_FIELD_NAME_CREATION_DATE' + PUBLIC_KEY_FIELD_NAME_CHANGE_DATE = 'PUBLIC_KEY_FIELD_NAME_CHANGE_DATE' + PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE = 'PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PUBLIC_KEY_FIELD_NAME_UNSPECIFIED, PUBLIC_KEY_FIELD_NAME_CREATION_DATE, PUBLIC_KEY_FIELD_NAME_CHANGE_DATE, PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ActionServicePublicKeyFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/action_service_public_key_search_filter.rb b/lib/zitadel/client/models/action_service_public_key_search_filter.rb index 6408fbe2..54e32d64 100644 --- a/lib/zitadel/client/models/action_service_public_key_search_filter.rb +++ b/lib/zitadel/client/models/action_service_public_key_search_filter.rb @@ -1,234 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServicePublicKeySearchFilter - # Filter the keys by their active status. - attr_accessor :active_filter - - attr_accessor :expiration_date_filter - - attr_accessor :key_ids_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'active_filter' => :'activeFilter', - :'expiration_date_filter' => :'expirationDateFilter', - :'key_ids_filter' => :'keyIdsFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'active_filter' => :'Boolean', - :'expiration_date_filter' => :'ActionServiceTimestampFilter', - :'key_ids_filter' => :'ActionServiceInIDsFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServicePublicKeySearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServicePublicKeySearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'active_filter') - self.active_filter = attributes[:'active_filter'] - end - - if attributes.key?(:'expiration_date_filter') - self.expiration_date_filter = attributes[:'expiration_date_filter'] - end - - if attributes.key?(:'key_ids_filter') - self.key_ids_filter = attributes[:'key_ids_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - active_filter == o.active_filter && - expiration_date_filter == o.expiration_date_filter && - key_ids_filter == o.key_ids_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [active_filter, expiration_date_filter, key_ids_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServicePublicKeySearchFilter. + class ActionServicePublicKeySearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + active_filter: 'activeFilter', + expiration_date_filter: 'expirationDateFilter', + key_ids_filter: 'keyIdsFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + active_filter: 'Boolean', + expiration_date_filter: 'ActionServiceTimestampFilter', + key_ids_filter: 'ActionServiceInIDsFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Filter the keys by their active status. + # @example null + attribute :active_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :expiration_date_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :key_ids_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_r_e_s_t_call.rb b/lib/zitadel/client/models/action_service_r_e_s_t_call.rb deleted file mode 100644 index f453f1a0..00000000 --- a/lib/zitadel/client/models/action_service_r_e_s_t_call.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ActionServiceRESTCall - # Define if any error stops the whole execution. By default the process continues as normal. - attr_accessor :interrupt_on_error - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'interrupt_on_error' => :'interruptOnError' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'interrupt_on_error' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceRESTCall` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceRESTCall`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'interrupt_on_error') - self.interrupt_on_error = attributes[:'interrupt_on_error'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - interrupt_on_error == o.interrupt_on_error - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [interrupt_on_error].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/action_service_r_e_s_t_webhook.rb b/lib/zitadel/client/models/action_service_r_e_s_t_webhook.rb deleted file mode 100644 index c1926080..00000000 --- a/lib/zitadel/client/models/action_service_r_e_s_t_webhook.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ActionServiceRESTWebhook - # Define if any error stops the whole execution. By default the process continues as normal. - attr_accessor :interrupt_on_error - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'interrupt_on_error' => :'interruptOnError' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'interrupt_on_error' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceRESTWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceRESTWebhook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'interrupt_on_error') - self.interrupt_on_error = attributes[:'interrupt_on_error'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - interrupt_on_error == o.interrupt_on_error - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [interrupt_on_error].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/action_service_remove_public_key_request.rb b/lib/zitadel/client/models/action_service_remove_public_key_request.rb index a3393c39..eef9eed5 100644 --- a/lib/zitadel/client/models/action_service_remove_public_key_request.rb +++ b/lib/zitadel/client/models/action_service_remove_public_key_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceRemovePublicKeyRequest - # TargetID is the unique identifier of the target to remove the public key from. - attr_accessor :target_id - - # KeyID is the unique identifier of the public key to remove. - attr_accessor :key_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_id' => :'targetId', - :'key_id' => :'keyId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_id' => :'String', - :'key_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceRemovePublicKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceRemovePublicKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_id') - self.target_id = attributes[:'target_id'] - end - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_id == o.target_id && - key_id == o.key_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_id, key_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceRemovePublicKeyRequest. + class ActionServiceRemovePublicKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_id: 'targetId', + key_id: 'keyId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_id: 'String', + key_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # TargetID is the unique identifier of the target to remove the public key from. + # @example null + attribute :target_id, Types::Any.optional.meta(omittable: true) + # KeyID is the unique identifier of the public key to remove. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_remove_public_key_response.rb b/lib/zitadel/client/models/action_service_remove_public_key_response.rb index adf4f446..b857cfde 100644 --- a/lib/zitadel/client/models/action_service_remove_public_key_response.rb +++ b/lib/zitadel/client/models/action_service_remove_public_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceRemovePublicKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceRemovePublicKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceRemovePublicKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceRemovePublicKeyResponse. + class ActionServiceRemovePublicKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_request_execution.rb b/lib/zitadel/client/models/action_service_request_execution.rb index dd700d50..f403e7ea 100644 --- a/lib/zitadel/client/models/action_service_request_execution.rb +++ b/lib/zitadel/client/models/action_service_request_execution.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceRequestExecution - # Define all calls as condition. When a call to any available service happens, the execution is triggered. - attr_accessor :all - - # Define a GRPC-method as condition. When a request to this method happens, the execution is triggered. - attr_accessor :method - - # Define a GRPC-service as condition. When a request to any method of this service happens, the execution is triggered. - attr_accessor :service - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'all' => :'all', - :'method' => :'method', - :'service' => :'service' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'all' => :'Boolean', - :'method' => :'String', - :'service' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceRequestExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceRequestExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'all') - self.all = attributes[:'all'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - - if attributes.key?(:'service') - self.service = attributes[:'service'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - all == o.all && - method == o.method && - service == o.service - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [all, method, service].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceRequestExecution. + class ActionServiceRequestExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + all: 'all', + method: 'method', + service: 'service' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + all: 'Boolean', + method: 'String', + service: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Define all calls as condition. When a call to any available service happens, the execution is triggered. + # @example null + attribute :all, Types::Any.optional.meta(omittable: true) + # Define a GRPC-method as condition. When a request to this method happens, the execution is triggered. + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) + # Define a GRPC-service as condition. When a request to any method of this service happens, the execution is triggered. + # @example null + attribute :service, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_response_execution.rb b/lib/zitadel/client/models/action_service_response_execution.rb index fd88227c..70f065f6 100644 --- a/lib/zitadel/client/models/action_service_response_execution.rb +++ b/lib/zitadel/client/models/action_service_response_execution.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceResponseExecution - # Define all calls as condition. Before a response is returned to the client from any available service, the execution is triggered. - attr_accessor :all - - # Define a GRPC-method as condition. Before a response is returned to the client from this method, the execution is triggered. - attr_accessor :method - - # Define a GRPC-service as condition. Before a response is returned to the client from any method of this service, the execution is triggered. - attr_accessor :service - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'all' => :'all', - :'method' => :'method', - :'service' => :'service' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'all' => :'Boolean', - :'method' => :'String', - :'service' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceResponseExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceResponseExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'all') - self.all = attributes[:'all'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - - if attributes.key?(:'service') - self.service = attributes[:'service'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - all == o.all && - method == o.method && - service == o.service - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [all, method, service].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceResponseExecution. + class ActionServiceResponseExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + all: 'all', + method: 'method', + service: 'service' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + all: 'Boolean', + method: 'String', + service: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Define all calls as condition. Before a response is returned to the client from any available service, the execution is triggered. + # @example null + attribute :all, Types::Any.optional.meta(omittable: true) + # Define a GRPC-method as condition. Before a response is returned to the client from this method, the execution is triggered. + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) + # Define a GRPC-service as condition. Before a response is returned to the client from any method of this service, the execution is triggered. + # @example null + attribute :service, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_rest_call.rb b/lib/zitadel/client/models/action_service_rest_call.rb new file mode 100644 index 00000000..4e02e091 --- /dev/null +++ b/lib/zitadel/client/models/action_service_rest_call.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceRESTCall. + class ActionServiceRESTCall < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + interrupt_on_error: 'interruptOnError' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + interrupt_on_error: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Define if any error stops the whole execution. By default the process continues as normal. + # @example null + attribute :interrupt_on_error, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/action_service_rest_webhook.rb b/lib/zitadel/client/models/action_service_rest_webhook.rb new file mode 100644 index 00000000..d64cb2d1 --- /dev/null +++ b/lib/zitadel/client/models/action_service_rest_webhook.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceRESTWebhook. + class ActionServiceRESTWebhook < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + interrupt_on_error: 'interruptOnError' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + interrupt_on_error: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Define if any error stops the whole execution. By default the process continues as normal. + # @example null + attribute :interrupt_on_error, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/action_service_set_execution_request.rb b/lib/zitadel/client/models/action_service_set_execution_request.rb index 9988cbfe..cd5e6849 100644 --- a/lib/zitadel/client/models/action_service_set_execution_request.rb +++ b/lib/zitadel/client/models/action_service_set_execution_request.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceSetExecutionRequest - attr_accessor :condition - - # Ordered list of targets called during the execution. - attr_accessor :targets - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'condition' => :'condition', - :'targets' => :'targets' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'condition' => :'ActionServiceCondition', - :'targets' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceSetExecutionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceSetExecutionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'targets') - if (value = attributes[:'targets']).is_a?(Array) - self.targets = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - condition == o.condition && - targets == o.targets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [condition, targets].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceSetExecutionRequest. + class ActionServiceSetExecutionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + condition: 'condition', + targets: 'targets' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + condition: 'ActionServiceCondition', + targets: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :condition, Types::Any.optional.meta(omittable: true) + # Ordered list of targets called during the execution. + # @example null + attribute :targets, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_set_execution_response.rb b/lib/zitadel/client/models/action_service_set_execution_response.rb index 4b688468..b6bfc925 100644 --- a/lib/zitadel/client/models/action_service_set_execution_response.rb +++ b/lib/zitadel/client/models/action_service_set_execution_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceSetExecutionResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :set_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'set_date' => :'setDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'set_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceSetExecutionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceSetExecutionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'set_date') - self.set_date = attributes[:'set_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - set_date == o.set_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [set_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceSetExecutionResponse. + class ActionServiceSetExecutionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + set_date: 'setDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + set_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :set_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_target.rb b/lib/zitadel/client/models/action_service_target.rb index d9029381..26561998 100644 --- a/lib/zitadel/client/models/action_service_target.rb +++ b/lib/zitadel/client/models/action_service_target.rb @@ -1,334 +1,120 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceTarget - # The unique identifier of the target. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Display name of the target. - attr_accessor :name - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :timeout - - # The URL that will be called in case of an execution. - attr_accessor :endpoint - - # The current signing key used to sign the request sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256. - attr_accessor :signing_key - - attr_accessor :payload_type - - attr_accessor :rest_async - - attr_accessor :rest_call - - attr_accessor :rest_webhook - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'name' => :'name', - :'timeout' => :'timeout', - :'endpoint' => :'endpoint', - :'signing_key' => :'signingKey', - :'payload_type' => :'payloadType', - :'rest_async' => :'restAsync', - :'rest_call' => :'restCall', - :'rest_webhook' => :'restWebhook' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'name' => :'String', - :'timeout' => :'String', - :'endpoint' => :'String', - :'signing_key' => :'String', - :'payload_type' => :'ActionServicePayloadType', - :'rest_async' => :'Object', - :'rest_call' => :'ActionServiceRESTCall', - :'rest_webhook' => :'ActionServiceRESTWebhook' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceTarget` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceTarget`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'endpoint') - self.endpoint = attributes[:'endpoint'] - end - - if attributes.key?(:'signing_key') - self.signing_key = attributes[:'signing_key'] - end - - if attributes.key?(:'payload_type') - self.payload_type = attributes[:'payload_type'] - end - - if attributes.key?(:'rest_async') - self.rest_async = attributes[:'rest_async'] - end - - if attributes.key?(:'rest_call') - self.rest_call = attributes[:'rest_call'] - end - - if attributes.key?(:'rest_webhook') - self.rest_webhook = attributes[:'rest_webhook'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - change_date == o.change_date && - name == o.name && - timeout == o.timeout && - endpoint == o.endpoint && - signing_key == o.signing_key && - payload_type == o.payload_type && - rest_async == o.rest_async && - rest_call == o.rest_call && - rest_webhook == o.rest_webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, change_date, name, timeout, endpoint, signing_key, payload_type, rest_async, rest_call, rest_webhook].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceTarget. + class ActionServiceTarget < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + change_date: 'changeDate', + name: 'name', + timeout: 'timeout', + endpoint: 'endpoint', + signing_key: 'signingKey', + payload_type: 'payloadType', + rest_async: 'restAsync', + rest_call: 'restCall', + rest_webhook: 'restWebhook' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + change_date: 'Time', + name: 'String', + timeout: 'ISO8601::Duration', + endpoint: 'String', + signing_key: 'String', + payload_type: 'ActionServicePayloadType', + rest_async: 'Object', + rest_call: 'ActionServiceRESTCall', + rest_webhook: 'ActionServiceRESTWebhook' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The unique identifier of the target. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # Display name of the target. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :timeout, Types::Any.optional.meta(omittable: true) + # The URL that will be called in case of an execution. + # @example null + attribute :endpoint, Types::Any.optional.meta(omittable: true) + # The current signing key used to sign the request sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256. + # @example null + attribute :signing_key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :payload_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_async, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_call, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_webhook, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_target_field_name.rb b/lib/zitadel/client/models/action_service_target_field_name.rb index f98a66f8..e04241b1 100644 --- a/lib/zitadel/client/models/action_service_target_field_name.rb +++ b/lib/zitadel/client/models/action_service_target_field_name.rb @@ -1,48 +1,68 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class ActionServiceTargetFieldName - TARGET_FIELD_NAME_UNSPECIFIED = "TARGET_FIELD_NAME_UNSPECIFIED".freeze - TARGET_FIELD_NAME_ID = "TARGET_FIELD_NAME_ID".freeze - TARGET_FIELD_NAME_CREATED_DATE = "TARGET_FIELD_NAME_CREATED_DATE".freeze - TARGET_FIELD_NAME_CHANGED_DATE = "TARGET_FIELD_NAME_CHANGED_DATE".freeze - TARGET_FIELD_NAME_NAME = "TARGET_FIELD_NAME_NAME".freeze - TARGET_FIELD_NAME_TARGET_TYPE = "TARGET_FIELD_NAME_TARGET_TYPE".freeze - TARGET_FIELD_NAME_URL = "TARGET_FIELD_NAME_URL".freeze - TARGET_FIELD_NAME_TIMEOUT = "TARGET_FIELD_NAME_TIMEOUT".freeze - TARGET_FIELD_NAME_INTERRUPT_ON_ERROR = "TARGET_FIELD_NAME_INTERRUPT_ON_ERROR".freeze - - def self.all_vars - @all_vars ||= [TARGET_FIELD_NAME_UNSPECIFIED, TARGET_FIELD_NAME_ID, TARGET_FIELD_NAME_CREATED_DATE, TARGET_FIELD_NAME_CHANGED_DATE, TARGET_FIELD_NAME_NAME, TARGET_FIELD_NAME_TARGET_TYPE, TARGET_FIELD_NAME_URL, TARGET_FIELD_NAME_TIMEOUT, TARGET_FIELD_NAME_INTERRUPT_ON_ERROR].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ActionServiceTargetFieldName. + class ActionServiceTargetFieldName + TARGET_FIELD_NAME_UNSPECIFIED = 'TARGET_FIELD_NAME_UNSPECIFIED' + TARGET_FIELD_NAME_ID = 'TARGET_FIELD_NAME_ID' + TARGET_FIELD_NAME_CREATED_DATE = 'TARGET_FIELD_NAME_CREATED_DATE' + TARGET_FIELD_NAME_CHANGED_DATE = 'TARGET_FIELD_NAME_CHANGED_DATE' + TARGET_FIELD_NAME_NAME = 'TARGET_FIELD_NAME_NAME' + TARGET_FIELD_NAME_TARGET_TYPE = 'TARGET_FIELD_NAME_TARGET_TYPE' + TARGET_FIELD_NAME_URL = 'TARGET_FIELD_NAME_URL' + TARGET_FIELD_NAME_TIMEOUT = 'TARGET_FIELD_NAME_TIMEOUT' + TARGET_FIELD_NAME_INTERRUPT_ON_ERROR = 'TARGET_FIELD_NAME_INTERRUPT_ON_ERROR' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TARGET_FIELD_NAME_UNSPECIFIED, TARGET_FIELD_NAME_ID, TARGET_FIELD_NAME_CREATED_DATE, TARGET_FIELD_NAME_CHANGED_DATE, TARGET_FIELD_NAME_NAME, TARGET_FIELD_NAME_TARGET_TYPE, TARGET_FIELD_NAME_URL, TARGET_FIELD_NAME_TIMEOUT, TARGET_FIELD_NAME_INTERRUPT_ON_ERROR].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ActionServiceTargetFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServiceTargetFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ActionServiceTargetFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/action_service_target_filter.rb b/lib/zitadel/client/models/action_service_target_filter.rb index 1190915c..bba57b9e 100644 --- a/lib/zitadel/client/models/action_service_target_filter.rb +++ b/lib/zitadel/client/models/action_service_target_filter.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceTargetFilter - # Defines the id of the target that needs to be part of the execution. - attr_accessor :target_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_id' => :'targetId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceTargetFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceTargetFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_id') - self.target_id = attributes[:'target_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_id == o.target_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceTargetFilter. + class ActionServiceTargetFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_id: 'targetId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Defines the id of the target that needs to be part of the execution. + # @example null + attribute :target_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_target_name_filter.rb b/lib/zitadel/client/models/action_service_target_name_filter.rb index 09ff8d19..dcefd6a4 100644 --- a/lib/zitadel/client/models/action_service_target_name_filter.rb +++ b/lib/zitadel/client/models/action_service_target_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceTargetNameFilter - # Defines the name of the target to query for. - attr_accessor :target_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_name' => :'targetName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_name' => :'String', - :'method' => :'ActionServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceTargetNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceTargetNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_name') - self.target_name = attributes[:'target_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_name == o.target_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceTargetNameFilter. + class ActionServiceTargetNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_name: 'targetName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_name: 'String', + method: 'ActionServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Defines the name of the target to query for. + # @example null + attribute :target_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_target_search_filter.rb b/lib/zitadel/client/models/action_service_target_search_filter.rb index 2ced9e60..da0e9ef5 100644 --- a/lib/zitadel/client/models/action_service_target_search_filter.rb +++ b/lib/zitadel/client/models/action_service_target_search_filter.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceTargetSearchFilter - attr_accessor :in_target_ids_filter - - attr_accessor :target_name_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'in_target_ids_filter' => :'inTargetIdsFilter', - :'target_name_filter' => :'targetNameFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'in_target_ids_filter' => :'ActionServiceInTargetIDsFilter', - :'target_name_filter' => :'ActionServiceTargetNameFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceTargetSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceTargetSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'in_target_ids_filter') - self.in_target_ids_filter = attributes[:'in_target_ids_filter'] - end - - if attributes.key?(:'target_name_filter') - self.target_name_filter = attributes[:'target_name_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - in_target_ids_filter == o.in_target_ids_filter && - target_name_filter == o.target_name_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [in_target_ids_filter, target_name_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceTargetSearchFilter. + class ActionServiceTargetSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + in_target_ids_filter: 'inTargetIdsFilter', + target_name_filter: 'targetNameFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + in_target_ids_filter: 'ActionServiceInTargetIDsFilter', + target_name_filter: 'ActionServiceTargetNameFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :in_target_ids_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :target_name_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/action_service_text_filter_method.rb b/lib/zitadel/client/models/action_service_text_filter_method.rb index 96387dd6..04e355dd 100644 --- a/lib/zitadel/client/models/action_service_text_filter_method.rb +++ b/lib/zitadel/client/models/action_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class ActionServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ActionServiceTextFilterMethod. + class ActionServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ActionServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ActionServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/action_service_timestamp_filter.rb b/lib/zitadel/client/models/action_service_timestamp_filter.rb index 5cb3d7ca..b857d951 100644 --- a/lib/zitadel/client/models/action_service_timestamp_filter.rb +++ b/lib/zitadel/client/models/action_service_timestamp_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceTimestampFilter - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'timestamp' => :'timestamp', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'timestamp' => :'Time', - :'method' => :'ActionServiceTimestampFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceTimestampFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceTimestampFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - timestamp == o.timestamp && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [timestamp, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceTimestampFilter. + class ActionServiceTimestampFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + timestamp: 'timestamp', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + timestamp: 'Time', + method: 'ActionServiceTimestampFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_timestamp_filter_method.rb b/lib/zitadel/client/models/action_service_timestamp_filter_method.rb index 60c48600..3f31ba8c 100644 --- a/lib/zitadel/client/models/action_service_timestamp_filter_method.rb +++ b/lib/zitadel/client/models/action_service_timestamp_filter_method.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class ActionServiceTimestampFilterMethod - TIMESTAMP_FILTER_METHOD_EQUALS = "TIMESTAMP_FILTER_METHOD_EQUALS".freeze - TIMESTAMP_FILTER_METHOD_AFTER = "TIMESTAMP_FILTER_METHOD_AFTER".freeze - TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS".freeze - TIMESTAMP_FILTER_METHOD_BEFORE = "TIMESTAMP_FILTER_METHOD_BEFORE".freeze - TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ActionServiceTimestampFilterMethod. + class ActionServiceTimestampFilterMethod + TIMESTAMP_FILTER_METHOD_EQUALS = 'TIMESTAMP_FILTER_METHOD_EQUALS' + TIMESTAMP_FILTER_METHOD_AFTER = 'TIMESTAMP_FILTER_METHOD_AFTER' + TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS' + TIMESTAMP_FILTER_METHOD_BEFORE = 'TIMESTAMP_FILTER_METHOD_BEFORE' + TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS' - def self.all_vars - @all_vars ||= [TIMESTAMP_FILTER_METHOD_EQUALS, TIMESTAMP_FILTER_METHOD_AFTER, TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS, TIMESTAMP_FILTER_METHOD_BEFORE, TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [TIMESTAMP_FILTER_METHOD_EQUALS, TIMESTAMP_FILTER_METHOD_AFTER, TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS, TIMESTAMP_FILTER_METHOD_BEFORE, TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ActionServiceTimestampFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ActionServiceTimestampFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ActionServiceTimestampFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/action_service_update_target_request.rb b/lib/zitadel/client/models/action_service_update_target_request.rb index 4c646551..e6e2e232 100644 --- a/lib/zitadel/client/models/action_service_update_target_request.rb +++ b/lib/zitadel/client/models/action_service_update_target_request.rb @@ -1,316 +1,110 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceUpdateTargetRequest - # The unique identifier of the target to update. - attr_accessor :id - - # Optionally, update the name of the target. If not set, the name will not be changed. - attr_accessor :name - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :timeout - - # The new URL of the endpoint to call. If not set, the endpoint will not be changed. - attr_accessor :endpoint - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :expiration_signing_key - - attr_accessor :payload_type - - attr_accessor :rest_async - - attr_accessor :rest_call - - attr_accessor :rest_webhook - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'timeout' => :'timeout', - :'endpoint' => :'endpoint', - :'expiration_signing_key' => :'expirationSigningKey', - :'payload_type' => :'payloadType', - :'rest_async' => :'restAsync', - :'rest_call' => :'restCall', - :'rest_webhook' => :'restWebhook' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'timeout' => :'String', - :'endpoint' => :'String', - :'expiration_signing_key' => :'String', - :'payload_type' => :'ActionServicePayloadType', - :'rest_async' => :'Object', - :'rest_call' => :'ActionServiceRESTCall', - :'rest_webhook' => :'ActionServiceRESTWebhook' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'endpoint', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceUpdateTargetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceUpdateTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'endpoint') - self.endpoint = attributes[:'endpoint'] - end - - if attributes.key?(:'expiration_signing_key') - self.expiration_signing_key = attributes[:'expiration_signing_key'] - end - - if attributes.key?(:'payload_type') - self.payload_type = attributes[:'payload_type'] - end - - if attributes.key?(:'rest_async') - self.rest_async = attributes[:'rest_async'] - end - - if attributes.key?(:'rest_call') - self.rest_call = attributes[:'rest_call'] - end - - if attributes.key?(:'rest_webhook') - self.rest_webhook = attributes[:'rest_webhook'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - timeout == o.timeout && - endpoint == o.endpoint && - expiration_signing_key == o.expiration_signing_key && - payload_type == o.payload_type && - rest_async == o.rest_async && - rest_call == o.rest_call && - rest_webhook == o.rest_webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, timeout, endpoint, expiration_signing_key, payload_type, rest_async, rest_call, rest_webhook].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceUpdateTargetRequest. + class ActionServiceUpdateTargetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name', + timeout: 'timeout', + endpoint: 'endpoint', + expiration_signing_key: 'expirationSigningKey', + payload_type: 'payloadType', + rest_async: 'restAsync', + rest_call: 'restCall', + rest_webhook: 'restWebhook' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String', + timeout: 'ISO8601::Duration', + endpoint: 'String', + expiration_signing_key: 'ISO8601::Duration', + payload_type: 'ActionServicePayloadType', + rest_async: 'Object', + rest_call: 'ActionServiceRESTCall', + rest_webhook: 'ActionServiceRESTWebhook' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the target to update. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Optionally, update the name of the target. If not set, the name will not be changed. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :timeout, Types::Any.optional.meta(omittable: true) + # The new URL of the endpoint to call. If not set, the endpoint will not be changed. + # @example null + attribute :endpoint, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :expiration_signing_key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :payload_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_async, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_call, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_webhook, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/action_service_update_target_response.rb b/lib/zitadel/client/models/action_service_update_target_response.rb index 694dea7b..b7c004b1 100644 --- a/lib/zitadel/client/models/action_service_update_target_response.rb +++ b/lib/zitadel/client/models/action_service_update_target_response.rb @@ -1,227 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ActionServiceUpdateTargetResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Key used to sign and check payload sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256. The key is only returned if expirationSigningKey was set in the request. - attr_accessor :signing_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate', - :'signing_key' => :'signingKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time', - :'signing_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'signing_key' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ActionServiceUpdateTargetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ActionServiceUpdateTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'signing_key') - self.signing_key = attributes[:'signing_key'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date && - signing_key == o.signing_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date, signing_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ActionServiceUpdateTargetResponse. + class ActionServiceUpdateTargetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate', + signing_key: 'signingKey' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time', + signing_key: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # Key used to sign and check payload sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256. The key is only returned if expirationSigningKey was set in the request. + # @example null + attribute :signing_key, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_a_p_i_auth_method_type.rb b/lib/zitadel/client/models/application_service_a_p_i_auth_method_type.rb deleted file mode 100644 index 590f412b..00000000 --- a/lib/zitadel/client/models/application_service_a_p_i_auth_method_type.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceAPIAuthMethodType - API_AUTH_METHOD_TYPE_BASIC = "API_AUTH_METHOD_TYPE_BASIC".freeze - API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT".freeze - - def self.all_vars - @all_vars ||= [API_AUTH_METHOD_TYPE_BASIC, API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceAPIAuthMethodType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceAPIAuthMethodType" - end - end - -end diff --git a/lib/zitadel/client/models/application_service_a_p_i_configuration.rb b/lib/zitadel/client/models/application_service_a_p_i_configuration.rb deleted file mode 100644 index 97d4adb0..00000000 --- a/lib/zitadel/client/models/application_service_a_p_i_configuration.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceAPIConfiguration - # The unique OAuth2 client_id used for authentication of the API, e.g. at the introspection endpoint. - attr_accessor :client_id - - attr_accessor :auth_method_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'auth_method_type' => :'authMethodType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'auth_method_type' => :'ApplicationServiceAPIAuthMethodType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceAPIConfiguration` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceAPIConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - auth_method_type == o.auth_method_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, auth_method_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_any.rb b/lib/zitadel/client/models/application_service_any.rb index f7705609..463c8395 100644 --- a/lib/zitadel/client/models/application_service_any.rb +++ b/lib/zitadel/client/models/application_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class ApplicationServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class ApplicationServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_api_auth_method_type.rb b/lib/zitadel/client/models/application_service_api_auth_method_type.rb new file mode 100644 index 00000000..e53f6ee2 --- /dev/null +++ b/lib/zitadel/client/models/application_service_api_auth_method_type.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceAPIAuthMethodType. + class ApplicationServiceAPIAuthMethodType + API_AUTH_METHOD_TYPE_BASIC = 'API_AUTH_METHOD_TYPE_BASIC' + API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = 'API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT' + + # Frozen set of all allowed values, used for validation. + VALUES = [API_AUTH_METHOD_TYPE_BASIC, API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceAPIAuthMethodType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/application_service_api_configuration.rb b/lib/zitadel/client/models/application_service_api_configuration.rb new file mode 100644 index 00000000..986e0bd7 --- /dev/null +++ b/lib/zitadel/client/models/application_service_api_configuration.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceAPIConfiguration. + class ApplicationServiceAPIConfiguration < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + auth_method_type: 'authMethodType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + auth_method_type: 'ApplicationServiceAPIAuthMethodType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The unique OAuth2 client_id used for authentication of the API, e.g. at the introspection endpoint. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_application.rb b/lib/zitadel/client/models/application_service_application.rb index ad7b6fe6..c3f02558 100644 --- a/lib/zitadel/client/models/application_service_application.rb +++ b/lib/zitadel/client/models/application_service_application.rb @@ -1,314 +1,110 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceApplication - # The unique identifier of the application. - attr_accessor :application_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :state - - # The name of the application. This can be displayed to users. - attr_accessor :name - - # The ProjectID represents the ID of the project the application belongs to. - attr_accessor :project_id - - attr_accessor :api_configuration - - attr_accessor :oidc_configuration - - attr_accessor :saml_configuration - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'state' => :'state', - :'name' => :'name', - :'project_id' => :'projectId', - :'api_configuration' => :'apiConfiguration', - :'oidc_configuration' => :'oidcConfiguration', - :'saml_configuration' => :'samlConfiguration' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'state' => :'ApplicationServiceApplicationState', - :'name' => :'String', - :'project_id' => :'String', - :'api_configuration' => :'ApplicationServiceAPIConfiguration', - :'oidc_configuration' => :'ApplicationServiceOIDCConfiguration', - :'saml_configuration' => :'ApplicationServiceSAMLConfiguration' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceApplication` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceApplication`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'api_configuration') - self.api_configuration = attributes[:'api_configuration'] - end - - if attributes.key?(:'oidc_configuration') - self.oidc_configuration = attributes[:'oidc_configuration'] - end - - if attributes.key?(:'saml_configuration') - self.saml_configuration = attributes[:'saml_configuration'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - creation_date == o.creation_date && - change_date == o.change_date && - state == o.state && - name == o.name && - project_id == o.project_id && - api_configuration == o.api_configuration && - oidc_configuration == o.oidc_configuration && - saml_configuration == o.saml_configuration - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, creation_date, change_date, state, name, project_id, api_configuration, oidc_configuration, saml_configuration].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceApplication. + class ApplicationServiceApplication < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId', + creation_date: 'creationDate', + change_date: 'changeDate', + state: 'state', + name: 'name', + project_id: 'projectId', + api_configuration: 'apiConfiguration', + oidc_configuration: 'oidcConfiguration', + saml_configuration: 'samlConfiguration' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String', + creation_date: 'Time', + change_date: 'Time', + state: 'ApplicationServiceApplicationState', + name: 'String', + project_id: 'String', + api_configuration: 'ApplicationServiceAPIConfiguration', + oidc_configuration: 'ApplicationServiceOIDCConfiguration', + saml_configuration: 'ApplicationServiceSAMLConfiguration' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the application. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # The name of the application. This can be displayed to users. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # The ProjectID represents the ID of the project the application belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :api_configuration, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_configuration, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml_configuration, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_application_key.rb b/lib/zitadel/client/models/application_service_application_key.rb index a003bbbc..f22c2d7a 100644 --- a/lib/zitadel/client/models/application_service_application_key.rb +++ b/lib/zitadel/client/models/application_service_application_key.rb @@ -1,266 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceApplicationKey - # The unique identifier of the application key. - attr_accessor :key_id - - # The identifier of the application this key belongs to. - attr_accessor :application_id - - # The identifier of the project this application belongs to. - attr_accessor :project_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # The identifier of the organization this application belongs to. - attr_accessor :organization_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_id' => :'keyId', - :'application_id' => :'applicationId', - :'project_id' => :'projectId', - :'creation_date' => :'creationDate', - :'organization_id' => :'organizationId', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_id' => :'String', - :'application_id' => :'String', - :'project_id' => :'String', - :'creation_date' => :'Time', - :'organization_id' => :'String', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceApplicationKey` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceApplicationKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_id == o.key_id && - application_id == o.application_id && - project_id == o.project_id && - creation_date == o.creation_date && - organization_id == o.organization_id && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_id, application_id, project_id, creation_date, organization_id, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceApplicationKey. + class ApplicationServiceApplicationKey < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_id: 'keyId', + application_id: 'applicationId', + project_id: 'projectId', + creation_date: 'creationDate', + organization_id: 'organizationId', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_id: 'String', + application_id: 'String', + project_id: 'String', + creation_date: 'Time', + organization_id: 'String', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the application key. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) + # The identifier of the application this key belongs to. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # The identifier of the project this application belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # The identifier of the organization this application belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_application_key_application_i_d_filter.rb b/lib/zitadel/client/models/application_service_application_key_application_i_d_filter.rb deleted file mode 100644 index 95d209ae..00000000 --- a/lib/zitadel/client/models/application_service_application_key_application_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceApplicationKeyApplicationIDFilter - # Search for application keys belonging to the application with this ID. - attr_accessor :application_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceApplicationKeyApplicationIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceApplicationKeyApplicationIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_application_key_application_id_filter.rb b/lib/zitadel/client/models/application_service_application_key_application_id_filter.rb new file mode 100644 index 00000000..28072e00 --- /dev/null +++ b/lib/zitadel/client/models/application_service_application_key_application_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceApplicationKeyApplicationIDFilter. + class ApplicationServiceApplicationKeyApplicationIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Search for application keys belonging to the application with this ID. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_application_key_organization_i_d_filter.rb b/lib/zitadel/client/models/application_service_application_key_organization_i_d_filter.rb deleted file mode 100644 index 24405a71..00000000 --- a/lib/zitadel/client/models/application_service_application_key_organization_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceApplicationKeyOrganizationIDFilter - # Search for application keys belonging to applications in the organization with this ID. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceApplicationKeyOrganizationIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceApplicationKeyOrganizationIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_application_key_organization_id_filter.rb b/lib/zitadel/client/models/application_service_application_key_organization_id_filter.rb new file mode 100644 index 00000000..b0b12a8e --- /dev/null +++ b/lib/zitadel/client/models/application_service_application_key_organization_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceApplicationKeyOrganizationIDFilter. + class ApplicationServiceApplicationKeyOrganizationIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Search for application keys belonging to applications in the organization with this ID. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_application_key_project_i_d_filter.rb b/lib/zitadel/client/models/application_service_application_key_project_i_d_filter.rb deleted file mode 100644 index 66f54196..00000000 --- a/lib/zitadel/client/models/application_service_application_key_project_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceApplicationKeyProjectIDFilter - # Search for application keys belonging to applications in the project with this ID. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceApplicationKeyProjectIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceApplicationKeyProjectIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_application_key_project_id_filter.rb b/lib/zitadel/client/models/application_service_application_key_project_id_filter.rb new file mode 100644 index 00000000..85854292 --- /dev/null +++ b/lib/zitadel/client/models/application_service_application_key_project_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceApplicationKeyProjectIDFilter. + class ApplicationServiceApplicationKeyProjectIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Search for application keys belonging to applications in the project with this ID. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_application_key_search_filter.rb b/lib/zitadel/client/models/application_service_application_key_search_filter.rb index f226347e..e0820e7a 100644 --- a/lib/zitadel/client/models/application_service_application_key_search_filter.rb +++ b/lib/zitadel/client/models/application_service_application_key_search_filter.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceApplicationKeySearchFilter - attr_accessor :application_id_filter - - attr_accessor :organization_id_filter - - attr_accessor :project_id_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id_filter' => :'applicationIdFilter', - :'organization_id_filter' => :'organizationIdFilter', - :'project_id_filter' => :'projectIdFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id_filter' => :'ApplicationServiceApplicationKeyApplicationIDFilter', - :'organization_id_filter' => :'ApplicationServiceApplicationKeyOrganizationIDFilter', - :'project_id_filter' => :'ApplicationServiceApplicationKeyProjectIDFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceApplicationKeySearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceApplicationKeySearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id_filter') - self.application_id_filter = attributes[:'application_id_filter'] - end - - if attributes.key?(:'organization_id_filter') - self.organization_id_filter = attributes[:'organization_id_filter'] - end - - if attributes.key?(:'project_id_filter') - self.project_id_filter = attributes[:'project_id_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id_filter == o.application_id_filter && - organization_id_filter == o.organization_id_filter && - project_id_filter == o.project_id_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id_filter, organization_id_filter, project_id_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceApplicationKeySearchFilter. + class ApplicationServiceApplicationKeySearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id_filter: 'applicationIdFilter', + organization_id_filter: 'organizationIdFilter', + project_id_filter: 'projectIdFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id_filter: 'ApplicationServiceApplicationKeyApplicationIDFilter', + organization_id_filter: 'ApplicationServiceApplicationKeyOrganizationIDFilter', + project_id_filter: 'ApplicationServiceApplicationKeyProjectIDFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :application_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_id_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_application_keys_sorting.rb b/lib/zitadel/client/models/application_service_application_keys_sorting.rb index 2ae922e2..8b57478d 100644 --- a/lib/zitadel/client/models/application_service_application_keys_sorting.rb +++ b/lib/zitadel/client/models/application_service_application_keys_sorting.rb @@ -1,46 +1,66 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class ApplicationServiceApplicationKeysSorting - APPLICATION_KEYS_SORT_BY_ID = "APPLICATION_KEYS_SORT_BY_ID".freeze - APPLICATION_KEYS_SORT_BY_PROJECT_ID = "APPLICATION_KEYS_SORT_BY_PROJECT_ID".freeze - APPLICATION_KEYS_SORT_BY_APPLICATION_ID = "APPLICATION_KEYS_SORT_BY_APPLICATION_ID".freeze - APPLICATION_KEYS_SORT_BY_CREATION_DATE = "APPLICATION_KEYS_SORT_BY_CREATION_DATE".freeze - APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID = "APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID".freeze - APPLICATION_KEYS_SORT_BY_EXPIRATION = "APPLICATION_KEYS_SORT_BY_EXPIRATION".freeze - APPLICATION_KEYS_SORT_BY_TYPE = "APPLICATION_KEYS_SORT_BY_TYPE".freeze - - def self.all_vars - @all_vars ||= [APPLICATION_KEYS_SORT_BY_ID, APPLICATION_KEYS_SORT_BY_PROJECT_ID, APPLICATION_KEYS_SORT_BY_APPLICATION_ID, APPLICATION_KEYS_SORT_BY_CREATION_DATE, APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID, APPLICATION_KEYS_SORT_BY_EXPIRATION, APPLICATION_KEYS_SORT_BY_TYPE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceApplicationKeysSorting. + class ApplicationServiceApplicationKeysSorting + APPLICATION_KEYS_SORT_BY_ID = 'APPLICATION_KEYS_SORT_BY_ID' + APPLICATION_KEYS_SORT_BY_PROJECT_ID = 'APPLICATION_KEYS_SORT_BY_PROJECT_ID' + APPLICATION_KEYS_SORT_BY_APPLICATION_ID = 'APPLICATION_KEYS_SORT_BY_APPLICATION_ID' + APPLICATION_KEYS_SORT_BY_CREATION_DATE = 'APPLICATION_KEYS_SORT_BY_CREATION_DATE' + APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID = 'APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID' + APPLICATION_KEYS_SORT_BY_EXPIRATION = 'APPLICATION_KEYS_SORT_BY_EXPIRATION' + APPLICATION_KEYS_SORT_BY_TYPE = 'APPLICATION_KEYS_SORT_BY_TYPE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [APPLICATION_KEYS_SORT_BY_ID, APPLICATION_KEYS_SORT_BY_PROJECT_ID, APPLICATION_KEYS_SORT_BY_APPLICATION_ID, APPLICATION_KEYS_SORT_BY_CREATION_DATE, APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID, APPLICATION_KEYS_SORT_BY_EXPIRATION, APPLICATION_KEYS_SORT_BY_TYPE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceApplicationKeysSorting.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceApplicationKeysSorting" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceApplicationKeysSorting: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/application_service_application_name_filter.rb b/lib/zitadel/client/models/application_service_application_name_filter.rb index bc06dd87..d1e5b360 100644 --- a/lib/zitadel/client/models/application_service_application_name_filter.rb +++ b/lib/zitadel/client/models/application_service_application_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceApplicationNameFilter - # The name of the application to search for. - attr_accessor :name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'method' => :'ApplicationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceApplicationNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceApplicationNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceApplicationNameFilter. + class ApplicationServiceApplicationNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + method: 'ApplicationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The name of the application to search for. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_application_search_filter.rb b/lib/zitadel/client/models/application_service_application_search_filter.rb index a3fe65b2..69227ec2 100644 --- a/lib/zitadel/client/models/application_service_application_search_filter.rb +++ b/lib/zitadel/client/models/application_service_application_search_filter.rb @@ -1,282 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceApplicationSearchFilter - attr_accessor :client_id_filter - - attr_accessor :entity_id_filter - - attr_accessor :name_filter - - attr_accessor :project_id_filter - - attr_accessor :state_filter - - attr_accessor :type_filter - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id_filter' => :'clientIdFilter', - :'entity_id_filter' => :'entityIdFilter', - :'name_filter' => :'nameFilter', - :'project_id_filter' => :'projectIdFilter', - :'state_filter' => :'stateFilter', - :'type_filter' => :'typeFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id_filter' => :'ApplicationServiceClientIDFilter', - :'entity_id_filter' => :'ApplicationServiceEntityIDFilter', - :'name_filter' => :'ApplicationServiceApplicationNameFilter', - :'project_id_filter' => :'ApplicationServiceProjectIDFilter', - :'state_filter' => :'ApplicationServiceApplicationState', - :'type_filter' => :'ApplicationServiceApplicationType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceApplicationSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceApplicationSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id_filter') - self.client_id_filter = attributes[:'client_id_filter'] - end - - if attributes.key?(:'entity_id_filter') - self.entity_id_filter = attributes[:'entity_id_filter'] - end - - if attributes.key?(:'name_filter') - self.name_filter = attributes[:'name_filter'] - end - - if attributes.key?(:'project_id_filter') - self.project_id_filter = attributes[:'project_id_filter'] - end - - if attributes.key?(:'state_filter') - self.state_filter = attributes[:'state_filter'] - end - - if attributes.key?(:'type_filter') - self.type_filter = attributes[:'type_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id_filter == o.client_id_filter && - entity_id_filter == o.entity_id_filter && - name_filter == o.name_filter && - project_id_filter == o.project_id_filter && - state_filter == o.state_filter && - type_filter == o.type_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id_filter, entity_id_filter, name_filter, project_id_filter, state_filter, type_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceApplicationSearchFilter. + class ApplicationServiceApplicationSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id_filter: 'clientIdFilter', + entity_id_filter: 'entityIdFilter', + name_filter: 'nameFilter', + project_id_filter: 'projectIdFilter', + state_filter: 'stateFilter', + type_filter: 'typeFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id_filter: 'ApplicationServiceClientIDFilter', + entity_id_filter: 'ApplicationServiceEntityIDFilter', + name_filter: 'ApplicationServiceApplicationNameFilter', + project_id_filter: 'ApplicationServiceProjectIDFilter', + state_filter: 'ApplicationServiceApplicationState', + type_filter: 'ApplicationServiceApplicationType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :client_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :entity_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :type_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_application_sorting.rb b/lib/zitadel/client/models/application_service_application_sorting.rb index e8100897..3542f4b1 100644 --- a/lib/zitadel/client/models/application_service_application_sorting.rb +++ b/lib/zitadel/client/models/application_service_application_sorting.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class ApplicationServiceApplicationSorting - APPLICATION_SORT_BY_ID = "APPLICATION_SORT_BY_ID".freeze - APPLICATION_SORT_BY_NAME = "APPLICATION_SORT_BY_NAME".freeze - APPLICATION_SORT_BY_STATE = "APPLICATION_SORT_BY_STATE".freeze - APPLICATION_SORT_BY_CREATION_DATE = "APPLICATION_SORT_BY_CREATION_DATE".freeze - APPLICATION_SORT_BY_CHANGE_DATE = "APPLICATION_SORT_BY_CHANGE_DATE".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceApplicationSorting. + class ApplicationServiceApplicationSorting + APPLICATION_SORT_BY_ID = 'APPLICATION_SORT_BY_ID' + APPLICATION_SORT_BY_NAME = 'APPLICATION_SORT_BY_NAME' + APPLICATION_SORT_BY_STATE = 'APPLICATION_SORT_BY_STATE' + APPLICATION_SORT_BY_CREATION_DATE = 'APPLICATION_SORT_BY_CREATION_DATE' + APPLICATION_SORT_BY_CHANGE_DATE = 'APPLICATION_SORT_BY_CHANGE_DATE' - def self.all_vars - @all_vars ||= [APPLICATION_SORT_BY_ID, APPLICATION_SORT_BY_NAME, APPLICATION_SORT_BY_STATE, APPLICATION_SORT_BY_CREATION_DATE, APPLICATION_SORT_BY_CHANGE_DATE].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [APPLICATION_SORT_BY_ID, APPLICATION_SORT_BY_NAME, APPLICATION_SORT_BY_STATE, APPLICATION_SORT_BY_CREATION_DATE, APPLICATION_SORT_BY_CHANGE_DATE].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceApplicationSorting.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceApplicationSorting" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceApplicationSorting: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/application_service_application_state.rb b/lib/zitadel/client/models/application_service_application_state.rb index 02823e8c..9215139a 100644 --- a/lib/zitadel/client/models/application_service_application_state.rb +++ b/lib/zitadel/client/models/application_service_application_state.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ApplicationServiceApplicationState - APPLICATION_STATE_UNSPECIFIED = "APPLICATION_STATE_UNSPECIFIED".freeze - APPLICATION_STATE_ACTIVE = "APPLICATION_STATE_ACTIVE".freeze - APPLICATION_STATE_INACTIVE = "APPLICATION_STATE_INACTIVE".freeze - APPLICATION_STATE_REMOVED = "APPLICATION_STATE_REMOVED".freeze - - def self.all_vars - @all_vars ||= [APPLICATION_STATE_UNSPECIFIED, APPLICATION_STATE_ACTIVE, APPLICATION_STATE_INACTIVE, APPLICATION_STATE_REMOVED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceApplicationState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceApplicationState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceApplicationState. + class ApplicationServiceApplicationState + APPLICATION_STATE_UNSPECIFIED = 'APPLICATION_STATE_UNSPECIFIED' + APPLICATION_STATE_ACTIVE = 'APPLICATION_STATE_ACTIVE' + APPLICATION_STATE_INACTIVE = 'APPLICATION_STATE_INACTIVE' + APPLICATION_STATE_REMOVED = 'APPLICATION_STATE_REMOVED' + + # Frozen set of all allowed values, used for validation. + VALUES = [APPLICATION_STATE_UNSPECIFIED, APPLICATION_STATE_ACTIVE, APPLICATION_STATE_INACTIVE, APPLICATION_STATE_REMOVED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceApplicationState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/application_service_application_type.rb b/lib/zitadel/client/models/application_service_application_type.rb index 4a48de72..f228e655 100644 --- a/lib/zitadel/client/models/application_service_application_type.rb +++ b/lib/zitadel/client/models/application_service_application_type.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ApplicationServiceApplicationType - APPLICATION_TYPE_UNSPECIFIED = "APPLICATION_TYPE_UNSPECIFIED".freeze - APPLICATION_TYPE_OIDC = "APPLICATION_TYPE_OIDC".freeze - APPLICATION_TYPE_API = "APPLICATION_TYPE_API".freeze - APPLICATION_TYPE_SAML = "APPLICATION_TYPE_SAML".freeze - - def self.all_vars - @all_vars ||= [APPLICATION_TYPE_UNSPECIFIED, APPLICATION_TYPE_OIDC, APPLICATION_TYPE_API, APPLICATION_TYPE_SAML].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceApplicationType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceApplicationType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceApplicationType. + class ApplicationServiceApplicationType + APPLICATION_TYPE_UNSPECIFIED = 'APPLICATION_TYPE_UNSPECIFIED' + APPLICATION_TYPE_OIDC = 'APPLICATION_TYPE_OIDC' + APPLICATION_TYPE_API = 'APPLICATION_TYPE_API' + APPLICATION_TYPE_SAML = 'APPLICATION_TYPE_SAML' + + # Frozen set of all allowed values, used for validation. + VALUES = [APPLICATION_TYPE_UNSPECIFIED, APPLICATION_TYPE_OIDC, APPLICATION_TYPE_API, APPLICATION_TYPE_SAML].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceApplicationType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/application_service_client_i_d_filter.rb b/lib/zitadel/client/models/application_service_client_i_d_filter.rb deleted file mode 100644 index a3a9ba5e..00000000 --- a/lib/zitadel/client/models/application_service_client_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceClientIDFilter - # The clientID to search for. The search is performed as an exact match. - attr_accessor :client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceClientIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceClientIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_client_id_filter.rb b/lib/zitadel/client/models/application_service_client_id_filter.rb new file mode 100644 index 00000000..2b4eaeb4 --- /dev/null +++ b/lib/zitadel/client/models/application_service_client_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceClientIDFilter. + class ApplicationServiceClientIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The clientID to search for. The search is performed as an exact match. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_connect_error.rb b/lib/zitadel/client/models/application_service_connect_error.rb index e4a60a93..3fe7a1cd 100644 --- a/lib/zitadel/client/models/application_service_connect_error.rb +++ b/lib/zitadel/client/models/application_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class ApplicationServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class ApplicationServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_create_a_p_i_application_request.rb b/lib/zitadel/client/models/application_service_create_a_p_i_application_request.rb deleted file mode 100644 index b837b93d..00000000 --- a/lib/zitadel/client/models/application_service_create_a_p_i_application_request.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceCreateAPIApplicationRequest - attr_accessor :auth_method_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_method_type' => :'authMethodType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_method_type' => :'ApplicationServiceAPIAuthMethodType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceCreateAPIApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceCreateAPIApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_method_type == o.auth_method_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_method_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_create_a_p_i_application_response.rb b/lib/zitadel/client/models/application_service_create_a_p_i_application_response.rb deleted file mode 100644 index 33dd9a39..00000000 --- a/lib/zitadel/client/models/application_service_create_a_p_i_application_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceCreateAPIApplicationResponse - # The unique OAuth2 client_id used for authentication of the API, e.g. at the introspection endpoint. - attr_accessor :client_id - - # In case of using the APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC the client_secret is generated and returned. It must be stored safely, as it will not be possible to retrieve it again. A new client_secret can be generated using the GenerateClientSecret endpoint. - attr_accessor :client_secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'client_secret' => :'clientSecret' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'client_secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceCreateAPIApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceCreateAPIApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'client_secret') - self.client_secret = attributes[:'client_secret'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - client_secret == o.client_secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, client_secret].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_create_api_application_request.rb b/lib/zitadel/client/models/application_service_create_api_application_request.rb new file mode 100644 index 00000000..75ad7dab --- /dev/null +++ b/lib/zitadel/client/models/application_service_create_api_application_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceCreateAPIApplicationRequest. + class ApplicationServiceCreateAPIApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_method_type: 'authMethodType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_method_type: 'ApplicationServiceAPIAuthMethodType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_create_api_application_response.rb b/lib/zitadel/client/models/application_service_create_api_application_response.rb new file mode 100644 index 00000000..ac1cafbc --- /dev/null +++ b/lib/zitadel/client/models/application_service_create_api_application_response.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceCreateAPIApplicationResponse. + class ApplicationServiceCreateAPIApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + client_secret: 'clientSecret' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + client_secret: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The unique OAuth2 client_id used for authentication of the API, e.g. at the introspection endpoint. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # In case of using the APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC the client_secret is generated and returned. It must be stored safely, as it will not be possible to retrieve it again. A new client_secret can be generated using the GenerateClientSecret endpoint. + # @example null + attribute :client_secret, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_create_application_key_request.rb b/lib/zitadel/client/models/application_service_create_application_key_request.rb index 4c05bb2a..5cff6442 100644 --- a/lib/zitadel/client/models/application_service_create_application_key_request.rb +++ b/lib/zitadel/client/models/application_service_create_application_key_request.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceCreateApplicationKeyRequest - # The ID of the application the key will be created for. - attr_accessor :application_id - - # The ID of the project the application belongs to. - attr_accessor :project_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId', - :'project_id' => :'projectId', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'project_id' => :'String', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceCreateApplicationKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceCreateApplicationKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - project_id == o.project_id && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, project_id, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceCreateApplicationKeyRequest. + class ApplicationServiceCreateApplicationKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId', + project_id: 'projectId', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String', + project_id: 'String', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The ID of the application the key will be created for. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # The ID of the project the application belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_create_application_key_response.rb b/lib/zitadel/client/models/application_service_create_application_key_response.rb index 3a9a514b..b033fb98 100644 --- a/lib/zitadel/client/models/application_service_create_application_key_response.rb +++ b/lib/zitadel/client/models/application_service_create_application_key_response.rb @@ -1,236 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceCreateApplicationKeyResponse - # The unique ID of the newly created application key. - attr_accessor :key_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # KeyDetails contains the serialized private key and additional information depending on the key type. It must be stored safely, as it will not be possible to retrieve it again. A new key can be generated using the CreateApplicationKey endpoint. - attr_accessor :key_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_id' => :'keyId', - :'creation_date' => :'creationDate', - :'key_details' => :'keyDetails' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_id' => :'String', - :'creation_date' => :'Time', - :'key_details' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceCreateApplicationKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceCreateApplicationKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'key_details') - self.key_details = attributes[:'key_details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_id == o.key_id && - creation_date == o.creation_date && - key_details == o.key_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_id, creation_date, key_details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceCreateApplicationKeyResponse. + class ApplicationServiceCreateApplicationKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_id: 'keyId', + creation_date: 'creationDate', + key_details: 'keyDetails' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_id: 'String', + creation_date: 'Time', + key_details: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + key_details: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the newly created application key. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # KeyDetails contains the serialized private key and additional information depending on the key type. It must be stored safely, as it will not be possible to retrieve it again. A new key can be generated using the CreateApplicationKey endpoint. + # @example null + attribute :key_details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_create_application_request.rb b/lib/zitadel/client/models/application_service_create_application_request.rb index a6604ade..b214a630 100644 --- a/lib/zitadel/client/models/application_service_create_application_request.rb +++ b/lib/zitadel/client/models/application_service_create_application_request.rb @@ -1,263 +1,96 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceCreateApplicationRequest - # The ID of the project the application will be created in. - attr_accessor :project_id - - # Optionally, provide the unique ID of the new application. If omitted, the system will generate one for you, which is the recommended way. The generated ID will be returned in the response. - attr_accessor :application_id - - # Publicly visible name of the application. This might be presented to users if they sign in. - attr_accessor :name - - attr_accessor :api_configuration - - attr_accessor :oidc_configuration - - attr_accessor :saml_configuration - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'application_id' => :'applicationId', - :'name' => :'name', - :'api_configuration' => :'apiConfiguration', - :'oidc_configuration' => :'oidcConfiguration', - :'saml_configuration' => :'samlConfiguration' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'application_id' => :'String', - :'name' => :'String', - :'api_configuration' => :'ApplicationServiceCreateAPIApplicationRequest', - :'oidc_configuration' => :'ApplicationServiceCreateOIDCApplicationRequest', - :'saml_configuration' => :'ApplicationServiceCreateSAMLApplicationRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceCreateApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceCreateApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'api_configuration') - self.api_configuration = attributes[:'api_configuration'] - end - - if attributes.key?(:'oidc_configuration') - self.oidc_configuration = attributes[:'oidc_configuration'] - end - - if attributes.key?(:'saml_configuration') - self.saml_configuration = attributes[:'saml_configuration'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - application_id == o.application_id && - name == o.name && - api_configuration == o.api_configuration && - oidc_configuration == o.oidc_configuration && - saml_configuration == o.saml_configuration - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, application_id, name, api_configuration, oidc_configuration, saml_configuration].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceCreateApplicationRequest. + class ApplicationServiceCreateApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + application_id: 'applicationId', + name: 'name', + api_configuration: 'apiConfiguration', + oidc_configuration: 'oidcConfiguration', + saml_configuration: 'samlConfiguration' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + application_id: 'String', + name: 'String', + api_configuration: 'ApplicationServiceCreateAPIApplicationRequest', + oidc_configuration: 'ApplicationServiceCreateOIDCApplicationRequest', + saml_configuration: 'ApplicationServiceCreateSAMLApplicationRequest' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The ID of the project the application will be created in. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Optionally, provide the unique ID of the new application. If omitted, the system will generate one for you, which is the recommended way. The generated ID will be returned in the response. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # Publicly visible name of the application. This might be presented to users if they sign in. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :api_configuration, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_configuration, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml_configuration, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_create_application_response.rb b/lib/zitadel/client/models/application_service_create_application_response.rb index 8d53eb45..628f62b3 100644 --- a/lib/zitadel/client/models/application_service_create_application_response.rb +++ b/lib/zitadel/client/models/application_service_create_application_response.rb @@ -1,253 +1,91 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceCreateApplicationResponse - # The unique ID of the newly created application. - attr_accessor :application_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :api_configuration - - attr_accessor :oidc_configuration - - attr_accessor :saml_configuration - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId', - :'creation_date' => :'creationDate', - :'api_configuration' => :'apiConfiguration', - :'oidc_configuration' => :'oidcConfiguration', - :'saml_configuration' => :'samlConfiguration' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'creation_date' => :'Time', - :'api_configuration' => :'ApplicationServiceCreateAPIApplicationResponse', - :'oidc_configuration' => :'ApplicationServiceCreateOIDCApplicationResponse', - :'saml_configuration' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceCreateApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceCreateApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'api_configuration') - self.api_configuration = attributes[:'api_configuration'] - end - - if attributes.key?(:'oidc_configuration') - self.oidc_configuration = attributes[:'oidc_configuration'] - end - - if attributes.key?(:'saml_configuration') - self.saml_configuration = attributes[:'saml_configuration'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - creation_date == o.creation_date && - api_configuration == o.api_configuration && - oidc_configuration == o.oidc_configuration && - saml_configuration == o.saml_configuration - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, creation_date, api_configuration, oidc_configuration, saml_configuration].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceCreateApplicationResponse. + class ApplicationServiceCreateApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId', + creation_date: 'creationDate', + api_configuration: 'apiConfiguration', + oidc_configuration: 'oidcConfiguration', + saml_configuration: 'samlConfiguration' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String', + creation_date: 'Time', + api_configuration: 'ApplicationServiceCreateAPIApplicationResponse', + oidc_configuration: 'ApplicationServiceCreateOIDCApplicationResponse', + saml_configuration: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the newly created application. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :api_configuration, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_configuration, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml_configuration, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_create_o_i_d_c_application_request.rb b/lib/zitadel/client/models/application_service_create_o_i_d_c_application_request.rb deleted file mode 100644 index 3ac1c526..00000000 --- a/lib/zitadel/client/models/application_service_create_o_i_d_c_application_request.rb +++ /dev/null @@ -1,403 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceCreateOIDCApplicationRequest - # RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs. - attr_accessor :redirect_uris - - # ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values. - attr_accessor :response_types - - # GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. Minimum one grant type must be provided, but multiple grant types can be provided to allow different flows, e.g. authorization code flow and refresh token flow. - attr_accessor :grant_types - - attr_accessor :application_type - - attr_accessor :auth_method_type - - # PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs. - attr_accessor :post_logout_redirect_uris - - attr_accessor :version - - # DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs. - attr_accessor :development_mode - - attr_accessor :access_token_type - - # If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project. - attr_accessor :access_token_role_assertion - - # If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project. - attr_accessor :id_token_role_assertion - - # If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable. - attr_accessor :id_token_userinfo_assertion - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :clock_skew - - # AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin. - attr_accessor :additional_origins - - # For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly. - attr_accessor :skip_native_app_success_page - - # BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html). - attr_accessor :back_channel_logout_uri - - attr_accessor :login_version - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'redirect_uris' => :'redirectUris', - :'response_types' => :'responseTypes', - :'grant_types' => :'grantTypes', - :'application_type' => :'applicationType', - :'auth_method_type' => :'authMethodType', - :'post_logout_redirect_uris' => :'postLogoutRedirectUris', - :'version' => :'version', - :'development_mode' => :'developmentMode', - :'access_token_type' => :'accessTokenType', - :'access_token_role_assertion' => :'accessTokenRoleAssertion', - :'id_token_role_assertion' => :'idTokenRoleAssertion', - :'id_token_userinfo_assertion' => :'idTokenUserinfoAssertion', - :'clock_skew' => :'clockSkew', - :'additional_origins' => :'additionalOrigins', - :'skip_native_app_success_page' => :'skipNativeAppSuccessPage', - :'back_channel_logout_uri' => :'backChannelLogoutUri', - :'login_version' => :'loginVersion' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'redirect_uris' => :'Array', - :'response_types' => :'Array', - :'grant_types' => :'Array', - :'application_type' => :'ApplicationServiceOIDCApplicationType', - :'auth_method_type' => :'ApplicationServiceOIDCAuthMethodType', - :'post_logout_redirect_uris' => :'Array', - :'version' => :'ApplicationServiceOIDCVersion', - :'development_mode' => :'Boolean', - :'access_token_type' => :'ApplicationServiceOIDCTokenType', - :'access_token_role_assertion' => :'Boolean', - :'id_token_role_assertion' => :'Boolean', - :'id_token_userinfo_assertion' => :'Boolean', - :'clock_skew' => :'String', - :'additional_origins' => :'Array', - :'skip_native_app_success_page' => :'Boolean', - :'back_channel_logout_uri' => :'String', - :'login_version' => :'ApplicationServiceLoginVersion' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceCreateOIDCApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceCreateOIDCApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'redirect_uris') - if (value = attributes[:'redirect_uris']).is_a?(Array) - self.redirect_uris = value - end - end - - if attributes.key?(:'response_types') - if (value = attributes[:'response_types']).is_a?(Array) - self.response_types = value - end - end - - if attributes.key?(:'grant_types') - if (value = attributes[:'grant_types']).is_a?(Array) - self.grant_types = value - end - end - - if attributes.key?(:'application_type') - self.application_type = attributes[:'application_type'] - end - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - - if attributes.key?(:'post_logout_redirect_uris') - if (value = attributes[:'post_logout_redirect_uris']).is_a?(Array) - self.post_logout_redirect_uris = value - end - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'development_mode') - self.development_mode = attributes[:'development_mode'] - end - - if attributes.key?(:'access_token_type') - self.access_token_type = attributes[:'access_token_type'] - end - - if attributes.key?(:'access_token_role_assertion') - self.access_token_role_assertion = attributes[:'access_token_role_assertion'] - end - - if attributes.key?(:'id_token_role_assertion') - self.id_token_role_assertion = attributes[:'id_token_role_assertion'] - end - - if attributes.key?(:'id_token_userinfo_assertion') - self.id_token_userinfo_assertion = attributes[:'id_token_userinfo_assertion'] - end - - if attributes.key?(:'clock_skew') - self.clock_skew = attributes[:'clock_skew'] - end - - if attributes.key?(:'additional_origins') - if (value = attributes[:'additional_origins']).is_a?(Array) - self.additional_origins = value - end - end - - if attributes.key?(:'skip_native_app_success_page') - self.skip_native_app_success_page = attributes[:'skip_native_app_success_page'] - end - - if attributes.key?(:'back_channel_logout_uri') - self.back_channel_logout_uri = attributes[:'back_channel_logout_uri'] - end - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - redirect_uris == o.redirect_uris && - response_types == o.response_types && - grant_types == o.grant_types && - application_type == o.application_type && - auth_method_type == o.auth_method_type && - post_logout_redirect_uris == o.post_logout_redirect_uris && - version == o.version && - development_mode == o.development_mode && - access_token_type == o.access_token_type && - access_token_role_assertion == o.access_token_role_assertion && - id_token_role_assertion == o.id_token_role_assertion && - id_token_userinfo_assertion == o.id_token_userinfo_assertion && - clock_skew == o.clock_skew && - additional_origins == o.additional_origins && - skip_native_app_success_page == o.skip_native_app_success_page && - back_channel_logout_uri == o.back_channel_logout_uri && - login_version == o.login_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [redirect_uris, response_types, grant_types, application_type, auth_method_type, post_logout_redirect_uris, version, development_mode, access_token_type, access_token_role_assertion, id_token_role_assertion, id_token_userinfo_assertion, clock_skew, additional_origins, skip_native_app_success_page, back_channel_logout_uri, login_version].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_create_o_i_d_c_application_response.rb b/lib/zitadel/client/models/application_service_create_o_i_d_c_application_response.rb deleted file mode 100644 index 110d91e0..00000000 --- a/lib/zitadel/client/models/application_service_create_o_i_d_c_application_response.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceCreateOIDCApplicationResponse - # The unique OAuth2/OIDC client_id used for authentication of the application, e.g. at the token endpoint. - attr_accessor :client_id - - # In case of using the OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_CLIENT_SECRET_BASIC or OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_CLIENT_SECRET_POST the client_secret is generated and returned. It must be stored safely, as it will not be possible to retrieve it again. A new client_secret can be generated using the GenerateClientSecret endpoint. - attr_accessor :client_secret - - # NonCompliant specifies whether the config is OIDC compliant. A production configuration SHOULD be compliant. Non-compliant configurations can run into interoperability issues with OIDC libraries and tools. Compliance problems are listed in the compliance_problems field. - attr_accessor :non_compliant - - # ComplianceProblems lists the problems for non-compliant configurations. In case of a compliant configuration, this list is empty. - attr_accessor :compliance_problems - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'client_secret' => :'clientSecret', - :'non_compliant' => :'nonCompliant', - :'compliance_problems' => :'complianceProblems' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'client_secret' => :'String', - :'non_compliant' => :'Boolean', - :'compliance_problems' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceCreateOIDCApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceCreateOIDCApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'client_secret') - self.client_secret = attributes[:'client_secret'] - end - - if attributes.key?(:'non_compliant') - self.non_compliant = attributes[:'non_compliant'] - end - - if attributes.key?(:'compliance_problems') - if (value = attributes[:'compliance_problems']).is_a?(Array) - self.compliance_problems = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - client_secret == o.client_secret && - non_compliant == o.non_compliant && - compliance_problems == o.compliance_problems - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, client_secret, non_compliant, compliance_problems].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_create_oidc_application_request.rb b/lib/zitadel/client/models/application_service_create_oidc_application_request.rb new file mode 100644 index 00000000..52d6c745 --- /dev/null +++ b/lib/zitadel/client/models/application_service_create_oidc_application_request.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceCreateOIDCApplicationRequest. + class ApplicationServiceCreateOIDCApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + redirect_uris: 'redirectUris', + response_types: 'responseTypes', + grant_types: 'grantTypes', + application_type: 'applicationType', + auth_method_type: 'authMethodType', + post_logout_redirect_uris: 'postLogoutRedirectUris', + version: 'version', + development_mode: 'developmentMode', + access_token_type: 'accessTokenType', + access_token_role_assertion: 'accessTokenRoleAssertion', + id_token_role_assertion: 'idTokenRoleAssertion', + id_token_userinfo_assertion: 'idTokenUserinfoAssertion', + clock_skew: 'clockSkew', + additional_origins: 'additionalOrigins', + skip_native_app_success_page: 'skipNativeAppSuccessPage', + back_channel_logout_uri: 'backChannelLogoutUri', + login_version: 'loginVersion' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + redirect_uris: 'Array', + response_types: 'Array', + grant_types: 'Array', + application_type: 'ApplicationServiceOIDCApplicationType', + auth_method_type: 'ApplicationServiceOIDCAuthMethodType', + post_logout_redirect_uris: 'Array', + version: 'ApplicationServiceOIDCVersion', + development_mode: 'Boolean', + access_token_type: 'ApplicationServiceOIDCTokenType', + access_token_role_assertion: 'Boolean', + id_token_role_assertion: 'Boolean', + id_token_userinfo_assertion: 'Boolean', + clock_skew: 'ISO8601::Duration', + additional_origins: 'Array', + skip_native_app_success_page: 'Boolean', + back_channel_logout_uri: 'String', + login_version: 'ApplicationServiceLoginVersion' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs. + # @example null + attribute :redirect_uris, Types::Any.optional.meta(omittable: true) + # ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values. + # @example null + attribute :response_types, Types::Any.optional.meta(omittable: true) + # GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. Minimum one grant type must be provided, but multiple grant types can be provided to allow different flows, e.g. authorization code flow and refresh token flow. + # @example null + attribute :grant_types, Types::Any.optional.meta(omittable: true) + # @example null + attribute :application_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + # PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs. + # @example null + attribute :post_logout_redirect_uris, Types::Any.optional.meta(omittable: true) + # @example null + attribute :version, Types::Any.optional.meta(omittable: true) + # DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs. + # @example null + attribute :development_mode, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_type, Types::Any.optional.meta(omittable: true) + # If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project. + # @example null + attribute :access_token_role_assertion, Types::Any.optional.meta(omittable: true) + # If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project. + # @example null + attribute :id_token_role_assertion, Types::Any.optional.meta(omittable: true) + # If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable. + # @example null + attribute :id_token_userinfo_assertion, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :clock_skew, Types::Any.optional.meta(omittable: true) + # AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin. + # @example null + attribute :additional_origins, Types::Any.optional.meta(omittable: true) + # For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly. + # @example null + attribute :skip_native_app_success_page, Types::Any.optional.meta(omittable: true) + # BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html). + # @example null + attribute :back_channel_logout_uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_create_oidc_application_response.rb b/lib/zitadel/client/models/application_service_create_oidc_application_response.rb new file mode 100644 index 00000000..12e3506a --- /dev/null +++ b/lib/zitadel/client/models/application_service_create_oidc_application_response.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceCreateOIDCApplicationResponse. + class ApplicationServiceCreateOIDCApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + client_secret: 'clientSecret', + non_compliant: 'nonCompliant', + compliance_problems: 'complianceProblems' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + client_secret: 'String', + non_compliant: 'Boolean', + compliance_problems: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The unique OAuth2/OIDC client_id used for authentication of the application, e.g. at the token endpoint. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # In case of using the OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_CLIENT_SECRET_BASIC or OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_CLIENT_SECRET_POST the client_secret is generated and returned. It must be stored safely, as it will not be possible to retrieve it again. A new client_secret can be generated using the GenerateClientSecret endpoint. + # @example null + attribute :client_secret, Types::Any.optional.meta(omittable: true) + # NonCompliant specifies whether the config is OIDC compliant. A production configuration SHOULD be compliant. Non-compliant configurations can run into interoperability issues with OIDC libraries and tools. Compliance problems are listed in the compliance_problems field. + # @example null + attribute :non_compliant, Types::Any.optional.meta(omittable: true) + # ComplianceProblems lists the problems for non-compliant configurations. In case of a compliant configuration, this list is empty. + # @example null + attribute :compliance_problems, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_create_s_a_m_l_application_request.rb b/lib/zitadel/client/models/application_service_create_s_a_m_l_application_request.rb deleted file mode 100644 index 0ed25454..00000000 --- a/lib/zitadel/client/models/application_service_create_s_a_m_l_application_request.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceCreateSAMLApplicationRequest - attr_accessor :login_version - - attr_accessor :metadata_url - - attr_accessor :metadata_xml - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_version' => :'loginVersion', - :'metadata_url' => :'metadataUrl', - :'metadata_xml' => :'metadataXml' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_version' => :'ApplicationServiceLoginVersion', - :'metadata_url' => :'String', - :'metadata_xml' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceCreateSAMLApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceCreateSAMLApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - - if attributes.key?(:'metadata_url') - self.metadata_url = attributes[:'metadata_url'] - end - - if attributes.key?(:'metadata_xml') - self.metadata_xml = attributes[:'metadata_xml'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_version == o.login_version && - metadata_url == o.metadata_url && - metadata_xml == o.metadata_xml - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_version, metadata_url, metadata_xml].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_create_saml_application_request.rb b/lib/zitadel/client/models/application_service_create_saml_application_request.rb new file mode 100644 index 00000000..6119b9d4 --- /dev/null +++ b/lib/zitadel/client/models/application_service_create_saml_application_request.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceCreateSAMLApplicationRequest. + class ApplicationServiceCreateSAMLApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_version: 'loginVersion', + metadata_url: 'metadataUrl', + metadata_xml: 'metadataXml' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_version: 'ApplicationServiceLoginVersion', + metadata_url: 'String', + metadata_xml: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + metadata_xml: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_xml, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_deactivate_application_request.rb b/lib/zitadel/client/models/application_service_deactivate_application_request.rb index f19fde8d..78efb05b 100644 --- a/lib/zitadel/client/models/application_service_deactivate_application_request.rb +++ b/lib/zitadel/client/models/application_service_deactivate_application_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceDeactivateApplicationRequest - # The unique ID of the application to be deactivated. - attr_accessor :application_id - - # The ID of the project the application belongs to. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceDeactivateApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceDeactivateApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceDeactivateApplicationRequest. + class ApplicationServiceDeactivateApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the application to be deactivated. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # The ID of the project the application belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_deactivate_application_response.rb b/lib/zitadel/client/models/application_service_deactivate_application_response.rb index 9c6cfd49..9fbc5ad4 100644 --- a/lib/zitadel/client/models/application_service_deactivate_application_response.rb +++ b/lib/zitadel/client/models/application_service_deactivate_application_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceDeactivateApplicationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deactivation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deactivation_date' => :'deactivationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deactivation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceDeactivateApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceDeactivateApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deactivation_date') - self.deactivation_date = attributes[:'deactivation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deactivation_date == o.deactivation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deactivation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceDeactivateApplicationResponse. + class ApplicationServiceDeactivateApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deactivation_date: 'deactivationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deactivation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deactivation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_delete_application_key_request.rb b/lib/zitadel/client/models/application_service_delete_application_key_request.rb index d3dc60f6..81937698 100644 --- a/lib/zitadel/client/models/application_service_delete_application_key_request.rb +++ b/lib/zitadel/client/models/application_service_delete_application_key_request.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceDeleteApplicationKeyRequest - # The unique ID of the application key to be deleted. - attr_accessor :key_id - - # The ID of the application the key belongs to. - attr_accessor :application_id - - # The ID of the project the application belongs to. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_id' => :'keyId', - :'application_id' => :'applicationId', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_id' => :'String', - :'application_id' => :'String', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceDeleteApplicationKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceDeleteApplicationKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_id == o.key_id && - application_id == o.application_id && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_id, application_id, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceDeleteApplicationKeyRequest. + class ApplicationServiceDeleteApplicationKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_id: 'keyId', + application_id: 'applicationId', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_id: 'String', + application_id: 'String', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the application key to be deleted. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) + # The ID of the application the key belongs to. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # The ID of the project the application belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_delete_application_key_response.rb b/lib/zitadel/client/models/application_service_delete_application_key_response.rb index 05e8f161..d0640a8b 100644 --- a/lib/zitadel/client/models/application_service_delete_application_key_response.rb +++ b/lib/zitadel/client/models/application_service_delete_application_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceDeleteApplicationKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceDeleteApplicationKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceDeleteApplicationKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceDeleteApplicationKeyResponse. + class ApplicationServiceDeleteApplicationKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_delete_application_request.rb b/lib/zitadel/client/models/application_service_delete_application_request.rb index c92e510e..262db5bb 100644 --- a/lib/zitadel/client/models/application_service_delete_application_request.rb +++ b/lib/zitadel/client/models/application_service_delete_application_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceDeleteApplicationRequest - # The unique ID of the application to be deleted. - attr_accessor :application_id - - # The ID of the project the application belongs to. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceDeleteApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceDeleteApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceDeleteApplicationRequest. + class ApplicationServiceDeleteApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the application to be deleted. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # The ID of the project the application belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_delete_application_response.rb b/lib/zitadel/client/models/application_service_delete_application_response.rb index bda3d57e..d265d90b 100644 --- a/lib/zitadel/client/models/application_service_delete_application_response.rb +++ b/lib/zitadel/client/models/application_service_delete_application_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceDeleteApplicationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceDeleteApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceDeleteApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceDeleteApplicationResponse. + class ApplicationServiceDeleteApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_entity_i_d_filter.rb b/lib/zitadel/client/models/application_service_entity_i_d_filter.rb deleted file mode 100644 index 2074566b..00000000 --- a/lib/zitadel/client/models/application_service_entity_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceEntityIDFilter - # The entityID to search for. The search is performed as an exact match. - attr_accessor :entity_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_id' => :'entityId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceEntityIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceEntityIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_id') - self.entity_id = attributes[:'entity_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_id == o.entity_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_entity_id_filter.rb b/lib/zitadel/client/models/application_service_entity_id_filter.rb new file mode 100644 index 00000000..5c88ff2a --- /dev/null +++ b/lib/zitadel/client/models/application_service_entity_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceEntityIDFilter. + class ApplicationServiceEntityIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + entity_id: 'entityId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + entity_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The entityID to search for. The search is performed as an exact match. + # @example null + attribute :entity_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_generate_client_secret_request.rb b/lib/zitadel/client/models/application_service_generate_client_secret_request.rb index 2df8d5ee..1edfba1d 100644 --- a/lib/zitadel/client/models/application_service_generate_client_secret_request.rb +++ b/lib/zitadel/client/models/application_service_generate_client_secret_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceGenerateClientSecretRequest - # The unique ID of the application to generate a new client secret for. - attr_accessor :application_id - - # The ID of the project the application belongs to. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceGenerateClientSecretRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceGenerateClientSecretRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceGenerateClientSecretRequest. + class ApplicationServiceGenerateClientSecretRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the application to generate a new client secret for. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # The ID of the project the application belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_generate_client_secret_response.rb b/lib/zitadel/client/models/application_service_generate_client_secret_response.rb index 18748067..be7d91a9 100644 --- a/lib/zitadel/client/models/application_service_generate_client_secret_response.rb +++ b/lib/zitadel/client/models/application_service_generate_client_secret_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceGenerateClientSecretResponse - # The newly generated client secret. It must be stored safely, as it will not be possible to retrieve it again. A new client secret can be generated using this endpoint. - attr_accessor :client_secret - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_secret' => :'clientSecret', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_secret' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceGenerateClientSecretResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceGenerateClientSecretResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_secret') - self.client_secret = attributes[:'client_secret'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_secret == o.client_secret && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_secret, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceGenerateClientSecretResponse. + class ApplicationServiceGenerateClientSecretResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_secret: 'clientSecret', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_secret: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The newly generated client secret. It must be stored safely, as it will not be possible to retrieve it again. A new client secret can be generated using this endpoint. + # @example null + attribute :client_secret, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_get_application_key_request.rb b/lib/zitadel/client/models/application_service_get_application_key_request.rb index 294418c6..5a2cda7f 100644 --- a/lib/zitadel/client/models/application_service_get_application_key_request.rb +++ b/lib/zitadel/client/models/application_service_get_application_key_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceGetApplicationKeyRequest - # The unique ID of the application key to be retrieved. - attr_accessor :key_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_id' => :'keyId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceGetApplicationKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceGetApplicationKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_id == o.key_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceGetApplicationKeyRequest. + class ApplicationServiceGetApplicationKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_id: 'keyId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the application key to be retrieved. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_get_application_key_response.rb b/lib/zitadel/client/models/application_service_get_application_key_response.rb index a717816d..c77b1a31 100644 --- a/lib/zitadel/client/models/application_service_get_application_key_response.rb +++ b/lib/zitadel/client/models/application_service_get_application_key_response.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceGetApplicationKeyResponse - # Unique ID of the application key. - attr_accessor :key_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_id' => :'keyId', - :'creation_date' => :'creationDate', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_id' => :'String', - :'creation_date' => :'Time', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceGetApplicationKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceGetApplicationKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_id == o.key_id && - creation_date == o.creation_date && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_id, creation_date, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceGetApplicationKeyResponse. + class ApplicationServiceGetApplicationKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_id: 'keyId', + creation_date: 'creationDate', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_id: 'String', + creation_date: 'Time', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Unique ID of the application key. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_get_application_request.rb b/lib/zitadel/client/models/application_service_get_application_request.rb index b98e8a2f..7dfe256d 100644 --- a/lib/zitadel/client/models/application_service_get_application_request.rb +++ b/lib/zitadel/client/models/application_service_get_application_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceGetApplicationRequest - # The unique ID of the application to be retrieved. - attr_accessor :application_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceGetApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceGetApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceGetApplicationRequest. + class ApplicationServiceGetApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the application to be retrieved. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_get_application_response.rb b/lib/zitadel/client/models/application_service_get_application_response.rb index 651da6fc..50835600 100644 --- a/lib/zitadel/client/models/application_service_get_application_response.rb +++ b/lib/zitadel/client/models/application_service_get_application_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceGetApplicationResponse - attr_accessor :application - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application' => :'application' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application' => :'ApplicationServiceApplication' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceGetApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceGetApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application') - self.application = attributes[:'application'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application == o.application - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceGetApplicationResponse. + class ApplicationServiceGetApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application: 'application' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application: 'ApplicationServiceApplication' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :application, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_list_application_keys_request.rb b/lib/zitadel/client/models/application_service_list_application_keys_request.rb index ab3b866d..7e9d5b50 100644 --- a/lib/zitadel/client/models/application_service_list_application_keys_request.rb +++ b/lib/zitadel/client/models/application_service_list_application_keys_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceListApplicationKeysRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Criteria to filter the application keys. All provided filters are combined with a logical AND. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ApplicationServicePaginationRequest', - :'sorting_column' => :'ApplicationServiceApplicationKeysSorting', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceListApplicationKeysRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceListApplicationKeysRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceListApplicationKeysRequest. + class ApplicationServiceListApplicationKeysRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ApplicationServicePaginationRequest', + sorting_column: 'ApplicationServiceApplicationKeysSorting', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Criteria to filter the application keys. All provided filters are combined with a logical AND. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_list_application_keys_response.rb b/lib/zitadel/client/models/application_service_list_application_keys_response.rb index 750744cb..491d72f6 100644 --- a/lib/zitadel/client/models/application_service_list_application_keys_response.rb +++ b/lib/zitadel/client/models/application_service_list_application_keys_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceListApplicationKeysResponse - # The list of application keys matching the query. Depending on the applied limit, there might be more keys available than returned in this list. Use the returned pagination information to request further keys. - attr_accessor :keys - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'keys' => :'keys', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'keys' => :'Array', - :'pagination' => :'ApplicationServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceListApplicationKeysResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceListApplicationKeysResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'keys') - if (value = attributes[:'keys']).is_a?(Array) - self.keys = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - keys == o.keys && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [keys, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceListApplicationKeysResponse. + class ApplicationServiceListApplicationKeysResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + keys: 'keys', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + keys: 'Array', + pagination: 'ApplicationServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The list of application keys matching the query. Depending on the applied limit, there might be more keys available than returned in this list. Use the returned pagination information to request further keys. + # @example null + attribute :keys, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_list_applications_request.rb b/lib/zitadel/client/models/application_service_list_applications_request.rb index c30b5d26..ad2815d7 100644 --- a/lib/zitadel/client/models/application_service_list_applications_request.rb +++ b/lib/zitadel/client/models/application_service_list_applications_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceListApplicationsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Criteria to filter the applications. All provided filters are combined with a logical AND. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ApplicationServicePaginationRequest', - :'sorting_column' => :'ApplicationServiceApplicationSorting', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceListApplicationsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceListApplicationsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceListApplicationsRequest. + class ApplicationServiceListApplicationsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ApplicationServicePaginationRequest', + sorting_column: 'ApplicationServiceApplicationSorting', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Criteria to filter the applications. All provided filters are combined with a logical AND. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_list_applications_response.rb b/lib/zitadel/client/models/application_service_list_applications_response.rb index 8815ee8c..c603d8dc 100644 --- a/lib/zitadel/client/models/application_service_list_applications_response.rb +++ b/lib/zitadel/client/models/application_service_list_applications_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceListApplicationsResponse - # The list of applications matching the query. Depending on the applied limit, there might be more applications available than included in this list. Use the returned pagination information to request further applications. - attr_accessor :applications - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'applications' => :'applications', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'applications' => :'Array', - :'pagination' => :'ApplicationServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceListApplicationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceListApplicationsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'applications') - if (value = attributes[:'applications']).is_a?(Array) - self.applications = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - applications == o.applications && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [applications, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceListApplicationsResponse. + class ApplicationServiceListApplicationsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + applications: 'applications', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + applications: 'Array', + pagination: 'ApplicationServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The list of applications matching the query. Depending on the applied limit, there might be more applications available than included in this list. Use the returned pagination information to request further applications. + # @example null + attribute :applications, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_login_v2.rb b/lib/zitadel/client/models/application_service_login_v2.rb index c91b4b18..de2d625f 100644 --- a/lib/zitadel/client/models/application_service_login_v2.rb +++ b/lib/zitadel/client/models/application_service_login_v2.rb @@ -1,217 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceLoginV2 - # Optionally specify a base uri of the login UI. If unspecified the default URI will be used. - attr_accessor :base_uri - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'base_uri' => :'baseUri' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'base_uri' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'base_uri' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceLoginV2` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceLoginV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'base_uri') - self.base_uri = attributes[:'base_uri'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - base_uri == o.base_uri - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [base_uri].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceLoginV2. + class ApplicationServiceLoginV2 < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + base_uri: 'baseUri' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + base_uri: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Optionally specify a base uri of the login UI. If unspecified the default URI will be used. + # @example null + attribute :base_uri, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_login_version.rb b/lib/zitadel/client/models/application_service_login_version.rb index efbaac13..d233fe65 100644 --- a/lib/zitadel/client/models/application_service_login_version.rb +++ b/lib/zitadel/client/models/application_service_login_version.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceLoginVersion - attr_accessor :login_v1 - - attr_accessor :login_v2 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_v1' => :'loginV1', - :'login_v2' => :'loginV2' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_v1' => :'Object', - :'login_v2' => :'ApplicationServiceLoginV2' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceLoginVersion` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceLoginVersion`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_v1') - self.login_v1 = attributes[:'login_v1'] - end - - if attributes.key?(:'login_v2') - self.login_v2 = attributes[:'login_v2'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_v1 == o.login_v1 && - login_v2 == o.login_v2 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_v1, login_v2].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceLoginVersion. + class ApplicationServiceLoginVersion < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_v1: 'loginV1', + login_v2: 'loginV2' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_v1: 'Object', + login_v2: 'ApplicationServiceLoginV2' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_v1, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_v2, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_o_i_d_c_application_type.rb b/lib/zitadel/client/models/application_service_o_i_d_c_application_type.rb deleted file mode 100644 index 13917e57..00000000 --- a/lib/zitadel/client/models/application_service_o_i_d_c_application_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceOIDCApplicationType - OIDC_APP_TYPE_WEB = "OIDC_APP_TYPE_WEB".freeze - OIDC_APP_TYPE_USER_AGENT = "OIDC_APP_TYPE_USER_AGENT".freeze - OIDC_APP_TYPE_NATIVE = "OIDC_APP_TYPE_NATIVE".freeze - - def self.all_vars - @all_vars ||= [OIDC_APP_TYPE_WEB, OIDC_APP_TYPE_USER_AGENT, OIDC_APP_TYPE_NATIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceOIDCApplicationType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceOIDCApplicationType" - end - end - -end diff --git a/lib/zitadel/client/models/application_service_o_i_d_c_auth_method_type.rb b/lib/zitadel/client/models/application_service_o_i_d_c_auth_method_type.rb deleted file mode 100644 index dca10182..00000000 --- a/lib/zitadel/client/models/application_service_o_i_d_c_auth_method_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceOIDCAuthMethodType - OIDC_AUTH_METHOD_TYPE_BASIC = "OIDC_AUTH_METHOD_TYPE_BASIC".freeze - OIDC_AUTH_METHOD_TYPE_POST = "OIDC_AUTH_METHOD_TYPE_POST".freeze - OIDC_AUTH_METHOD_TYPE_NONE = "OIDC_AUTH_METHOD_TYPE_NONE".freeze - OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = "OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT".freeze - - def self.all_vars - @all_vars ||= [OIDC_AUTH_METHOD_TYPE_BASIC, OIDC_AUTH_METHOD_TYPE_POST, OIDC_AUTH_METHOD_TYPE_NONE, OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceOIDCAuthMethodType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceOIDCAuthMethodType" - end - end - -end diff --git a/lib/zitadel/client/models/application_service_o_i_d_c_configuration.rb b/lib/zitadel/client/models/application_service_o_i_d_c_configuration.rb deleted file mode 100644 index 4bb3cc39..00000000 --- a/lib/zitadel/client/models/application_service_o_i_d_c_configuration.rb +++ /dev/null @@ -1,447 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceOIDCConfiguration - # RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs. - attr_accessor :redirect_uris - - # ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values. - attr_accessor :response_types - - # GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. - attr_accessor :grant_types - - attr_accessor :application_type - - # The unique OAuth2/OIDC client_id used for authentication of the application, e.g. at the token endpoint. - attr_accessor :client_id - - attr_accessor :auth_method_type - - # PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs. - attr_accessor :post_logout_redirect_uris - - attr_accessor :version - - # NonCompliant specifies whether the config is OIDC compliant. A production configuration SHOULD be compliant. Non-compliant configurations can run into interoperability issues with OIDC libraries and tools. Compliance problems are listed in the compliance_problems field. - attr_accessor :non_compliant - - # ComplianceProblems lists the problems for non-compliant configurations. In case of a compliant configuration, this list is empty. - attr_accessor :compliance_problems - - # DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs. - attr_accessor :development_mode - - attr_accessor :access_token_type - - # If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project. - attr_accessor :access_token_role_assertion - - # If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project. - attr_accessor :id_token_role_assertion - - # If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable. - attr_accessor :id_token_userinfo_assertion - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :clock_skew - - # AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin. - attr_accessor :additional_origins - - # AllowedOrigins are all HTTP origins where the application is allowed to be used from. This is used to prevent CORS issues in browsers. If the origin of the request is not in this list, the request will be rejected. This is especially important for SPAs. Note that this is a generated list from the redirect_uris and additional_origins. If you use the application from another origin, you have to add it to the additional_origins. - attr_accessor :allowed_origins - - # For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly. - attr_accessor :skip_native_app_success_page - - # BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html). - attr_accessor :back_channel_logout_uri - - attr_accessor :login_version - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'redirect_uris' => :'redirectUris', - :'response_types' => :'responseTypes', - :'grant_types' => :'grantTypes', - :'application_type' => :'applicationType', - :'client_id' => :'clientId', - :'auth_method_type' => :'authMethodType', - :'post_logout_redirect_uris' => :'postLogoutRedirectUris', - :'version' => :'version', - :'non_compliant' => :'nonCompliant', - :'compliance_problems' => :'complianceProblems', - :'development_mode' => :'developmentMode', - :'access_token_type' => :'accessTokenType', - :'access_token_role_assertion' => :'accessTokenRoleAssertion', - :'id_token_role_assertion' => :'idTokenRoleAssertion', - :'id_token_userinfo_assertion' => :'idTokenUserinfoAssertion', - :'clock_skew' => :'clockSkew', - :'additional_origins' => :'additionalOrigins', - :'allowed_origins' => :'allowedOrigins', - :'skip_native_app_success_page' => :'skipNativeAppSuccessPage', - :'back_channel_logout_uri' => :'backChannelLogoutUri', - :'login_version' => :'loginVersion' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'redirect_uris' => :'Array', - :'response_types' => :'Array', - :'grant_types' => :'Array', - :'application_type' => :'ApplicationServiceOIDCApplicationType', - :'client_id' => :'String', - :'auth_method_type' => :'ApplicationServiceOIDCAuthMethodType', - :'post_logout_redirect_uris' => :'Array', - :'version' => :'ApplicationServiceOIDCVersion', - :'non_compliant' => :'Boolean', - :'compliance_problems' => :'Array', - :'development_mode' => :'Boolean', - :'access_token_type' => :'ApplicationServiceOIDCTokenType', - :'access_token_role_assertion' => :'Boolean', - :'id_token_role_assertion' => :'Boolean', - :'id_token_userinfo_assertion' => :'Boolean', - :'clock_skew' => :'String', - :'additional_origins' => :'Array', - :'allowed_origins' => :'Array', - :'skip_native_app_success_page' => :'Boolean', - :'back_channel_logout_uri' => :'String', - :'login_version' => :'ApplicationServiceLoginVersion' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceOIDCConfiguration` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceOIDCConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'redirect_uris') - if (value = attributes[:'redirect_uris']).is_a?(Array) - self.redirect_uris = value - end - end - - if attributes.key?(:'response_types') - if (value = attributes[:'response_types']).is_a?(Array) - self.response_types = value - end - end - - if attributes.key?(:'grant_types') - if (value = attributes[:'grant_types']).is_a?(Array) - self.grant_types = value - end - end - - if attributes.key?(:'application_type') - self.application_type = attributes[:'application_type'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - - if attributes.key?(:'post_logout_redirect_uris') - if (value = attributes[:'post_logout_redirect_uris']).is_a?(Array) - self.post_logout_redirect_uris = value - end - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'non_compliant') - self.non_compliant = attributes[:'non_compliant'] - end - - if attributes.key?(:'compliance_problems') - if (value = attributes[:'compliance_problems']).is_a?(Array) - self.compliance_problems = value - end - end - - if attributes.key?(:'development_mode') - self.development_mode = attributes[:'development_mode'] - end - - if attributes.key?(:'access_token_type') - self.access_token_type = attributes[:'access_token_type'] - end - - if attributes.key?(:'access_token_role_assertion') - self.access_token_role_assertion = attributes[:'access_token_role_assertion'] - end - - if attributes.key?(:'id_token_role_assertion') - self.id_token_role_assertion = attributes[:'id_token_role_assertion'] - end - - if attributes.key?(:'id_token_userinfo_assertion') - self.id_token_userinfo_assertion = attributes[:'id_token_userinfo_assertion'] - end - - if attributes.key?(:'clock_skew') - self.clock_skew = attributes[:'clock_skew'] - end - - if attributes.key?(:'additional_origins') - if (value = attributes[:'additional_origins']).is_a?(Array) - self.additional_origins = value - end - end - - if attributes.key?(:'allowed_origins') - if (value = attributes[:'allowed_origins']).is_a?(Array) - self.allowed_origins = value - end - end - - if attributes.key?(:'skip_native_app_success_page') - self.skip_native_app_success_page = attributes[:'skip_native_app_success_page'] - end - - if attributes.key?(:'back_channel_logout_uri') - self.back_channel_logout_uri = attributes[:'back_channel_logout_uri'] - end - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - redirect_uris == o.redirect_uris && - response_types == o.response_types && - grant_types == o.grant_types && - application_type == o.application_type && - client_id == o.client_id && - auth_method_type == o.auth_method_type && - post_logout_redirect_uris == o.post_logout_redirect_uris && - version == o.version && - non_compliant == o.non_compliant && - compliance_problems == o.compliance_problems && - development_mode == o.development_mode && - access_token_type == o.access_token_type && - access_token_role_assertion == o.access_token_role_assertion && - id_token_role_assertion == o.id_token_role_assertion && - id_token_userinfo_assertion == o.id_token_userinfo_assertion && - clock_skew == o.clock_skew && - additional_origins == o.additional_origins && - allowed_origins == o.allowed_origins && - skip_native_app_success_page == o.skip_native_app_success_page && - back_channel_logout_uri == o.back_channel_logout_uri && - login_version == o.login_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [redirect_uris, response_types, grant_types, application_type, client_id, auth_method_type, post_logout_redirect_uris, version, non_compliant, compliance_problems, development_mode, access_token_type, access_token_role_assertion, id_token_role_assertion, id_token_userinfo_assertion, clock_skew, additional_origins, allowed_origins, skip_native_app_success_page, back_channel_logout_uri, login_version].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_o_i_d_c_grant_type.rb b/lib/zitadel/client/models/application_service_o_i_d_c_grant_type.rb deleted file mode 100644 index 9852810c..00000000 --- a/lib/zitadel/client/models/application_service_o_i_d_c_grant_type.rb +++ /dev/null @@ -1,44 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceOIDCGrantType - OIDC_GRANT_TYPE_AUTHORIZATION_CODE = "OIDC_GRANT_TYPE_AUTHORIZATION_CODE".freeze - OIDC_GRANT_TYPE_IMPLICIT = "OIDC_GRANT_TYPE_IMPLICIT".freeze - OIDC_GRANT_TYPE_REFRESH_TOKEN = "OIDC_GRANT_TYPE_REFRESH_TOKEN".freeze - OIDC_GRANT_TYPE_DEVICE_CODE = "OIDC_GRANT_TYPE_DEVICE_CODE".freeze - OIDC_GRANT_TYPE_TOKEN_EXCHANGE = "OIDC_GRANT_TYPE_TOKEN_EXCHANGE".freeze - - def self.all_vars - @all_vars ||= [OIDC_GRANT_TYPE_AUTHORIZATION_CODE, OIDC_GRANT_TYPE_IMPLICIT, OIDC_GRANT_TYPE_REFRESH_TOKEN, OIDC_GRANT_TYPE_DEVICE_CODE, OIDC_GRANT_TYPE_TOKEN_EXCHANGE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceOIDCGrantType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceOIDCGrantType" - end - end - -end diff --git a/lib/zitadel/client/models/application_service_o_i_d_c_localized_message.rb b/lib/zitadel/client/models/application_service_o_i_d_c_localized_message.rb deleted file mode 100644 index 24501dba..00000000 --- a/lib/zitadel/client/models/application_service_o_i_d_c_localized_message.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceOIDCLocalizedMessage - attr_accessor :key - - attr_accessor :localized_message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'localized_message' => :'localizedMessage' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'localized_message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceOIDCLocalizedMessage` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceOIDCLocalizedMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'localized_message') - self.localized_message = attributes[:'localized_message'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - localized_message == o.localized_message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, localized_message].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_o_i_d_c_response_type.rb b/lib/zitadel/client/models/application_service_o_i_d_c_response_type.rb deleted file mode 100644 index 009fe963..00000000 --- a/lib/zitadel/client/models/application_service_o_i_d_c_response_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceOIDCResponseType - OIDC_RESPONSE_TYPE_UNSPECIFIED = "OIDC_RESPONSE_TYPE_UNSPECIFIED".freeze - OIDC_RESPONSE_TYPE_CODE = "OIDC_RESPONSE_TYPE_CODE".freeze - OIDC_RESPONSE_TYPE_ID_TOKEN = "OIDC_RESPONSE_TYPE_ID_TOKEN".freeze - OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN = "OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN".freeze - - def self.all_vars - @all_vars ||= [OIDC_RESPONSE_TYPE_UNSPECIFIED, OIDC_RESPONSE_TYPE_CODE, OIDC_RESPONSE_TYPE_ID_TOKEN, OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceOIDCResponseType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceOIDCResponseType" - end - end - -end diff --git a/lib/zitadel/client/models/application_service_o_i_d_c_token_type.rb b/lib/zitadel/client/models/application_service_o_i_d_c_token_type.rb deleted file mode 100644 index cfdcfe62..00000000 --- a/lib/zitadel/client/models/application_service_o_i_d_c_token_type.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceOIDCTokenType - OIDC_TOKEN_TYPE_BEARER = "OIDC_TOKEN_TYPE_BEARER".freeze - OIDC_TOKEN_TYPE_JWT = "OIDC_TOKEN_TYPE_JWT".freeze - - def self.all_vars - @all_vars ||= [OIDC_TOKEN_TYPE_BEARER, OIDC_TOKEN_TYPE_JWT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceOIDCTokenType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceOIDCTokenType" - end - end - -end diff --git a/lib/zitadel/client/models/application_service_o_i_d_c_version.rb b/lib/zitadel/client/models/application_service_o_i_d_c_version.rb deleted file mode 100644 index 28eb476a..00000000 --- a/lib/zitadel/client/models/application_service_o_i_d_c_version.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceOIDCVersion - OIDC_VERSION_1_0 = "OIDC_VERSION_1_0".freeze - - def self.all_vars - @all_vars ||= [OIDC_VERSION_1_0].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceOIDCVersion.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceOIDCVersion" - end - end - -end diff --git a/lib/zitadel/client/models/application_service_oidc_application_type.rb b/lib/zitadel/client/models/application_service_oidc_application_type.rb new file mode 100644 index 00000000..8b78623a --- /dev/null +++ b/lib/zitadel/client/models/application_service_oidc_application_type.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceOIDCApplicationType. + class ApplicationServiceOIDCApplicationType + OIDC_APP_TYPE_WEB = 'OIDC_APP_TYPE_WEB' + OIDC_APP_TYPE_USER_AGENT = 'OIDC_APP_TYPE_USER_AGENT' + OIDC_APP_TYPE_NATIVE = 'OIDC_APP_TYPE_NATIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_APP_TYPE_WEB, OIDC_APP_TYPE_USER_AGENT, OIDC_APP_TYPE_NATIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceOIDCApplicationType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/application_service_oidc_auth_method_type.rb b/lib/zitadel/client/models/application_service_oidc_auth_method_type.rb new file mode 100644 index 00000000..8264cd1e --- /dev/null +++ b/lib/zitadel/client/models/application_service_oidc_auth_method_type.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceOIDCAuthMethodType. + class ApplicationServiceOIDCAuthMethodType + OIDC_AUTH_METHOD_TYPE_BASIC = 'OIDC_AUTH_METHOD_TYPE_BASIC' + OIDC_AUTH_METHOD_TYPE_POST = 'OIDC_AUTH_METHOD_TYPE_POST' + OIDC_AUTH_METHOD_TYPE_NONE = 'OIDC_AUTH_METHOD_TYPE_NONE' + OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = 'OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_AUTH_METHOD_TYPE_BASIC, OIDC_AUTH_METHOD_TYPE_POST, OIDC_AUTH_METHOD_TYPE_NONE, OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceOIDCAuthMethodType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/application_service_oidc_configuration.rb b/lib/zitadel/client/models/application_service_oidc_configuration.rb new file mode 100644 index 00000000..23e4dae7 --- /dev/null +++ b/lib/zitadel/client/models/application_service_oidc_configuration.rb @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceOIDCConfiguration. + class ApplicationServiceOIDCConfiguration < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + redirect_uris: 'redirectUris', + response_types: 'responseTypes', + grant_types: 'grantTypes', + application_type: 'applicationType', + client_id: 'clientId', + auth_method_type: 'authMethodType', + post_logout_redirect_uris: 'postLogoutRedirectUris', + version: 'version', + non_compliant: 'nonCompliant', + compliance_problems: 'complianceProblems', + development_mode: 'developmentMode', + access_token_type: 'accessTokenType', + access_token_role_assertion: 'accessTokenRoleAssertion', + id_token_role_assertion: 'idTokenRoleAssertion', + id_token_userinfo_assertion: 'idTokenUserinfoAssertion', + clock_skew: 'clockSkew', + additional_origins: 'additionalOrigins', + allowed_origins: 'allowedOrigins', + skip_native_app_success_page: 'skipNativeAppSuccessPage', + back_channel_logout_uri: 'backChannelLogoutUri', + login_version: 'loginVersion' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + redirect_uris: 'Array', + response_types: 'Array', + grant_types: 'Array', + application_type: 'ApplicationServiceOIDCApplicationType', + client_id: 'String', + auth_method_type: 'ApplicationServiceOIDCAuthMethodType', + post_logout_redirect_uris: 'Array', + version: 'ApplicationServiceOIDCVersion', + non_compliant: 'Boolean', + compliance_problems: 'Array', + development_mode: 'Boolean', + access_token_type: 'ApplicationServiceOIDCTokenType', + access_token_role_assertion: 'Boolean', + id_token_role_assertion: 'Boolean', + id_token_userinfo_assertion: 'Boolean', + clock_skew: 'ISO8601::Duration', + additional_origins: 'Array', + allowed_origins: 'Array', + skip_native_app_success_page: 'Boolean', + back_channel_logout_uri: 'String', + login_version: 'ApplicationServiceLoginVersion' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs. + # @example null + attribute :redirect_uris, Types::Any.optional.meta(omittable: true) + # ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values. + # @example null + attribute :response_types, Types::Any.optional.meta(omittable: true) + # GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. + # @example null + attribute :grant_types, Types::Any.optional.meta(omittable: true) + # @example null + attribute :application_type, Types::Any.optional.meta(omittable: true) + # The unique OAuth2/OIDC client_id used for authentication of the application, e.g. at the token endpoint. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + # PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs. + # @example null + attribute :post_logout_redirect_uris, Types::Any.optional.meta(omittable: true) + # @example null + attribute :version, Types::Any.optional.meta(omittable: true) + # NonCompliant specifies whether the config is OIDC compliant. A production configuration SHOULD be compliant. Non-compliant configurations can run into interoperability issues with OIDC libraries and tools. Compliance problems are listed in the compliance_problems field. + # @example null + attribute :non_compliant, Types::Any.optional.meta(omittable: true) + # ComplianceProblems lists the problems for non-compliant configurations. In case of a compliant configuration, this list is empty. + # @example null + attribute :compliance_problems, Types::Any.optional.meta(omittable: true) + # DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs. + # @example null + attribute :development_mode, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_type, Types::Any.optional.meta(omittable: true) + # If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project. + # @example null + attribute :access_token_role_assertion, Types::Any.optional.meta(omittable: true) + # If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project. + # @example null + attribute :id_token_role_assertion, Types::Any.optional.meta(omittable: true) + # If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable. + # @example null + attribute :id_token_userinfo_assertion, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :clock_skew, Types::Any.optional.meta(omittable: true) + # AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin. + # @example null + attribute :additional_origins, Types::Any.optional.meta(omittable: true) + # AllowedOrigins are all HTTP origins where the application is allowed to be used from. This is used to prevent CORS issues in browsers. If the origin of the request is not in this list, the request will be rejected. This is especially important for SPAs. Note that this is a generated list from the redirect_uris and additional_origins. If you use the application from another origin, you have to add it to the additional_origins. + # @example null + attribute :allowed_origins, Types::Any.optional.meta(omittable: true) + # For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly. + # @example null + attribute :skip_native_app_success_page, Types::Any.optional.meta(omittable: true) + # BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html). + # @example null + attribute :back_channel_logout_uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_oidc_grant_type.rb b/lib/zitadel/client/models/application_service_oidc_grant_type.rb new file mode 100644 index 00000000..76e724a0 --- /dev/null +++ b/lib/zitadel/client/models/application_service_oidc_grant_type.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceOIDCGrantType. + class ApplicationServiceOIDCGrantType + OIDC_GRANT_TYPE_AUTHORIZATION_CODE = 'OIDC_GRANT_TYPE_AUTHORIZATION_CODE' + OIDC_GRANT_TYPE_IMPLICIT = 'OIDC_GRANT_TYPE_IMPLICIT' + OIDC_GRANT_TYPE_REFRESH_TOKEN = 'OIDC_GRANT_TYPE_REFRESH_TOKEN' + OIDC_GRANT_TYPE_DEVICE_CODE = 'OIDC_GRANT_TYPE_DEVICE_CODE' + OIDC_GRANT_TYPE_TOKEN_EXCHANGE = 'OIDC_GRANT_TYPE_TOKEN_EXCHANGE' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_GRANT_TYPE_AUTHORIZATION_CODE, OIDC_GRANT_TYPE_IMPLICIT, OIDC_GRANT_TYPE_REFRESH_TOKEN, OIDC_GRANT_TYPE_DEVICE_CODE, OIDC_GRANT_TYPE_TOKEN_EXCHANGE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceOIDCGrantType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/application_service_oidc_localized_message.rb b/lib/zitadel/client/models/application_service_oidc_localized_message.rb new file mode 100644 index 00000000..9adbf2b2 --- /dev/null +++ b/lib/zitadel/client/models/application_service_oidc_localized_message.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceOIDCLocalizedMessage. + class ApplicationServiceOIDCLocalizedMessage < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + localized_message: 'localizedMessage' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + localized_message: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :localized_message, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_oidc_response_type.rb b/lib/zitadel/client/models/application_service_oidc_response_type.rb new file mode 100644 index 00000000..60984e27 --- /dev/null +++ b/lib/zitadel/client/models/application_service_oidc_response_type.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceOIDCResponseType. + class ApplicationServiceOIDCResponseType + OIDC_RESPONSE_TYPE_UNSPECIFIED = 'OIDC_RESPONSE_TYPE_UNSPECIFIED' + OIDC_RESPONSE_TYPE_CODE = 'OIDC_RESPONSE_TYPE_CODE' + OIDC_RESPONSE_TYPE_ID_TOKEN = 'OIDC_RESPONSE_TYPE_ID_TOKEN' + OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN = 'OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_RESPONSE_TYPE_UNSPECIFIED, OIDC_RESPONSE_TYPE_CODE, OIDC_RESPONSE_TYPE_ID_TOKEN, OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceOIDCResponseType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/application_service_oidc_token_type.rb b/lib/zitadel/client/models/application_service_oidc_token_type.rb new file mode 100644 index 00000000..8bf80e69 --- /dev/null +++ b/lib/zitadel/client/models/application_service_oidc_token_type.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceOIDCTokenType. + class ApplicationServiceOIDCTokenType + OIDC_TOKEN_TYPE_BEARER = 'OIDC_TOKEN_TYPE_BEARER' + OIDC_TOKEN_TYPE_JWT = 'OIDC_TOKEN_TYPE_JWT' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_TOKEN_TYPE_BEARER, OIDC_TOKEN_TYPE_JWT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceOIDCTokenType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/application_service_oidc_version.rb b/lib/zitadel/client/models/application_service_oidc_version.rb new file mode 100644 index 00000000..6367db05 --- /dev/null +++ b/lib/zitadel/client/models/application_service_oidc_version.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceOIDCVersion. + class ApplicationServiceOIDCVersion + OIDC_VERSION_1_0 = 'OIDC_VERSION_1_0' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_VERSION_1_0].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceOIDCVersion: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/application_service_pagination_request.rb b/lib/zitadel/client/models/application_service_pagination_request.rb index ac3b6c15..652657fd 100644 --- a/lib/zitadel/client/models/application_service_pagination_request.rb +++ b/lib/zitadel/client/models/application_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServicePaginationRequest. + class ApplicationServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_pagination_response.rb b/lib/zitadel/client/models/application_service_pagination_response.rb index 094294fb..71046cc9 100644 --- a/lib/zitadel/client/models/application_service_pagination_response.rb +++ b/lib/zitadel/client/models/application_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServicePaginationResponse. + class ApplicationServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_project_i_d_filter.rb b/lib/zitadel/client/models/application_service_project_i_d_filter.rb deleted file mode 100644 index 2b796d14..00000000 --- a/lib/zitadel/client/models/application_service_project_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceProjectIDFilter - # Search for application belonging to the project with this ID. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceProjectIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceProjectIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_project_id_filter.rb b/lib/zitadel/client/models/application_service_project_id_filter.rb new file mode 100644 index 00000000..84f8221e --- /dev/null +++ b/lib/zitadel/client/models/application_service_project_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceProjectIDFilter. + class ApplicationServiceProjectIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Search for application belonging to the project with this ID. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_reactivate_application_request.rb b/lib/zitadel/client/models/application_service_reactivate_application_request.rb index 586c31dd..07547d85 100644 --- a/lib/zitadel/client/models/application_service_reactivate_application_request.rb +++ b/lib/zitadel/client/models/application_service_reactivate_application_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceReactivateApplicationRequest - # The unique ID of the application to be reactivated. - attr_accessor :application_id - - # The ID of the project the application belongs to. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceReactivateApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceReactivateApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceReactivateApplicationRequest. + class ApplicationServiceReactivateApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the application to be reactivated. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # The ID of the project the application belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_reactivate_application_response.rb b/lib/zitadel/client/models/application_service_reactivate_application_response.rb index 4b882dd5..00c1956a 100644 --- a/lib/zitadel/client/models/application_service_reactivate_application_response.rb +++ b/lib/zitadel/client/models/application_service_reactivate_application_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceReactivateApplicationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :reactivation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reactivation_date' => :'reactivationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reactivation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceReactivateApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceReactivateApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reactivation_date') - self.reactivation_date = attributes[:'reactivation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reactivation_date == o.reactivation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reactivation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceReactivateApplicationResponse. + class ApplicationServiceReactivateApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + reactivation_date: 'reactivationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + reactivation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :reactivation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_s_a_m_l_configuration.rb b/lib/zitadel/client/models/application_service_s_a_m_l_configuration.rb deleted file mode 100644 index c4662dac..00000000 --- a/lib/zitadel/client/models/application_service_s_a_m_l_configuration.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceSAMLConfiguration - # The Metadata XML is the provided or fetched metadata stored at Zitadel. If either the metadata was provided as XML or when Zitadel fetched it at the provided URL, it is stored here. - attr_accessor :metadata_xml - - # The Metadata URL is the URL where the metadata was fetched from. In case the metadata was provided as raw XML, this field is empty. - attr_accessor :metadata_url - - attr_accessor :login_version - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'metadata_xml' => :'metadataXml', - :'metadata_url' => :'metadataUrl', - :'login_version' => :'loginVersion' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'metadata_xml' => :'String', - :'metadata_url' => :'String', - :'login_version' => :'ApplicationServiceLoginVersion' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceSAMLConfiguration` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceSAMLConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'metadata_xml') - self.metadata_xml = attributes[:'metadata_xml'] - end - - if attributes.key?(:'metadata_url') - self.metadata_url = attributes[:'metadata_url'] - end - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - metadata_xml == o.metadata_xml && - metadata_url == o.metadata_url && - login_version == o.login_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [metadata_xml, metadata_url, login_version].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_saml_configuration.rb b/lib/zitadel/client/models/application_service_saml_configuration.rb new file mode 100644 index 00000000..1ea91a30 --- /dev/null +++ b/lib/zitadel/client/models/application_service_saml_configuration.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceSAMLConfiguration. + class ApplicationServiceSAMLConfiguration < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + metadata_xml: 'metadataXml', + metadata_url: 'metadataUrl', + login_version: 'loginVersion' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + metadata_xml: 'String', + metadata_url: 'String', + login_version: 'ApplicationServiceLoginVersion' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + metadata_xml: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The Metadata XML is the provided or fetched metadata stored at Zitadel. If either the metadata was provided as XML or when Zitadel fetched it at the provided URL, it is stored here. + # @example null + attribute :metadata_xml, Types::Any.optional.meta(omittable: true) + # The Metadata URL is the URL where the metadata was fetched from. In case the metadata was provided as raw XML, this field is empty. + # @example null + attribute :metadata_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_text_filter_method.rb b/lib/zitadel/client/models/application_service_text_filter_method.rb index f53f3fab..bf838fd3 100644 --- a/lib/zitadel/client/models/application_service_text_filter_method.rb +++ b/lib/zitadel/client/models/application_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class ApplicationServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ApplicationServiceTextFilterMethod. + class ApplicationServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ApplicationServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ApplicationServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ApplicationServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/application_service_update_a_p_i_application_configuration_request.rb b/lib/zitadel/client/models/application_service_update_a_p_i_application_configuration_request.rb deleted file mode 100644 index d5d4e69b..00000000 --- a/lib/zitadel/client/models/application_service_update_a_p_i_application_configuration_request.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceUpdateAPIApplicationConfigurationRequest - attr_accessor :auth_method_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_method_type' => :'authMethodType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_method_type' => :'ApplicationServiceAPIAuthMethodType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceUpdateAPIApplicationConfigurationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceUpdateAPIApplicationConfigurationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_method_type == o.auth_method_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_method_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_update_api_application_configuration_request.rb b/lib/zitadel/client/models/application_service_update_api_application_configuration_request.rb new file mode 100644 index 00000000..4f09d24f --- /dev/null +++ b/lib/zitadel/client/models/application_service_update_api_application_configuration_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceUpdateAPIApplicationConfigurationRequest. + class ApplicationServiceUpdateAPIApplicationConfigurationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_method_type: 'authMethodType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_method_type: 'ApplicationServiceAPIAuthMethodType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_update_application_request.rb b/lib/zitadel/client/models/application_service_update_application_request.rb index 8dcce081..2f3fa89a 100644 --- a/lib/zitadel/client/models/application_service_update_application_request.rb +++ b/lib/zitadel/client/models/application_service_update_application_request.rb @@ -1,263 +1,96 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceUpdateApplicationRequest - # The unique ID of the application to be updated. - attr_accessor :application_id - - # The ID of the project the application belongs to. - attr_accessor :project_id - - # Publicly visible name of the application. This might be presented to users if they sign in. If not set, the name will not be changed. - attr_accessor :name - - attr_accessor :api_configuration - - attr_accessor :oidc_configuration - - attr_accessor :saml_configuration - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'applicationId', - :'project_id' => :'projectId', - :'name' => :'name', - :'api_configuration' => :'apiConfiguration', - :'oidc_configuration' => :'oidcConfiguration', - :'saml_configuration' => :'samlConfiguration' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'project_id' => :'String', - :'name' => :'String', - :'api_configuration' => :'ApplicationServiceUpdateAPIApplicationConfigurationRequest', - :'oidc_configuration' => :'ApplicationServiceUpdateOIDCApplicationConfigurationRequest', - :'saml_configuration' => :'ApplicationServiceUpdateSAMLApplicationConfigurationRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceUpdateApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceUpdateApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'api_configuration') - self.api_configuration = attributes[:'api_configuration'] - end - - if attributes.key?(:'oidc_configuration') - self.oidc_configuration = attributes[:'oidc_configuration'] - end - - if attributes.key?(:'saml_configuration') - self.saml_configuration = attributes[:'saml_configuration'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - project_id == o.project_id && - name == o.name && - api_configuration == o.api_configuration && - oidc_configuration == o.oidc_configuration && - saml_configuration == o.saml_configuration - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, project_id, name, api_configuration, oidc_configuration, saml_configuration].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceUpdateApplicationRequest. + class ApplicationServiceUpdateApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + application_id: 'applicationId', + project_id: 'projectId', + name: 'name', + api_configuration: 'apiConfiguration', + oidc_configuration: 'oidcConfiguration', + saml_configuration: 'samlConfiguration' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + application_id: 'String', + project_id: 'String', + name: 'String', + api_configuration: 'ApplicationServiceUpdateAPIApplicationConfigurationRequest', + oidc_configuration: 'ApplicationServiceUpdateOIDCApplicationConfigurationRequest', + saml_configuration: 'ApplicationServiceUpdateSAMLApplicationConfigurationRequest' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique ID of the application to be updated. + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # The ID of the project the application belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Publicly visible name of the application. This might be presented to users if they sign in. If not set, the name will not be changed. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :api_configuration, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_configuration, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml_configuration, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/application_service_update_application_response.rb b/lib/zitadel/client/models/application_service_update_application_response.rb index 80dd799c..5a26039e 100644 --- a/lib/zitadel/client/models/application_service_update_application_response.rb +++ b/lib/zitadel/client/models/application_service_update_application_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ApplicationServiceUpdateApplicationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceUpdateApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceUpdateApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceUpdateApplicationResponse. + class ApplicationServiceUpdateApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/application_service_update_o_i_d_c_application_configuration_request.rb b/lib/zitadel/client/models/application_service_update_o_i_d_c_application_configuration_request.rb deleted file mode 100644 index 97665715..00000000 --- a/lib/zitadel/client/models/application_service_update_o_i_d_c_application_configuration_request.rb +++ /dev/null @@ -1,409 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceUpdateOIDCApplicationConfigurationRequest - # RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs. Any existing redirect URIs not included in this list will be removed. If not set, the redirect URIs will not be changed. - attr_accessor :redirect_uris - - # ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values. Any existing response types not included in this list will be removed. If not set, the response types will not be changed. - attr_accessor :response_types - - # GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. Minimum one grant type must be provided, but multiple grant types can be provided to allow different flows, e.g. authorization code flow and refresh token flow. Any existing grant types not included in this list will be removed. If not set, the grant types will not be changed. - attr_accessor :grant_types - - attr_accessor :application_type - - attr_accessor :auth_method_type - - # PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs. Any existing post logout redirect URIs not included in this list will be removed. If not set, the post logout redirect URIs will not be changed. - attr_accessor :post_logout_redirect_uris - - attr_accessor :version - - # DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs. If not set, the dev mode will not be changed. - attr_accessor :development_mode - - attr_accessor :access_token_type - - # If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project. If not set, the access token role assertion will not be changed. - attr_accessor :access_token_role_assertion - - # If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project. If not set, the id token role assertion will not be changed. - attr_accessor :id_token_role_assertion - - # If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable. If not set, the id token userinfo assertion will not be changed. - attr_accessor :id_token_userinfo_assertion - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :clock_skew - - # AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin. Any existing additional origins not included in this list will be removed. If not set, the additional origins will not be changed. - attr_accessor :additional_origins - - # For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly. If not set, the skip native app success page will not be changed. - attr_accessor :skip_native_app_success_page - - # BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html). If not set, the back channel logout URI will not be changed. - attr_accessor :back_channel_logout_uri - - attr_accessor :login_version - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'redirect_uris' => :'redirectUris', - :'response_types' => :'responseTypes', - :'grant_types' => :'grantTypes', - :'application_type' => :'applicationType', - :'auth_method_type' => :'authMethodType', - :'post_logout_redirect_uris' => :'postLogoutRedirectUris', - :'version' => :'version', - :'development_mode' => :'developmentMode', - :'access_token_type' => :'accessTokenType', - :'access_token_role_assertion' => :'accessTokenRoleAssertion', - :'id_token_role_assertion' => :'idTokenRoleAssertion', - :'id_token_userinfo_assertion' => :'idTokenUserinfoAssertion', - :'clock_skew' => :'clockSkew', - :'additional_origins' => :'additionalOrigins', - :'skip_native_app_success_page' => :'skipNativeAppSuccessPage', - :'back_channel_logout_uri' => :'backChannelLogoutUri', - :'login_version' => :'loginVersion' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'redirect_uris' => :'Array', - :'response_types' => :'Array', - :'grant_types' => :'Array', - :'application_type' => :'ApplicationServiceOIDCApplicationType', - :'auth_method_type' => :'ApplicationServiceOIDCAuthMethodType', - :'post_logout_redirect_uris' => :'Array', - :'version' => :'ApplicationServiceOIDCVersion', - :'development_mode' => :'Boolean', - :'access_token_type' => :'ApplicationServiceOIDCTokenType', - :'access_token_role_assertion' => :'Boolean', - :'id_token_role_assertion' => :'Boolean', - :'id_token_userinfo_assertion' => :'Boolean', - :'clock_skew' => :'String', - :'additional_origins' => :'Array', - :'skip_native_app_success_page' => :'Boolean', - :'back_channel_logout_uri' => :'String', - :'login_version' => :'ApplicationServiceLoginVersion' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'development_mode', - :'access_token_role_assertion', - :'id_token_role_assertion', - :'id_token_userinfo_assertion', - :'skip_native_app_success_page', - :'back_channel_logout_uri', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceUpdateOIDCApplicationConfigurationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceUpdateOIDCApplicationConfigurationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'redirect_uris') - if (value = attributes[:'redirect_uris']).is_a?(Array) - self.redirect_uris = value - end - end - - if attributes.key?(:'response_types') - if (value = attributes[:'response_types']).is_a?(Array) - self.response_types = value - end - end - - if attributes.key?(:'grant_types') - if (value = attributes[:'grant_types']).is_a?(Array) - self.grant_types = value - end - end - - if attributes.key?(:'application_type') - self.application_type = attributes[:'application_type'] - end - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - - if attributes.key?(:'post_logout_redirect_uris') - if (value = attributes[:'post_logout_redirect_uris']).is_a?(Array) - self.post_logout_redirect_uris = value - end - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'development_mode') - self.development_mode = attributes[:'development_mode'] - end - - if attributes.key?(:'access_token_type') - self.access_token_type = attributes[:'access_token_type'] - end - - if attributes.key?(:'access_token_role_assertion') - self.access_token_role_assertion = attributes[:'access_token_role_assertion'] - end - - if attributes.key?(:'id_token_role_assertion') - self.id_token_role_assertion = attributes[:'id_token_role_assertion'] - end - - if attributes.key?(:'id_token_userinfo_assertion') - self.id_token_userinfo_assertion = attributes[:'id_token_userinfo_assertion'] - end - - if attributes.key?(:'clock_skew') - self.clock_skew = attributes[:'clock_skew'] - end - - if attributes.key?(:'additional_origins') - if (value = attributes[:'additional_origins']).is_a?(Array) - self.additional_origins = value - end - end - - if attributes.key?(:'skip_native_app_success_page') - self.skip_native_app_success_page = attributes[:'skip_native_app_success_page'] - end - - if attributes.key?(:'back_channel_logout_uri') - self.back_channel_logout_uri = attributes[:'back_channel_logout_uri'] - end - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - redirect_uris == o.redirect_uris && - response_types == o.response_types && - grant_types == o.grant_types && - application_type == o.application_type && - auth_method_type == o.auth_method_type && - post_logout_redirect_uris == o.post_logout_redirect_uris && - version == o.version && - development_mode == o.development_mode && - access_token_type == o.access_token_type && - access_token_role_assertion == o.access_token_role_assertion && - id_token_role_assertion == o.id_token_role_assertion && - id_token_userinfo_assertion == o.id_token_userinfo_assertion && - clock_skew == o.clock_skew && - additional_origins == o.additional_origins && - skip_native_app_success_page == o.skip_native_app_success_page && - back_channel_logout_uri == o.back_channel_logout_uri && - login_version == o.login_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [redirect_uris, response_types, grant_types, application_type, auth_method_type, post_logout_redirect_uris, version, development_mode, access_token_type, access_token_role_assertion, id_token_role_assertion, id_token_userinfo_assertion, clock_skew, additional_origins, skip_native_app_success_page, back_channel_logout_uri, login_version].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_update_oidc_application_configuration_request.rb b/lib/zitadel/client/models/application_service_update_oidc_application_configuration_request.rb new file mode 100644 index 00000000..4edeab04 --- /dev/null +++ b/lib/zitadel/client/models/application_service_update_oidc_application_configuration_request.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceUpdateOIDCApplicationConfigurationRequest. + class ApplicationServiceUpdateOIDCApplicationConfigurationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + redirect_uris: 'redirectUris', + response_types: 'responseTypes', + grant_types: 'grantTypes', + application_type: 'applicationType', + auth_method_type: 'authMethodType', + post_logout_redirect_uris: 'postLogoutRedirectUris', + version: 'version', + development_mode: 'developmentMode', + access_token_type: 'accessTokenType', + access_token_role_assertion: 'accessTokenRoleAssertion', + id_token_role_assertion: 'idTokenRoleAssertion', + id_token_userinfo_assertion: 'idTokenUserinfoAssertion', + clock_skew: 'clockSkew', + additional_origins: 'additionalOrigins', + skip_native_app_success_page: 'skipNativeAppSuccessPage', + back_channel_logout_uri: 'backChannelLogoutUri', + login_version: 'loginVersion' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + redirect_uris: 'Array', + response_types: 'Array', + grant_types: 'Array', + application_type: 'ApplicationServiceOIDCApplicationType', + auth_method_type: 'ApplicationServiceOIDCAuthMethodType', + post_logout_redirect_uris: 'Array', + version: 'ApplicationServiceOIDCVersion', + development_mode: 'Boolean', + access_token_type: 'ApplicationServiceOIDCTokenType', + access_token_role_assertion: 'Boolean', + id_token_role_assertion: 'Boolean', + id_token_userinfo_assertion: 'Boolean', + clock_skew: 'ISO8601::Duration', + additional_origins: 'Array', + skip_native_app_success_page: 'Boolean', + back_channel_logout_uri: 'String', + login_version: 'ApplicationServiceLoginVersion' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs. Any existing redirect URIs not included in this list will be removed. If not set, the redirect URIs will not be changed. + # @example null + attribute :redirect_uris, Types::Any.optional.meta(omittable: true) + # ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values. Any existing response types not included in this list will be removed. If not set, the response types will not be changed. + # @example null + attribute :response_types, Types::Any.optional.meta(omittable: true) + # GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. Minimum one grant type must be provided, but multiple grant types can be provided to allow different flows, e.g. authorization code flow and refresh token flow. Any existing grant types not included in this list will be removed. If not set, the grant types will not be changed. + # @example null + attribute :grant_types, Types::Any.optional.meta(omittable: true) + # @example null + attribute :application_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + # PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs. Any existing post logout redirect URIs not included in this list will be removed. If not set, the post logout redirect URIs will not be changed. + # @example null + attribute :post_logout_redirect_uris, Types::Any.optional.meta(omittable: true) + # @example null + attribute :version, Types::Any.optional.meta(omittable: true) + # DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs. If not set, the dev mode will not be changed. + # @example null + attribute :development_mode, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_type, Types::Any.optional.meta(omittable: true) + # If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project. If not set, the access token role assertion will not be changed. + # @example null + attribute :access_token_role_assertion, Types::Any.optional.meta(omittable: true) + # If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project. If not set, the id token role assertion will not be changed. + # @example null + attribute :id_token_role_assertion, Types::Any.optional.meta(omittable: true) + # If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable. If not set, the id token userinfo assertion will not be changed. + # @example null + attribute :id_token_userinfo_assertion, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :clock_skew, Types::Any.optional.meta(omittable: true) + # AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin. Any existing additional origins not included in this list will be removed. If not set, the additional origins will not be changed. + # @example null + attribute :additional_origins, Types::Any.optional.meta(omittable: true) + # For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly. If not set, the skip native app success page will not be changed. + # @example null + attribute :skip_native_app_success_page, Types::Any.optional.meta(omittable: true) + # BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html). If not set, the back channel logout URI will not be changed. + # @example null + attribute :back_channel_logout_uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/application_service_update_s_a_m_l_application_configuration_request.rb b/lib/zitadel/client/models/application_service_update_s_a_m_l_application_configuration_request.rb deleted file mode 100644 index f1b2504c..00000000 --- a/lib/zitadel/client/models/application_service_update_s_a_m_l_application_configuration_request.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ApplicationServiceUpdateSAMLApplicationConfigurationRequest - attr_accessor :login_version - - attr_accessor :metadata_url - - attr_accessor :metadata_xml - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_version' => :'loginVersion', - :'metadata_url' => :'metadataUrl', - :'metadata_xml' => :'metadataXml' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_version' => :'ApplicationServiceLoginVersion', - :'metadata_url' => :'String', - :'metadata_xml' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ApplicationServiceUpdateSAMLApplicationConfigurationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ApplicationServiceUpdateSAMLApplicationConfigurationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - - if attributes.key?(:'metadata_url') - self.metadata_url = attributes[:'metadata_url'] - end - - if attributes.key?(:'metadata_xml') - self.metadata_xml = attributes[:'metadata_xml'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_version == o.login_version && - metadata_url == o.metadata_url && - metadata_xml == o.metadata_xml - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_version, metadata_url, metadata_xml].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/application_service_update_saml_application_configuration_request.rb b/lib/zitadel/client/models/application_service_update_saml_application_configuration_request.rb new file mode 100644 index 00000000..beaa5aa2 --- /dev/null +++ b/lib/zitadel/client/models/application_service_update_saml_application_configuration_request.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ApplicationServiceUpdateSAMLApplicationConfigurationRequest. + class ApplicationServiceUpdateSAMLApplicationConfigurationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_version: 'loginVersion', + metadata_url: 'metadataUrl', + metadata_xml: 'metadataXml' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_version: 'ApplicationServiceLoginVersion', + metadata_url: 'String', + metadata_xml: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + metadata_xml: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_xml, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/authorization_service_activate_authorization_request.rb b/lib/zitadel/client/models/authorization_service_activate_authorization_request.rb index dd98e90c..c8b69c32 100644 --- a/lib/zitadel/client/models/authorization_service_activate_authorization_request.rb +++ b/lib/zitadel/client/models/authorization_service_activate_authorization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceActivateAuthorizationRequest - # ID is the unique identifier of the authorization that should be activated. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceActivateAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceActivateAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceActivateAuthorizationRequest. + class AuthorizationServiceActivateAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the authorization that should be activated. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_activate_authorization_response.rb b/lib/zitadel/client/models/authorization_service_activate_authorization_response.rb index f7907e3c..8fddac60 100644 --- a/lib/zitadel/client/models/authorization_service_activate_authorization_response.rb +++ b/lib/zitadel/client/models/authorization_service_activate_authorization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceActivateAuthorizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceActivateAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceActivateAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceActivateAuthorizationResponse. + class AuthorizationServiceActivateAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_any.rb b/lib/zitadel/client/models/authorization_service_any.rb index 1a520ebc..41280f94 100644 --- a/lib/zitadel/client/models/authorization_service_any.rb +++ b/lib/zitadel/client/models/authorization_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class AuthorizationServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class AuthorizationServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_authorization.rb b/lib/zitadel/client/models/authorization_service_authorization.rb index b19f267d..ef9db413 100644 --- a/lib/zitadel/client/models/authorization_service_authorization.rb +++ b/lib/zitadel/client/models/authorization_service_authorization.rb @@ -1,306 +1,105 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceAuthorization - # ID is the unique identifier of the authorization. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :project - - attr_accessor :organization - - attr_accessor :user - - attr_accessor :state - - # Roles contains the roles the user was granted for the project. - attr_accessor :roles - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'project' => :'project', - :'organization' => :'organization', - :'user' => :'user', - :'state' => :'state', - :'roles' => :'roles' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'project' => :'AuthorizationServiceProject', - :'organization' => :'AuthorizationServiceOrganization', - :'user' => :'AuthorizationServiceUser', - :'state' => :'AuthorizationServiceState', - :'roles' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceAuthorization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceAuthorization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'project') - self.project = attributes[:'project'] - end - - if attributes.key?(:'organization') - self.organization = attributes[:'organization'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - change_date == o.change_date && - project == o.project && - organization == o.organization && - user == o.user && - state == o.state && - roles == o.roles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, change_date, project, organization, user, state, roles].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceAuthorization. + class AuthorizationServiceAuthorization < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + change_date: 'changeDate', + project: 'project', + organization: 'organization', + user: 'user', + state: 'state', + roles: 'roles' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + change_date: 'Time', + project: 'AuthorizationServiceProject', + organization: 'AuthorizationServiceOrganization', + user: 'AuthorizationServiceUser', + state: 'AuthorizationServiceState', + roles: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the authorization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # Roles contains the roles the user was granted for the project. + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_authorization_field_name.rb b/lib/zitadel/client/models/authorization_service_authorization_field_name.rb index b4fadabf..a15f56b6 100644 --- a/lib/zitadel/client/models/authorization_service_authorization_field_name.rb +++ b/lib/zitadel/client/models/authorization_service_authorization_field_name.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class AuthorizationServiceAuthorizationFieldName - AUTHORIZATION_FIELD_NAME_UNSPECIFIED = "AUTHORIZATION_FIELD_NAME_UNSPECIFIED".freeze - AUTHORIZATION_FIELD_NAME_CREATED_DATE = "AUTHORIZATION_FIELD_NAME_CREATED_DATE".freeze - AUTHORIZATION_FIELD_NAME_CHANGED_DATE = "AUTHORIZATION_FIELD_NAME_CHANGED_DATE".freeze - AUTHORIZATION_FIELD_NAME_ID = "AUTHORIZATION_FIELD_NAME_ID".freeze - AUTHORIZATION_FIELD_NAME_USER_ID = "AUTHORIZATION_FIELD_NAME_USER_ID".freeze - AUTHORIZATION_FIELD_NAME_PROJECT_ID = "AUTHORIZATION_FIELD_NAME_PROJECT_ID".freeze - AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID = "AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID".freeze - AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID = "AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID".freeze - - def self.all_vars - @all_vars ||= [AUTHORIZATION_FIELD_NAME_UNSPECIFIED, AUTHORIZATION_FIELD_NAME_CREATED_DATE, AUTHORIZATION_FIELD_NAME_CHANGED_DATE, AUTHORIZATION_FIELD_NAME_ID, AUTHORIZATION_FIELD_NAME_USER_ID, AUTHORIZATION_FIELD_NAME_PROJECT_ID, AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID, AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for AuthorizationServiceAuthorizationFieldName. + class AuthorizationServiceAuthorizationFieldName + AUTHORIZATION_FIELD_NAME_UNSPECIFIED = 'AUTHORIZATION_FIELD_NAME_UNSPECIFIED' + AUTHORIZATION_FIELD_NAME_CREATED_DATE = 'AUTHORIZATION_FIELD_NAME_CREATED_DATE' + AUTHORIZATION_FIELD_NAME_CHANGED_DATE = 'AUTHORIZATION_FIELD_NAME_CHANGED_DATE' + AUTHORIZATION_FIELD_NAME_ID = 'AUTHORIZATION_FIELD_NAME_ID' + AUTHORIZATION_FIELD_NAME_USER_ID = 'AUTHORIZATION_FIELD_NAME_USER_ID' + AUTHORIZATION_FIELD_NAME_PROJECT_ID = 'AUTHORIZATION_FIELD_NAME_PROJECT_ID' + AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID = 'AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID' + AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID = 'AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [AUTHORIZATION_FIELD_NAME_UNSPECIFIED, AUTHORIZATION_FIELD_NAME_CREATED_DATE, AUTHORIZATION_FIELD_NAME_CHANGED_DATE, AUTHORIZATION_FIELD_NAME_ID, AUTHORIZATION_FIELD_NAME_USER_ID, AUTHORIZATION_FIELD_NAME_PROJECT_ID, AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID, AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if AuthorizationServiceAuthorizationFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::AuthorizationServiceAuthorizationFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for AuthorizationServiceAuthorizationFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/authorization_service_authorizations_search_filter.rb b/lib/zitadel/client/models/authorization_service_authorizations_search_filter.rb index 2b60553c..ed4c973c 100644 --- a/lib/zitadel/client/models/authorization_service_authorizations_search_filter.rb +++ b/lib/zitadel/client/models/authorization_service_authorizations_search_filter.rb @@ -1,305 +1,113 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceAuthorizationsSearchFilter - attr_accessor :authorization_ids - - attr_accessor :in_user_ids - - attr_accessor :organization_id - - attr_accessor :project_grant_id - - attr_accessor :project_id - - attr_accessor :project_name - - attr_accessor :role_key - - attr_accessor :state - - attr_accessor :user_display_name - - attr_accessor :user_organization_id - - attr_accessor :user_preferred_login_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'authorization_ids' => :'authorizationIds', - :'in_user_ids' => :'inUserIds', - :'organization_id' => :'organizationId', - :'project_grant_id' => :'projectGrantId', - :'project_id' => :'projectId', - :'project_name' => :'projectName', - :'role_key' => :'roleKey', - :'state' => :'state', - :'user_display_name' => :'userDisplayName', - :'user_organization_id' => :'userOrganizationId', - :'user_preferred_login_name' => :'userPreferredLoginName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'authorization_ids' => :'AuthorizationServiceInIDsFilter', - :'in_user_ids' => :'AuthorizationServiceInIDsFilter', - :'organization_id' => :'AuthorizationServiceIDFilter', - :'project_grant_id' => :'AuthorizationServiceIDFilter', - :'project_id' => :'AuthorizationServiceIDFilter', - :'project_name' => :'AuthorizationServiceProjectNameQuery', - :'role_key' => :'AuthorizationServiceRoleKeyQuery', - :'state' => :'AuthorizationServiceStateQuery', - :'user_display_name' => :'AuthorizationServiceUserDisplayNameQuery', - :'user_organization_id' => :'AuthorizationServiceIDFilter', - :'user_preferred_login_name' => :'AuthorizationServiceUserPreferredLoginNameQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceAuthorizationsSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceAuthorizationsSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'authorization_ids') - self.authorization_ids = attributes[:'authorization_ids'] - end - - if attributes.key?(:'in_user_ids') - self.in_user_ids = attributes[:'in_user_ids'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'project_grant_id') - self.project_grant_id = attributes[:'project_grant_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'project_name') - self.project_name = attributes[:'project_name'] - end - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'user_display_name') - self.user_display_name = attributes[:'user_display_name'] - end - - if attributes.key?(:'user_organization_id') - self.user_organization_id = attributes[:'user_organization_id'] - end - - if attributes.key?(:'user_preferred_login_name') - self.user_preferred_login_name = attributes[:'user_preferred_login_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - authorization_ids == o.authorization_ids && - in_user_ids == o.in_user_ids && - organization_id == o.organization_id && - project_grant_id == o.project_grant_id && - project_id == o.project_id && - project_name == o.project_name && - role_key == o.role_key && - state == o.state && - user_display_name == o.user_display_name && - user_organization_id == o.user_organization_id && - user_preferred_login_name == o.user_preferred_login_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [authorization_ids, in_user_ids, organization_id, project_grant_id, project_id, project_name, role_key, state, user_display_name, user_organization_id, user_preferred_login_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceAuthorizationsSearchFilter. + class AuthorizationServiceAuthorizationsSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + authorization_ids: 'authorizationIds', + in_user_ids: 'inUserIds', + organization_id: 'organizationId', + project_grant_id: 'projectGrantId', + project_id: 'projectId', + project_name: 'projectName', + role_key: 'roleKey', + state: 'state', + user_display_name: 'userDisplayName', + user_organization_id: 'userOrganizationId', + user_preferred_login_name: 'userPreferredLoginName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + authorization_ids: 'AuthorizationServiceInIDsFilter', + in_user_ids: 'AuthorizationServiceInIDsFilter', + organization_id: 'AuthorizationServiceIDFilter', + project_grant_id: 'AuthorizationServiceIDFilter', + project_id: 'AuthorizationServiceIDFilter', + project_name: 'AuthorizationServiceProjectNameQuery', + role_key: 'AuthorizationServiceRoleKeyQuery', + state: 'AuthorizationServiceStateQuery', + user_display_name: 'AuthorizationServiceUserDisplayNameQuery', + user_organization_id: 'AuthorizationServiceIDFilter', + user_preferred_login_name: 'AuthorizationServiceUserPreferredLoginNameQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :authorization_ids, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_user_ids, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grant_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_preferred_login_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_connect_error.rb b/lib/zitadel/client/models/authorization_service_connect_error.rb index 568b9e7c..b55bf5dd 100644 --- a/lib/zitadel/client/models/authorization_service_connect_error.rb +++ b/lib/zitadel/client/models/authorization_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class AuthorizationServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class AuthorizationServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_create_authorization_request.rb b/lib/zitadel/client/models/authorization_service_create_authorization_request.rb index f25e3c57..e17b8074 100644 --- a/lib/zitadel/client/models/authorization_service_create_authorization_request.rb +++ b/lib/zitadel/client/models/authorization_service_create_authorization_request.rb @@ -1,248 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceCreateAuthorizationRequest - # UserID is the ID of the user who should be granted the authorization. - attr_accessor :user_id - - # Project ID is the ID of the project the user should be authorized for. - attr_accessor :project_id - - # OrganizationID is the ID of the organization on which the authorization should be created. The organization must either own the project or have a grant for the project. - attr_accessor :organization_id - - # RoleKeys are the keys of the roles the user should be granted. - attr_accessor :role_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'project_id' => :'projectId', - :'organization_id' => :'organizationId', - :'role_keys' => :'roleKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'project_id' => :'String', - :'organization_id' => :'String', - :'role_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceCreateAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceCreateAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'role_keys') - if (value = attributes[:'role_keys']).is_a?(Array) - self.role_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - project_id == o.project_id && - organization_id == o.organization_id && - role_keys == o.role_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, project_id, organization_id, role_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceCreateAuthorizationRequest. + class AuthorizationServiceCreateAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + project_id: 'projectId', + organization_id: 'organizationId', + role_keys: 'roleKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + project_id: 'String', + organization_id: 'String', + role_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # UserID is the ID of the user who should be granted the authorization. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # Project ID is the ID of the project the user should be authorized for. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # OrganizationID is the ID of the organization on which the authorization should be created. The organization must either own the project or have a grant for the project. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # RoleKeys are the keys of the roles the user should be granted. + # @example null + attribute :role_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_create_authorization_response.rb b/lib/zitadel/client/models/authorization_service_create_authorization_response.rb index 5092b78e..df243aec 100644 --- a/lib/zitadel/client/models/authorization_service_create_authorization_response.rb +++ b/lib/zitadel/client/models/authorization_service_create_authorization_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceCreateAuthorizationResponse - # ID is the unique identifier of the newly created authorization. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceCreateAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceCreateAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceCreateAuthorizationResponse. + class AuthorizationServiceCreateAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the newly created authorization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_deactivate_authorization_request.rb b/lib/zitadel/client/models/authorization_service_deactivate_authorization_request.rb index 5540b0f3..002fde44 100644 --- a/lib/zitadel/client/models/authorization_service_deactivate_authorization_request.rb +++ b/lib/zitadel/client/models/authorization_service_deactivate_authorization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceDeactivateAuthorizationRequest - # ID is the unique identifier of the authorization that should be deactivated. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceDeactivateAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceDeactivateAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceDeactivateAuthorizationRequest. + class AuthorizationServiceDeactivateAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the authorization that should be deactivated. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_deactivate_authorization_response.rb b/lib/zitadel/client/models/authorization_service_deactivate_authorization_response.rb index 41632ee1..db6f3bdd 100644 --- a/lib/zitadel/client/models/authorization_service_deactivate_authorization_response.rb +++ b/lib/zitadel/client/models/authorization_service_deactivate_authorization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceDeactivateAuthorizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceDeactivateAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceDeactivateAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceDeactivateAuthorizationResponse. + class AuthorizationServiceDeactivateAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_delete_authorization_request.rb b/lib/zitadel/client/models/authorization_service_delete_authorization_request.rb index a3cb472e..414db7c7 100644 --- a/lib/zitadel/client/models/authorization_service_delete_authorization_request.rb +++ b/lib/zitadel/client/models/authorization_service_delete_authorization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceDeleteAuthorizationRequest - # ID is the unique identifier of the authorization that should be deleted. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceDeleteAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceDeleteAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceDeleteAuthorizationRequest. + class AuthorizationServiceDeleteAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the authorization that should be deleted. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_delete_authorization_response.rb b/lib/zitadel/client/models/authorization_service_delete_authorization_response.rb index 87521434..6a19910f 100644 --- a/lib/zitadel/client/models/authorization_service_delete_authorization_response.rb +++ b/lib/zitadel/client/models/authorization_service_delete_authorization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceDeleteAuthorizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceDeleteAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceDeleteAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceDeleteAuthorizationResponse. + class AuthorizationServiceDeleteAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_i_d_filter.rb b/lib/zitadel/client/models/authorization_service_i_d_filter.rb deleted file mode 100644 index 7e930bda..00000000 --- a/lib/zitadel/client/models/authorization_service_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceIDFilter - # Only return resources that belong to this id. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/authorization_service_id_filter.rb b/lib/zitadel/client/models/authorization_service_id_filter.rb new file mode 100644 index 00000000..dbc638e5 --- /dev/null +++ b/lib/zitadel/client/models/authorization_service_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceIDFilter. + class AuthorizationServiceIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Only return resources that belong to this id. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/authorization_service_in_i_ds_filter.rb b/lib/zitadel/client/models/authorization_service_in_i_ds_filter.rb deleted file mode 100644 index 53035fa8..00000000 --- a/lib/zitadel/client/models/authorization_service_in_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceInIDsFilter - # Defines the ids to query for. - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceInIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceInIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/authorization_service_in_ids_filter.rb b/lib/zitadel/client/models/authorization_service_in_ids_filter.rb new file mode 100644 index 00000000..74d0fb13 --- /dev/null +++ b/lib/zitadel/client/models/authorization_service_in_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceInIDsFilter. + class AuthorizationServiceInIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/authorization_service_list_authorizations_request.rb b/lib/zitadel/client/models/authorization_service_list_authorizations_request.rb index 780fcb02..fc512ce7 100644 --- a/lib/zitadel/client/models/authorization_service_list_authorizations_request.rb +++ b/lib/zitadel/client/models/authorization_service_list_authorizations_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceListAuthorizationsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'AuthorizationServicePaginationRequest', - :'sorting_column' => :'AuthorizationServiceAuthorizationFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceListAuthorizationsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceListAuthorizationsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceListAuthorizationsRequest. + class AuthorizationServiceListAuthorizationsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'AuthorizationServicePaginationRequest', + sorting_column: 'AuthorizationServiceAuthorizationFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_list_authorizations_response.rb b/lib/zitadel/client/models/authorization_service_list_authorizations_response.rb index 5a500ab5..bb5a9a2d 100644 --- a/lib/zitadel/client/models/authorization_service_list_authorizations_response.rb +++ b/lib/zitadel/client/models/authorization_service_list_authorizations_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceListAuthorizationsResponse - attr_accessor :pagination - - # Authorizations contains the list of authorizations matching the request. - attr_accessor :authorizations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'authorizations' => :'authorizations' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'AuthorizationServicePaginationResponse', - :'authorizations' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceListAuthorizationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceListAuthorizationsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'authorizations') - if (value = attributes[:'authorizations']).is_a?(Array) - self.authorizations = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - authorizations == o.authorizations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, authorizations].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceListAuthorizationsResponse. + class AuthorizationServiceListAuthorizationsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + authorizations: 'authorizations' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'AuthorizationServicePaginationResponse', + authorizations: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Authorizations contains the list of authorizations matching the request. + # @example null + attribute :authorizations, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_organization.rb b/lib/zitadel/client/models/authorization_service_organization.rb index c1704d73..331705d7 100644 --- a/lib/zitadel/client/models/authorization_service_organization.rb +++ b/lib/zitadel/client/models/authorization_service_organization.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceOrganization - # ID is the unique identifier of the organization. - attr_accessor :id - - # Name is the name of the organization. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceOrganization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceOrganization. + class AuthorizationServiceOrganization < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the organization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Name is the name of the organization. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_pagination_request.rb b/lib/zitadel/client/models/authorization_service_pagination_request.rb index 7bc015c2..ab789819 100644 --- a/lib/zitadel/client/models/authorization_service_pagination_request.rb +++ b/lib/zitadel/client/models/authorization_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServicePaginationRequest. + class AuthorizationServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_pagination_response.rb b/lib/zitadel/client/models/authorization_service_pagination_response.rb index 44443813..8df72725 100644 --- a/lib/zitadel/client/models/authorization_service_pagination_response.rb +++ b/lib/zitadel/client/models/authorization_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServicePaginationResponse. + class AuthorizationServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_project.rb b/lib/zitadel/client/models/authorization_service_project.rb index d5749e2e..4589a171 100644 --- a/lib/zitadel/client/models/authorization_service_project.rb +++ b/lib/zitadel/client/models/authorization_service_project.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceProject - # ID is the unique identifier of the project. - attr_accessor :id - - # Name is the name of the project. - attr_accessor :name - - # OrganizationID is the ID of the organization the project belongs to. This does not have to correspond with the authorizations organization. In case the authorization is given on a granted project, this is the organization that owns the project and granted it. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceProject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceProject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceProject. + class AuthorizationServiceProject < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the project. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Name is the name of the project. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # OrganizationID is the ID of the organization the project belongs to. This does not have to correspond with the authorizations organization. In case the authorization is given on a granted project, this is the organization that owns the project and granted it. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_project_name_query.rb b/lib/zitadel/client/models/authorization_service_project_name_query.rb index 78fb9714..6559eaef 100644 --- a/lib/zitadel/client/models/authorization_service_project_name_query.rb +++ b/lib/zitadel/client/models/authorization_service_project_name_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceProjectNameQuery - # Specify the name of the project the user was granted the authorization for to search for. Note that this will also include authorizations granted for project grants of the same project. - attr_accessor :name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'method' => :'AuthorizationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceProjectNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceProjectNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceProjectNameQuery. + class AuthorizationServiceProjectNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + method: 'AuthorizationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Specify the name of the project the user was granted the authorization for to search for. Note that this will also include authorizations granted for project grants of the same project. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_role.rb b/lib/zitadel/client/models/authorization_service_role.rb index 96e2cb73..16939348 100644 --- a/lib/zitadel/client/models/authorization_service_role.rb +++ b/lib/zitadel/client/models/authorization_service_role.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceRole - # Key is the unique key of the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. - attr_accessor :key - - # Human readable name for the role, which might be displayed to users. - attr_accessor :display_name - - # The group the role belongs to. This is used to group roles in the UI. - attr_accessor :group - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'display_name' => :'displayName', - :'group' => :'group' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'display_name' => :'String', - :'group' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceRole` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceRole`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - display_name == o.display_name && - group == o.group - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, display_name, group].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceRole. + class AuthorizationServiceRole < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + display_name: 'displayName', + group: 'group' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + display_name: 'String', + group: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Key is the unique key of the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # Human readable name for the role, which might be displayed to users. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # The group the role belongs to. This is used to group roles in the UI. + # @example null + attribute :group, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_role_key_query.rb b/lib/zitadel/client/models/authorization_service_role_key_query.rb index f60a67f1..7e1cd49d 100644 --- a/lib/zitadel/client/models/authorization_service_role_key_query.rb +++ b/lib/zitadel/client/models/authorization_service_role_key_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceRoleKeyQuery - # Specify the key of the role the user was granted to search for. - attr_accessor :key - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'method' => :'AuthorizationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceRoleKeyQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceRoleKeyQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceRoleKeyQuery. + class AuthorizationServiceRoleKeyQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + method: 'AuthorizationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Specify the key of the role the user was granted to search for. + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_state.rb b/lib/zitadel/client/models/authorization_service_state.rb index 9ec71c28..93906f3d 100644 --- a/lib/zitadel/client/models/authorization_service_state.rb +++ b/lib/zitadel/client/models/authorization_service_state.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class AuthorizationServiceState - STATE_UNSPECIFIED = "STATE_UNSPECIFIED".freeze - STATE_ACTIVE = "STATE_ACTIVE".freeze - STATE_INACTIVE = "STATE_INACTIVE".freeze - - def self.all_vars - @all_vars ||= [STATE_UNSPECIFIED, STATE_ACTIVE, STATE_INACTIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if AuthorizationServiceState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::AuthorizationServiceState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for AuthorizationServiceState. + class AuthorizationServiceState + STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' + STATE_ACTIVE = 'STATE_ACTIVE' + STATE_INACTIVE = 'STATE_INACTIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [STATE_UNSPECIFIED, STATE_ACTIVE, STATE_INACTIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for AuthorizationServiceState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/authorization_service_state_query.rb b/lib/zitadel/client/models/authorization_service_state_query.rb index 2698a363..f28ea6d1 100644 --- a/lib/zitadel/client/models/authorization_service_state_query.rb +++ b/lib/zitadel/client/models/authorization_service_state_query.rb @@ -1,237 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceStateQuery - attr_accessor :state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'state' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'AuthorizationServiceState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceStateQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceStateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceStateQuery. + class AuthorizationServiceStateQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + state: 'state' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + state: 'AuthorizationServiceState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_text_filter_method.rb b/lib/zitadel/client/models/authorization_service_text_filter_method.rb index 45c99e40..15c3a728 100644 --- a/lib/zitadel/client/models/authorization_service_text_filter_method.rb +++ b/lib/zitadel/client/models/authorization_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class AuthorizationServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for AuthorizationServiceTextFilterMethod. + class AuthorizationServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if AuthorizationServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::AuthorizationServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for AuthorizationServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/authorization_service_update_authorization_request.rb b/lib/zitadel/client/models/authorization_service_update_authorization_request.rb index 55db9b3e..13b3b4ed 100644 --- a/lib/zitadel/client/models/authorization_service_update_authorization_request.rb +++ b/lib/zitadel/client/models/authorization_service_update_authorization_request.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceUpdateAuthorizationRequest - # ID is the unique identifier of the authorization. - attr_accessor :id - - # RoleKeys are the keys of the roles the user should be granted. Note that any role keys previously granted to the user and not present in the list will be revoked. - attr_accessor :role_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'role_keys' => :'roleKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'role_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceUpdateAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceUpdateAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'role_keys') - if (value = attributes[:'role_keys']).is_a?(Array) - self.role_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - role_keys == o.role_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, role_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceUpdateAuthorizationRequest. + class AuthorizationServiceUpdateAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + role_keys: 'roleKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + role_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the authorization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # RoleKeys are the keys of the roles the user should be granted. Note that any role keys previously granted to the user and not present in the list will be revoked. + # @example null + attribute :role_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_update_authorization_response.rb b/lib/zitadel/client/models/authorization_service_update_authorization_response.rb index 2c338ad8..11697a18 100644 --- a/lib/zitadel/client/models/authorization_service_update_authorization_response.rb +++ b/lib/zitadel/client/models/authorization_service_update_authorization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceUpdateAuthorizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceUpdateAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceUpdateAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceUpdateAuthorizationResponse. + class AuthorizationServiceUpdateAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/authorization_service_user.rb b/lib/zitadel/client/models/authorization_service_user.rb index 49b31a5c..2dbaca7a 100644 --- a/lib/zitadel/client/models/authorization_service_user.rb +++ b/lib/zitadel/client/models/authorization_service_user.rb @@ -1,256 +1,94 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceUser - # ID represents the ID of the user who was granted the authorization. - attr_accessor :id - - # PreferredLoginName represents the preferred login name of the granted user. - attr_accessor :preferred_login_name - - # DisplayName represents the public display name of the granted user. - attr_accessor :display_name - - # AvatarURL is the URL to the user's public avatar image. - attr_accessor :avatar_url - - # The organization the user belong to. This does not have to correspond with the authorizations organization. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'preferred_login_name' => :'preferredLoginName', - :'display_name' => :'displayName', - :'avatar_url' => :'avatarUrl', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'preferred_login_name' => :'String', - :'display_name' => :'String', - :'avatar_url' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'avatar_url') - self.avatar_url = attributes[:'avatar_url'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - preferred_login_name == o.preferred_login_name && - display_name == o.display_name && - avatar_url == o.avatar_url && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, preferred_login_name, display_name, avatar_url, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceUser. + class AuthorizationServiceUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + preferred_login_name: 'preferredLoginName', + display_name: 'displayName', + avatar_url: 'avatarUrl', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + preferred_login_name: 'String', + display_name: 'String', + avatar_url: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID represents the ID of the user who was granted the authorization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # PreferredLoginName represents the preferred login name of the granted user. + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # DisplayName represents the public display name of the granted user. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # AvatarURL is the URL to the user's public avatar image. + # @example null + attribute :avatar_url, Types::Any.optional.meta(omittable: true) + # The organization the user belong to. This does not have to correspond with the authorizations organization. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_user_display_name_query.rb b/lib/zitadel/client/models/authorization_service_user_display_name_query.rb index af3819cf..0cbc00a7 100644 --- a/lib/zitadel/client/models/authorization_service_user_display_name_query.rb +++ b/lib/zitadel/client/models/authorization_service_user_display_name_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceUserDisplayNameQuery - # Specify the public display name of the granted user to search for. - attr_accessor :display_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name' => :'displayName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name' => :'String', - :'method' => :'AuthorizationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceUserDisplayNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceUserDisplayNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name == o.display_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceUserDisplayNameQuery. + class AuthorizationServiceUserDisplayNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name: 'displayName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name: 'String', + method: 'AuthorizationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Specify the public display name of the granted user to search for. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/authorization_service_user_preferred_login_name_query.rb b/lib/zitadel/client/models/authorization_service_user_preferred_login_name_query.rb index 4452db0c..b8ac29ea 100644 --- a/lib/zitadel/client/models/authorization_service_user_preferred_login_name_query.rb +++ b/lib/zitadel/client/models/authorization_service_user_preferred_login_name_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class AuthorizationServiceUserPreferredLoginNameQuery - # Specify the preferred login name of the granted user to search for. - attr_accessor :login_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_name' => :'loginName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_name' => :'String', - :'method' => :'AuthorizationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::AuthorizationServiceUserPreferredLoginNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::AuthorizationServiceUserPreferredLoginNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_name') - self.login_name = attributes[:'login_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_name == o.login_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for AuthorizationServiceUserPreferredLoginNameQuery. + class AuthorizationServiceUserPreferredLoginNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_name: 'loginName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_name: 'String', + method: 'AuthorizationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Specify the preferred login name of the granted user to search for. + # @example null + attribute :login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_any.rb b/lib/zitadel/client/models/beta_action_service_any.rb index 3fc6a569..08a98ec8 100644 --- a/lib/zitadel/client/models/beta_action_service_any.rb +++ b/lib/zitadel/client/models/beta_action_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaActionServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaActionServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_condition.rb b/lib/zitadel/client/models/beta_action_service_condition.rb index 7b7af734..c0923f09 100644 --- a/lib/zitadel/client/models/beta_action_service_condition.rb +++ b/lib/zitadel/client/models/beta_action_service_condition.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceCondition - attr_accessor :event - - attr_accessor :function - - attr_accessor :request - - attr_accessor :response - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'event' => :'event', - :'function' => :'function', - :'request' => :'request', - :'response' => :'response' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'event' => :'BetaActionServiceEventExecution', - :'function' => :'BetaActionServiceFunctionExecution', - :'request' => :'BetaActionServiceRequestExecution', - :'response' => :'BetaActionServiceResponseExecution' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceCondition` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceCondition`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'event') - self.event = attributes[:'event'] - end - - if attributes.key?(:'function') - self.function = attributes[:'function'] - end - - if attributes.key?(:'request') - self.request = attributes[:'request'] - end - - if attributes.key?(:'response') - self.response = attributes[:'response'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - event == o.event && - function == o.function && - request == o.request && - response == o.response - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [event, function, request, response].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceCondition. + class BetaActionServiceCondition < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + event: 'event', + function: 'function', + request: 'request', + response: 'response' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + event: 'BetaActionServiceEventExecution', + function: 'BetaActionServiceFunctionExecution', + request: 'BetaActionServiceRequestExecution', + response: 'BetaActionServiceResponseExecution' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :event, Types::Any.optional.meta(omittable: true) + # @example null + attribute :function, Types::Any.optional.meta(omittable: true) + # @example null + attribute :request, Types::Any.optional.meta(omittable: true) + # @example null + attribute :response, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_connect_error.rb b/lib/zitadel/client/models/beta_action_service_connect_error.rb index 441de5a2..dc5e27dc 100644 --- a/lib/zitadel/client/models/beta_action_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_action_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaActionServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaActionServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_create_target_request.rb b/lib/zitadel/client/models/beta_action_service_create_target_request.rb index c9043901..a4b47dca 100644 --- a/lib/zitadel/client/models/beta_action_service_create_target_request.rb +++ b/lib/zitadel/client/models/beta_action_service_create_target_request.rb @@ -1,261 +1,94 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceCreateTargetRequest - attr_accessor :name - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :timeout - - attr_accessor :endpoint - - attr_accessor :rest_async - - attr_accessor :rest_call - - attr_accessor :rest_webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'timeout' => :'timeout', - :'endpoint' => :'endpoint', - :'rest_async' => :'restAsync', - :'rest_call' => :'restCall', - :'rest_webhook' => :'restWebhook' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'timeout' => :'String', - :'endpoint' => :'String', - :'rest_async' => :'Object', - :'rest_call' => :'BetaActionServiceRESTCall', - :'rest_webhook' => :'BetaActionServiceRESTWebhook' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceCreateTargetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceCreateTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'endpoint') - self.endpoint = attributes[:'endpoint'] - end - - if attributes.key?(:'rest_async') - self.rest_async = attributes[:'rest_async'] - end - - if attributes.key?(:'rest_call') - self.rest_call = attributes[:'rest_call'] - end - - if attributes.key?(:'rest_webhook') - self.rest_webhook = attributes[:'rest_webhook'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - timeout == o.timeout && - endpoint == o.endpoint && - rest_async == o.rest_async && - rest_call == o.rest_call && - rest_webhook == o.rest_webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, timeout, endpoint, rest_async, rest_call, rest_webhook].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceCreateTargetRequest. + class BetaActionServiceCreateTargetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + timeout: 'timeout', + endpoint: 'endpoint', + rest_async: 'restAsync', + rest_call: 'restCall', + rest_webhook: 'restWebhook' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + timeout: 'ISO8601::Duration', + endpoint: 'String', + rest_async: 'Object', + rest_call: 'BetaActionServiceRESTCall', + rest_webhook: 'BetaActionServiceRESTWebhook' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :timeout, Types::Any.optional.meta(omittable: true) + # @example null + attribute :endpoint, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_async, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_call, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_webhook, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_create_target_response.rb b/lib/zitadel/client/models/beta_action_service_create_target_response.rb index 90b0d005..5728d2a8 100644 --- a/lib/zitadel/client/models/beta_action_service_create_target_response.rb +++ b/lib/zitadel/client/models/beta_action_service_create_target_response.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceCreateTargetResponse - # The unique identifier of the newly created target. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Key used to sign and check payload sent to the target. - attr_accessor :signing_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'signing_key' => :'signingKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'signing_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceCreateTargetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceCreateTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'signing_key') - self.signing_key = attributes[:'signing_key'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - signing_key == o.signing_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, signing_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceCreateTargetResponse. + class BetaActionServiceCreateTargetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + signing_key: 'signingKey' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + signing_key: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the newly created target. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # Key used to sign and check payload sent to the target. + # @example null + attribute :signing_key, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_delete_target_request.rb b/lib/zitadel/client/models/beta_action_service_delete_target_request.rb index f08ea53f..a33a6916 100644 --- a/lib/zitadel/client/models/beta_action_service_delete_target_request.rb +++ b/lib/zitadel/client/models/beta_action_service_delete_target_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceDeleteTargetRequest - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceDeleteTargetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceDeleteTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceDeleteTargetRequest. + class BetaActionServiceDeleteTargetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_delete_target_response.rb b/lib/zitadel/client/models/beta_action_service_delete_target_response.rb index d16fc491..3644923f 100644 --- a/lib/zitadel/client/models/beta_action_service_delete_target_response.rb +++ b/lib/zitadel/client/models/beta_action_service_delete_target_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceDeleteTargetResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceDeleteTargetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceDeleteTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceDeleteTargetResponse. + class BetaActionServiceDeleteTargetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_event_execution.rb b/lib/zitadel/client/models/beta_action_service_event_execution.rb index a3faf69e..6606dd67 100644 --- a/lib/zitadel/client/models/beta_action_service_event_execution.rb +++ b/lib/zitadel/client/models/beta_action_service_event_execution.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceEventExecution - # all events as condition. - attr_accessor :all - - # Event name as condition. - attr_accessor :event - - # Event group as condition, all events under this group. - attr_accessor :group - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'all' => :'all', - :'event' => :'event', - :'group' => :'group' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'all' => :'Boolean', - :'event' => :'String', - :'group' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceEventExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceEventExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'all') - self.all = attributes[:'all'] - end - - if attributes.key?(:'event') - self.event = attributes[:'event'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - all == o.all && - event == o.event && - group == o.group - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [all, event, group].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceEventExecution. + class BetaActionServiceEventExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + all: 'all', + event: 'event', + group: 'group' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + all: 'Boolean', + event: 'String', + group: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # all events as condition. + # @example null + attribute :all, Types::Any.optional.meta(omittable: true) + # Event name as condition. + # @example null + attribute :event, Types::Any.optional.meta(omittable: true) + # Event group as condition, all events under this group. + # @example null + attribute :group, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_execution.rb b/lib/zitadel/client/models/beta_action_service_execution.rb index 970e1080..6be2e31c 100644 --- a/lib/zitadel/client/models/beta_action_service_execution.rb +++ b/lib/zitadel/client/models/beta_action_service_execution.rb @@ -1,247 +1,88 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceExecution - attr_accessor :condition - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Ordered list of targets called during the execution. - attr_accessor :targets - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'condition' => :'condition', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'targets' => :'targets' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'condition' => :'BetaActionServiceCondition', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'targets' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'targets') - if (value = attributes[:'targets']).is_a?(Array) - self.targets = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - condition == o.condition && - creation_date == o.creation_date && - change_date == o.change_date && - targets == o.targets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [condition, creation_date, change_date, targets].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceExecution. + class BetaActionServiceExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + condition: 'condition', + creation_date: 'creationDate', + change_date: 'changeDate', + targets: 'targets' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + condition: 'BetaActionServiceCondition', + creation_date: 'Time', + change_date: 'Time', + targets: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :condition, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # Ordered list of targets called during the execution. + # @example null + attribute :targets, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_execution_field_name.rb b/lib/zitadel/client/models/beta_action_service_execution_field_name.rb index 09de6655..a243cb8e 100644 --- a/lib/zitadel/client/models/beta_action_service_execution_field_name.rb +++ b/lib/zitadel/client/models/beta_action_service_execution_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaActionServiceExecutionFieldName - EXECUTION_FIELD_NAME_UNSPECIFIED = "EXECUTION_FIELD_NAME_UNSPECIFIED".freeze - EXECUTION_FIELD_NAME_ID = "EXECUTION_FIELD_NAME_ID".freeze - EXECUTION_FIELD_NAME_CREATED_DATE = "EXECUTION_FIELD_NAME_CREATED_DATE".freeze - EXECUTION_FIELD_NAME_CHANGED_DATE = "EXECUTION_FIELD_NAME_CHANGED_DATE".freeze - - def self.all_vars - @all_vars ||= [EXECUTION_FIELD_NAME_UNSPECIFIED, EXECUTION_FIELD_NAME_ID, EXECUTION_FIELD_NAME_CREATED_DATE, EXECUTION_FIELD_NAME_CHANGED_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaActionServiceExecutionFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaActionServiceExecutionFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaActionServiceExecutionFieldName. + class BetaActionServiceExecutionFieldName + EXECUTION_FIELD_NAME_UNSPECIFIED = 'EXECUTION_FIELD_NAME_UNSPECIFIED' + EXECUTION_FIELD_NAME_ID = 'EXECUTION_FIELD_NAME_ID' + EXECUTION_FIELD_NAME_CREATED_DATE = 'EXECUTION_FIELD_NAME_CREATED_DATE' + EXECUTION_FIELD_NAME_CHANGED_DATE = 'EXECUTION_FIELD_NAME_CHANGED_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [EXECUTION_FIELD_NAME_UNSPECIFIED, EXECUTION_FIELD_NAME_ID, EXECUTION_FIELD_NAME_CREATED_DATE, EXECUTION_FIELD_NAME_CHANGED_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaActionServiceExecutionFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_action_service_execution_search_filter.rb b/lib/zitadel/client/models/beta_action_service_execution_search_filter.rb index 0e401af3..faaa94d9 100644 --- a/lib/zitadel/client/models/beta_action_service_execution_search_filter.rb +++ b/lib/zitadel/client/models/beta_action_service_execution_search_filter.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceExecutionSearchFilter - attr_accessor :execution_type_filter - - attr_accessor :in_conditions_filter - - attr_accessor :target_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'execution_type_filter' => :'executionTypeFilter', - :'in_conditions_filter' => :'inConditionsFilter', - :'target_filter' => :'targetFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'execution_type_filter' => :'BetaActionServiceExecutionTypeFilter', - :'in_conditions_filter' => :'BetaActionServiceInConditionsFilter', - :'target_filter' => :'BetaActionServiceTargetFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceExecutionSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceExecutionSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'execution_type_filter') - self.execution_type_filter = attributes[:'execution_type_filter'] - end - - if attributes.key?(:'in_conditions_filter') - self.in_conditions_filter = attributes[:'in_conditions_filter'] - end - - if attributes.key?(:'target_filter') - self.target_filter = attributes[:'target_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - execution_type_filter == o.execution_type_filter && - in_conditions_filter == o.in_conditions_filter && - target_filter == o.target_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [execution_type_filter, in_conditions_filter, target_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceExecutionSearchFilter. + class BetaActionServiceExecutionSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + execution_type_filter: 'executionTypeFilter', + in_conditions_filter: 'inConditionsFilter', + target_filter: 'targetFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + execution_type_filter: 'BetaActionServiceExecutionTypeFilter', + in_conditions_filter: 'BetaActionServiceInConditionsFilter', + target_filter: 'BetaActionServiceTargetFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :execution_type_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_conditions_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :target_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_execution_type.rb b/lib/zitadel/client/models/beta_action_service_execution_type.rb index 6f8f6ba1..8eab5d49 100644 --- a/lib/zitadel/client/models/beta_action_service_execution_type.rb +++ b/lib/zitadel/client/models/beta_action_service_execution_type.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaActionServiceExecutionType - EXECUTION_TYPE_UNSPECIFIED = "EXECUTION_TYPE_UNSPECIFIED".freeze - EXECUTION_TYPE_REQUEST = "EXECUTION_TYPE_REQUEST".freeze - EXECUTION_TYPE_RESPONSE = "EXECUTION_TYPE_RESPONSE".freeze - EXECUTION_TYPE_EVENT = "EXECUTION_TYPE_EVENT".freeze - EXECUTION_TYPE_FUNCTION = "EXECUTION_TYPE_FUNCTION".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaActionServiceExecutionType. + class BetaActionServiceExecutionType + EXECUTION_TYPE_UNSPECIFIED = 'EXECUTION_TYPE_UNSPECIFIED' + EXECUTION_TYPE_REQUEST = 'EXECUTION_TYPE_REQUEST' + EXECUTION_TYPE_RESPONSE = 'EXECUTION_TYPE_RESPONSE' + EXECUTION_TYPE_EVENT = 'EXECUTION_TYPE_EVENT' + EXECUTION_TYPE_FUNCTION = 'EXECUTION_TYPE_FUNCTION' - def self.all_vars - @all_vars ||= [EXECUTION_TYPE_UNSPECIFIED, EXECUTION_TYPE_REQUEST, EXECUTION_TYPE_RESPONSE, EXECUTION_TYPE_EVENT, EXECUTION_TYPE_FUNCTION].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [EXECUTION_TYPE_UNSPECIFIED, EXECUTION_TYPE_REQUEST, EXECUTION_TYPE_RESPONSE, EXECUTION_TYPE_EVENT, EXECUTION_TYPE_FUNCTION].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaActionServiceExecutionType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaActionServiceExecutionType" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaActionServiceExecutionType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_action_service_execution_type_filter.rb b/lib/zitadel/client/models/beta_action_service_execution_type_filter.rb index d5e03b98..3a8f8af2 100644 --- a/lib/zitadel/client/models/beta_action_service_execution_type_filter.rb +++ b/lib/zitadel/client/models/beta_action_service_execution_type_filter.rb @@ -1,237 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceExecutionTypeFilter - attr_accessor :execution_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'execution_type' => :'executionType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'execution_type' => :'BetaActionServiceExecutionType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceExecutionTypeFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceExecutionTypeFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'execution_type') - self.execution_type = attributes[:'execution_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - execution_type == o.execution_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [execution_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceExecutionTypeFilter. + class BetaActionServiceExecutionTypeFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + execution_type: 'executionType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + execution_type: 'BetaActionServiceExecutionType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :execution_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_function_execution.rb b/lib/zitadel/client/models/beta_action_service_function_execution.rb index d7f92758..805a241b 100644 --- a/lib/zitadel/client/models/beta_action_service_function_execution.rb +++ b/lib/zitadel/client/models/beta_action_service_function_execution.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Executed on the specified function - class BetaActionServiceFunctionExecution - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceFunctionExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceFunctionExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Executed on the specified function + class BetaActionServiceFunctionExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_get_target_request.rb b/lib/zitadel/client/models/beta_action_service_get_target_request.rb index 028cbeb9..885c12e3 100644 --- a/lib/zitadel/client/models/beta_action_service_get_target_request.rb +++ b/lib/zitadel/client/models/beta_action_service_get_target_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceGetTargetRequest - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceGetTargetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceGetTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceGetTargetRequest. + class BetaActionServiceGetTargetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_get_target_response.rb b/lib/zitadel/client/models/beta_action_service_get_target_response.rb index 0b596990..2f4c766b 100644 --- a/lib/zitadel/client/models/beta_action_service_get_target_response.rb +++ b/lib/zitadel/client/models/beta_action_service_get_target_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceGetTargetResponse - attr_accessor :target - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target' => :'target' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target' => :'BetaActionServiceTarget' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceGetTargetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceGetTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target') - self.target = attributes[:'target'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target == o.target - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceGetTargetResponse. + class BetaActionServiceGetTargetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target: 'target' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target: 'BetaActionServiceTarget' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :target, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_in_conditions_filter.rb b/lib/zitadel/client/models/beta_action_service_in_conditions_filter.rb index 2a5811ab..9c62facc 100644 --- a/lib/zitadel/client/models/beta_action_service_in_conditions_filter.rb +++ b/lib/zitadel/client/models/beta_action_service_in_conditions_filter.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceInConditionsFilter - # Defines the conditions to query for. - attr_accessor :conditions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'conditions' => :'conditions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'conditions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceInConditionsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceInConditionsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'conditions') - if (value = attributes[:'conditions']).is_a?(Array) - self.conditions = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - conditions == o.conditions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [conditions].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceInConditionsFilter. + class BetaActionServiceInConditionsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + conditions: 'conditions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + conditions: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Defines the conditions to query for. + # @example null + attribute :conditions, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_in_target_i_ds_filter.rb b/lib/zitadel/client/models/beta_action_service_in_target_i_ds_filter.rb deleted file mode 100644 index 98795078..00000000 --- a/lib/zitadel/client/models/beta_action_service_in_target_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaActionServiceInTargetIDsFilter - # Defines the ids to query for. - attr_accessor :target_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_ids' => :'targetIds' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceInTargetIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceInTargetIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_ids') - if (value = attributes[:'target_ids']).is_a?(Array) - self.target_ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_ids == o.target_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_action_service_in_target_ids_filter.rb b/lib/zitadel/client/models/beta_action_service_in_target_ids_filter.rb new file mode 100644 index 00000000..c3b7c661 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_in_target_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceInTargetIDsFilter. + class BetaActionServiceInTargetIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_ids: 'targetIds' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :target_ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_action_service_list_execution_functions_response.rb b/lib/zitadel/client/models/beta_action_service_list_execution_functions_response.rb index e74f4885..bfb08a92 100644 --- a/lib/zitadel/client/models/beta_action_service_list_execution_functions_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_execution_functions_response.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceListExecutionFunctionsResponse - # All available methods - attr_accessor :functions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'functions' => :'functions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'functions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionFunctionsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionFunctionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'functions') - if (value = attributes[:'functions']).is_a?(Array) - self.functions = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - functions == o.functions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [functions].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceListExecutionFunctionsResponse. + class BetaActionServiceListExecutionFunctionsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + functions: 'functions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + functions: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # All available methods + # @example null + attribute :functions, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_list_execution_methods_response.rb b/lib/zitadel/client/models/beta_action_service_list_execution_methods_response.rb index 027ac965..a9630df3 100644 --- a/lib/zitadel/client/models/beta_action_service_list_execution_methods_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_execution_methods_response.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceListExecutionMethodsResponse - # All available methods - attr_accessor :methods - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'methods' => :'methods' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'methods' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionMethodsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionMethodsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'methods') - if (value = attributes[:'methods']).is_a?(Array) - self.methods = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - methods == o.methods - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [methods].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceListExecutionMethodsResponse. + class BetaActionServiceListExecutionMethodsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + methods: 'methods' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + methods: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # All available methods + # @example null + attribute :methods, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_list_execution_services_response.rb b/lib/zitadel/client/models/beta_action_service_list_execution_services_response.rb index 4d6ab402..466a0b65 100644 --- a/lib/zitadel/client/models/beta_action_service_list_execution_services_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_execution_services_response.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceListExecutionServicesResponse - # All available methods - attr_accessor :services - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'services' => :'services' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'services' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionServicesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionServicesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'services') - if (value = attributes[:'services']).is_a?(Array) - self.services = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - services == o.services - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [services].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceListExecutionServicesResponse. + class BetaActionServiceListExecutionServicesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + services: 'services' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + services: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # All available methods + # @example null + attribute :services, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_list_executions_request.rb b/lib/zitadel/client/models/beta_action_service_list_executions_request.rb index a1e6470b..45f51e08 100644 --- a/lib/zitadel/client/models/beta_action_service_list_executions_request.rb +++ b/lib/zitadel/client/models/beta_action_service_list_executions_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceListExecutionsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaActionServicePaginationRequest', - :'sorting_column' => :'BetaActionServiceExecutionFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceListExecutionsRequest. + class BetaActionServiceListExecutionsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaActionServicePaginationRequest', + sorting_column: 'BetaActionServiceExecutionFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_list_executions_response.rb b/lib/zitadel/client/models/beta_action_service_list_executions_response.rb index 26e705e2..f79caaf5 100644 --- a/lib/zitadel/client/models/beta_action_service_list_executions_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_executions_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceListExecutionsResponse - attr_accessor :pagination - - attr_accessor :executions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'executions' => :'executions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaActionServicePaginationResponse', - :'executions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListExecutionsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListExecutionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'executions') - if (value = attributes[:'executions']).is_a?(Array) - self.executions = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - executions == o.executions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, executions].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceListExecutionsResponse. + class BetaActionServiceListExecutionsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + executions: 'executions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaActionServicePaginationResponse', + executions: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :executions, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_list_targets_request.rb b/lib/zitadel/client/models/beta_action_service_list_targets_request.rb index 6b5547ad..c31c3b91 100644 --- a/lib/zitadel/client/models/beta_action_service_list_targets_request.rb +++ b/lib/zitadel/client/models/beta_action_service_list_targets_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceListTargetsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaActionServicePaginationRequest', - :'sorting_column' => :'BetaActionServiceTargetFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListTargetsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListTargetsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceListTargetsRequest. + class BetaActionServiceListTargetsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaActionServicePaginationRequest', + sorting_column: 'BetaActionServiceTargetFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_list_targets_response.rb b/lib/zitadel/client/models/beta_action_service_list_targets_response.rb index e5815a98..d7321a6c 100644 --- a/lib/zitadel/client/models/beta_action_service_list_targets_response.rb +++ b/lib/zitadel/client/models/beta_action_service_list_targets_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceListTargetsResponse - attr_accessor :pagination - - attr_accessor :targets - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'targets' => :'targets' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaActionServicePaginationResponse', - :'targets' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceListTargetsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceListTargetsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'targets') - if (value = attributes[:'targets']).is_a?(Array) - self.targets = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - targets == o.targets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, targets].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceListTargetsResponse. + class BetaActionServiceListTargetsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + targets: 'targets' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaActionServicePaginationResponse', + targets: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :targets, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_pagination_request.rb b/lib/zitadel/client/models/beta_action_service_pagination_request.rb index ada415ca..411aa007 100644 --- a/lib/zitadel/client/models/beta_action_service_pagination_request.rb +++ b/lib/zitadel/client/models/beta_action_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServicePaginationRequest. + class BetaActionServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_pagination_response.rb b/lib/zitadel/client/models/beta_action_service_pagination_response.rb index 6527f2f6..1dce9553 100644 --- a/lib/zitadel/client/models/beta_action_service_pagination_response.rb +++ b/lib/zitadel/client/models/beta_action_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServicePaginationResponse. + class BetaActionServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_r_e_s_t_call.rb b/lib/zitadel/client/models/beta_action_service_r_e_s_t_call.rb deleted file mode 100644 index ccb6d39e..00000000 --- a/lib/zitadel/client/models/beta_action_service_r_e_s_t_call.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaActionServiceRESTCall - # Define if any error stops the whole execution. By default the process continues as normal. - attr_accessor :interrupt_on_error - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'interrupt_on_error' => :'interruptOnError' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'interrupt_on_error' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceRESTCall` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceRESTCall`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'interrupt_on_error') - self.interrupt_on_error = attributes[:'interrupt_on_error'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - interrupt_on_error == o.interrupt_on_error - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [interrupt_on_error].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_action_service_r_e_s_t_webhook.rb b/lib/zitadel/client/models/beta_action_service_r_e_s_t_webhook.rb deleted file mode 100644 index ba39d36b..00000000 --- a/lib/zitadel/client/models/beta_action_service_r_e_s_t_webhook.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaActionServiceRESTWebhook - # Define if any error stops the whole execution. By default the process continues as normal. - attr_accessor :interrupt_on_error - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'interrupt_on_error' => :'interruptOnError' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'interrupt_on_error' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceRESTWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceRESTWebhook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'interrupt_on_error') - self.interrupt_on_error = attributes[:'interrupt_on_error'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - interrupt_on_error == o.interrupt_on_error - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [interrupt_on_error].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_action_service_request_execution.rb b/lib/zitadel/client/models/beta_action_service_request_execution.rb index f97c4f21..26d8afc6 100644 --- a/lib/zitadel/client/models/beta_action_service_request_execution.rb +++ b/lib/zitadel/client/models/beta_action_service_request_execution.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceRequestExecution - # All calls to any available services and methods as condition. - attr_accessor :all - - # GRPC-method as condition. - attr_accessor :method - - # GRPC-service as condition. - attr_accessor :service - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'all' => :'all', - :'method' => :'method', - :'service' => :'service' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'all' => :'Boolean', - :'method' => :'String', - :'service' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceRequestExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceRequestExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'all') - self.all = attributes[:'all'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - - if attributes.key?(:'service') - self.service = attributes[:'service'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - all == o.all && - method == o.method && - service == o.service - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [all, method, service].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceRequestExecution. + class BetaActionServiceRequestExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + all: 'all', + method: 'method', + service: 'service' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + all: 'Boolean', + method: 'String', + service: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # All calls to any available services and methods as condition. + # @example null + attribute :all, Types::Any.optional.meta(omittable: true) + # GRPC-method as condition. + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) + # GRPC-service as condition. + # @example null + attribute :service, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_response_execution.rb b/lib/zitadel/client/models/beta_action_service_response_execution.rb index 74ab3596..7f2cb4dc 100644 --- a/lib/zitadel/client/models/beta_action_service_response_execution.rb +++ b/lib/zitadel/client/models/beta_action_service_response_execution.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceResponseExecution - # All calls to any available services and methods as condition. - attr_accessor :all - - # GRPC-method as condition. - attr_accessor :method - - # GRPC-service as condition. - attr_accessor :service - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'all' => :'all', - :'method' => :'method', - :'service' => :'service' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'all' => :'Boolean', - :'method' => :'String', - :'service' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceResponseExecution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceResponseExecution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'all') - self.all = attributes[:'all'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - - if attributes.key?(:'service') - self.service = attributes[:'service'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - all == o.all && - method == o.method && - service == o.service - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [all, method, service].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceResponseExecution. + class BetaActionServiceResponseExecution < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + all: 'all', + method: 'method', + service: 'service' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + all: 'Boolean', + method: 'String', + service: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # All calls to any available services and methods as condition. + # @example null + attribute :all, Types::Any.optional.meta(omittable: true) + # GRPC-method as condition. + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) + # GRPC-service as condition. + # @example null + attribute :service, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_rest_call.rb b/lib/zitadel/client/models/beta_action_service_rest_call.rb new file mode 100644 index 00000000..ca32f708 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_rest_call.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceRESTCall. + class BetaActionServiceRESTCall < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + interrupt_on_error: 'interruptOnError' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + interrupt_on_error: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Define if any error stops the whole execution. By default the process continues as normal. + # @example null + attribute :interrupt_on_error, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_action_service_rest_webhook.rb b/lib/zitadel/client/models/beta_action_service_rest_webhook.rb new file mode 100644 index 00000000..e855b728 --- /dev/null +++ b/lib/zitadel/client/models/beta_action_service_rest_webhook.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceRESTWebhook. + class BetaActionServiceRESTWebhook < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + interrupt_on_error: 'interruptOnError' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + interrupt_on_error: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Define if any error stops the whole execution. By default the process continues as normal. + # @example null + attribute :interrupt_on_error, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_action_service_set_execution_request.rb b/lib/zitadel/client/models/beta_action_service_set_execution_request.rb index d633a368..50473b3e 100644 --- a/lib/zitadel/client/models/beta_action_service_set_execution_request.rb +++ b/lib/zitadel/client/models/beta_action_service_set_execution_request.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceSetExecutionRequest - attr_accessor :condition - - # Ordered list of targets called during the execution. - attr_accessor :targets - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'condition' => :'condition', - :'targets' => :'targets' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'condition' => :'BetaActionServiceCondition', - :'targets' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceSetExecutionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceSetExecutionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'condition') - self.condition = attributes[:'condition'] - end - - if attributes.key?(:'targets') - if (value = attributes[:'targets']).is_a?(Array) - self.targets = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - condition == o.condition && - targets == o.targets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [condition, targets].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceSetExecutionRequest. + class BetaActionServiceSetExecutionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + condition: 'condition', + targets: 'targets' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + condition: 'BetaActionServiceCondition', + targets: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :condition, Types::Any.optional.meta(omittable: true) + # Ordered list of targets called during the execution. + # @example null + attribute :targets, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_set_execution_response.rb b/lib/zitadel/client/models/beta_action_service_set_execution_response.rb index 26af15a2..ce195a90 100644 --- a/lib/zitadel/client/models/beta_action_service_set_execution_response.rb +++ b/lib/zitadel/client/models/beta_action_service_set_execution_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceSetExecutionResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :set_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'set_date' => :'setDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'set_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceSetExecutionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceSetExecutionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'set_date') - self.set_date = attributes[:'set_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - set_date == o.set_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [set_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceSetExecutionResponse. + class BetaActionServiceSetExecutionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + set_date: 'setDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + set_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :set_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_target.rb b/lib/zitadel/client/models/beta_action_service_target.rb index 31b5c52c..1ba043cc 100644 --- a/lib/zitadel/client/models/beta_action_service_target.rb +++ b/lib/zitadel/client/models/beta_action_service_target.rb @@ -1,300 +1,113 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceTarget - # The unique identifier of the target. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :name - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :timeout - - attr_accessor :endpoint - - attr_accessor :signing_key - - attr_accessor :rest_async - - attr_accessor :rest_call - - attr_accessor :rest_webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'name' => :'name', - :'timeout' => :'timeout', - :'endpoint' => :'endpoint', - :'signing_key' => :'signingKey', - :'rest_async' => :'restAsync', - :'rest_call' => :'restCall', - :'rest_webhook' => :'restWebhook' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'name' => :'String', - :'timeout' => :'String', - :'endpoint' => :'String', - :'signing_key' => :'String', - :'rest_async' => :'Object', - :'rest_call' => :'BetaActionServiceRESTCall', - :'rest_webhook' => :'BetaActionServiceRESTWebhook' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceTarget` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceTarget`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'endpoint') - self.endpoint = attributes[:'endpoint'] - end - - if attributes.key?(:'signing_key') - self.signing_key = attributes[:'signing_key'] - end - - if attributes.key?(:'rest_async') - self.rest_async = attributes[:'rest_async'] - end - - if attributes.key?(:'rest_call') - self.rest_call = attributes[:'rest_call'] - end - - if attributes.key?(:'rest_webhook') - self.rest_webhook = attributes[:'rest_webhook'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - change_date == o.change_date && - name == o.name && - timeout == o.timeout && - endpoint == o.endpoint && - signing_key == o.signing_key && - rest_async == o.rest_async && - rest_call == o.rest_call && - rest_webhook == o.rest_webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, change_date, name, timeout, endpoint, signing_key, rest_async, rest_call, rest_webhook].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceTarget. + class BetaActionServiceTarget < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + change_date: 'changeDate', + name: 'name', + timeout: 'timeout', + endpoint: 'endpoint', + signing_key: 'signingKey', + rest_async: 'restAsync', + rest_call: 'restCall', + rest_webhook: 'restWebhook' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + change_date: 'Time', + name: 'String', + timeout: 'ISO8601::Duration', + endpoint: 'String', + signing_key: 'String', + rest_async: 'Object', + rest_call: 'BetaActionServiceRESTCall', + rest_webhook: 'BetaActionServiceRESTWebhook' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the target. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :timeout, Types::Any.optional.meta(omittable: true) + # @example null + attribute :endpoint, Types::Any.optional.meta(omittable: true) + # @example null + attribute :signing_key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_async, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_call, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_webhook, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_target_field_name.rb b/lib/zitadel/client/models/beta_action_service_target_field_name.rb index 2fc05df2..9701c15b 100644 --- a/lib/zitadel/client/models/beta_action_service_target_field_name.rb +++ b/lib/zitadel/client/models/beta_action_service_target_field_name.rb @@ -1,48 +1,68 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaActionServiceTargetFieldName - TARGET_FIELD_NAME_UNSPECIFIED = "TARGET_FIELD_NAME_UNSPECIFIED".freeze - TARGET_FIELD_NAME_ID = "TARGET_FIELD_NAME_ID".freeze - TARGET_FIELD_NAME_CREATED_DATE = "TARGET_FIELD_NAME_CREATED_DATE".freeze - TARGET_FIELD_NAME_CHANGED_DATE = "TARGET_FIELD_NAME_CHANGED_DATE".freeze - TARGET_FIELD_NAME_NAME = "TARGET_FIELD_NAME_NAME".freeze - TARGET_FIELD_NAME_TARGET_TYPE = "TARGET_FIELD_NAME_TARGET_TYPE".freeze - TARGET_FIELD_NAME_URL = "TARGET_FIELD_NAME_URL".freeze - TARGET_FIELD_NAME_TIMEOUT = "TARGET_FIELD_NAME_TIMEOUT".freeze - TARGET_FIELD_NAME_INTERRUPT_ON_ERROR = "TARGET_FIELD_NAME_INTERRUPT_ON_ERROR".freeze - - def self.all_vars - @all_vars ||= [TARGET_FIELD_NAME_UNSPECIFIED, TARGET_FIELD_NAME_ID, TARGET_FIELD_NAME_CREATED_DATE, TARGET_FIELD_NAME_CHANGED_DATE, TARGET_FIELD_NAME_NAME, TARGET_FIELD_NAME_TARGET_TYPE, TARGET_FIELD_NAME_URL, TARGET_FIELD_NAME_TIMEOUT, TARGET_FIELD_NAME_INTERRUPT_ON_ERROR].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaActionServiceTargetFieldName. + class BetaActionServiceTargetFieldName + TARGET_FIELD_NAME_UNSPECIFIED = 'TARGET_FIELD_NAME_UNSPECIFIED' + TARGET_FIELD_NAME_ID = 'TARGET_FIELD_NAME_ID' + TARGET_FIELD_NAME_CREATED_DATE = 'TARGET_FIELD_NAME_CREATED_DATE' + TARGET_FIELD_NAME_CHANGED_DATE = 'TARGET_FIELD_NAME_CHANGED_DATE' + TARGET_FIELD_NAME_NAME = 'TARGET_FIELD_NAME_NAME' + TARGET_FIELD_NAME_TARGET_TYPE = 'TARGET_FIELD_NAME_TARGET_TYPE' + TARGET_FIELD_NAME_URL = 'TARGET_FIELD_NAME_URL' + TARGET_FIELD_NAME_TIMEOUT = 'TARGET_FIELD_NAME_TIMEOUT' + TARGET_FIELD_NAME_INTERRUPT_ON_ERROR = 'TARGET_FIELD_NAME_INTERRUPT_ON_ERROR' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TARGET_FIELD_NAME_UNSPECIFIED, TARGET_FIELD_NAME_ID, TARGET_FIELD_NAME_CREATED_DATE, TARGET_FIELD_NAME_CHANGED_DATE, TARGET_FIELD_NAME_NAME, TARGET_FIELD_NAME_TARGET_TYPE, TARGET_FIELD_NAME_URL, TARGET_FIELD_NAME_TIMEOUT, TARGET_FIELD_NAME_INTERRUPT_ON_ERROR].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaActionServiceTargetFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaActionServiceTargetFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaActionServiceTargetFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_action_service_target_filter.rb b/lib/zitadel/client/models/beta_action_service_target_filter.rb index 22a9bf59..019fdeec 100644 --- a/lib/zitadel/client/models/beta_action_service_target_filter.rb +++ b/lib/zitadel/client/models/beta_action_service_target_filter.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceTargetFilter - # Defines the id to query for. - attr_accessor :target_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_id' => :'targetId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceTargetFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceTargetFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_id') - self.target_id = attributes[:'target_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_id == o.target_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceTargetFilter. + class BetaActionServiceTargetFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_id: 'targetId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Defines the id to query for. + # @example null + attribute :target_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_target_name_filter.rb b/lib/zitadel/client/models/beta_action_service_target_name_filter.rb index 20b7fae8..ceeca503 100644 --- a/lib/zitadel/client/models/beta_action_service_target_name_filter.rb +++ b/lib/zitadel/client/models/beta_action_service_target_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceTargetNameFilter - # Defines the name of the target to query for. - attr_accessor :target_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'target_name' => :'targetName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'target_name' => :'String', - :'method' => :'BetaActionServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceTargetNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceTargetNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'target_name') - self.target_name = attributes[:'target_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - target_name == o.target_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [target_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceTargetNameFilter. + class BetaActionServiceTargetNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + target_name: 'targetName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + target_name: 'String', + method: 'BetaActionServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Defines the name of the target to query for. + # @example null + attribute :target_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_target_search_filter.rb b/lib/zitadel/client/models/beta_action_service_target_search_filter.rb index bd6a6f5f..40e29161 100644 --- a/lib/zitadel/client/models/beta_action_service_target_search_filter.rb +++ b/lib/zitadel/client/models/beta_action_service_target_search_filter.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceTargetSearchFilter - attr_accessor :in_target_ids_filter - - attr_accessor :target_name_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'in_target_ids_filter' => :'inTargetIdsFilter', - :'target_name_filter' => :'targetNameFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'in_target_ids_filter' => :'BetaActionServiceInTargetIDsFilter', - :'target_name_filter' => :'BetaActionServiceTargetNameFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceTargetSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceTargetSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'in_target_ids_filter') - self.in_target_ids_filter = attributes[:'in_target_ids_filter'] - end - - if attributes.key?(:'target_name_filter') - self.target_name_filter = attributes[:'target_name_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - in_target_ids_filter == o.in_target_ids_filter && - target_name_filter == o.target_name_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [in_target_ids_filter, target_name_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceTargetSearchFilter. + class BetaActionServiceTargetSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + in_target_ids_filter: 'inTargetIdsFilter', + target_name_filter: 'targetNameFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + in_target_ids_filter: 'BetaActionServiceInTargetIDsFilter', + target_name_filter: 'BetaActionServiceTargetNameFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :in_target_ids_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :target_name_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_action_service_text_filter_method.rb b/lib/zitadel/client/models/beta_action_service_text_filter_method.rb index e49c9a40..7d776631 100644 --- a/lib/zitadel/client/models/beta_action_service_text_filter_method.rb +++ b/lib/zitadel/client/models/beta_action_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaActionServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaActionServiceTextFilterMethod. + class BetaActionServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaActionServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaActionServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaActionServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_action_service_update_target_request.rb b/lib/zitadel/client/models/beta_action_service_update_target_request.rb index 74cdf650..5064b082 100644 --- a/lib/zitadel/client/models/beta_action_service_update_target_request.rb +++ b/lib/zitadel/client/models/beta_action_service_update_target_request.rb @@ -1,282 +1,103 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceUpdateTargetRequest - attr_accessor :id - - attr_accessor :name - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :timeout - - attr_accessor :endpoint - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :expiration_signing_key - - attr_accessor :rest_async - - attr_accessor :rest_call - - attr_accessor :rest_webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'timeout' => :'timeout', - :'endpoint' => :'endpoint', - :'expiration_signing_key' => :'expirationSigningKey', - :'rest_async' => :'restAsync', - :'rest_call' => :'restCall', - :'rest_webhook' => :'restWebhook' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'timeout' => :'String', - :'endpoint' => :'String', - :'expiration_signing_key' => :'String', - :'rest_async' => :'Object', - :'rest_call' => :'BetaActionServiceRESTCall', - :'rest_webhook' => :'BetaActionServiceRESTWebhook' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'endpoint', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceUpdateTargetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceUpdateTargetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'endpoint') - self.endpoint = attributes[:'endpoint'] - end - - if attributes.key?(:'expiration_signing_key') - self.expiration_signing_key = attributes[:'expiration_signing_key'] - end - - if attributes.key?(:'rest_async') - self.rest_async = attributes[:'rest_async'] - end - - if attributes.key?(:'rest_call') - self.rest_call = attributes[:'rest_call'] - end - - if attributes.key?(:'rest_webhook') - self.rest_webhook = attributes[:'rest_webhook'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - timeout == o.timeout && - endpoint == o.endpoint && - expiration_signing_key == o.expiration_signing_key && - rest_async == o.rest_async && - rest_call == o.rest_call && - rest_webhook == o.rest_webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, timeout, endpoint, expiration_signing_key, rest_async, rest_call, rest_webhook].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceUpdateTargetRequest. + class BetaActionServiceUpdateTargetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name', + timeout: 'timeout', + endpoint: 'endpoint', + expiration_signing_key: 'expirationSigningKey', + rest_async: 'restAsync', + rest_call: 'restCall', + rest_webhook: 'restWebhook' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String', + timeout: 'ISO8601::Duration', + endpoint: 'String', + expiration_signing_key: 'ISO8601::Duration', + rest_async: 'Object', + rest_call: 'BetaActionServiceRESTCall', + rest_webhook: 'BetaActionServiceRESTWebhook' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :timeout, Types::Any.optional.meta(omittable: true) + # @example null + attribute :endpoint, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :expiration_signing_key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_async, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_call, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rest_webhook, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_action_service_update_target_response.rb b/lib/zitadel/client/models/beta_action_service_update_target_response.rb index 7fd2a55d..bb189f20 100644 --- a/lib/zitadel/client/models/beta_action_service_update_target_response.rb +++ b/lib/zitadel/client/models/beta_action_service_update_target_response.rb @@ -1,227 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaActionServiceUpdateTargetResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Key used to sign and check payload sent to the target. - attr_accessor :signing_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate', - :'signing_key' => :'signingKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time', - :'signing_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'signing_key' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaActionServiceUpdateTargetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaActionServiceUpdateTargetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'signing_key') - self.signing_key = attributes[:'signing_key'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date && - signing_key == o.signing_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date, signing_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaActionServiceUpdateTargetResponse. + class BetaActionServiceUpdateTargetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate', + signing_key: 'signingKey' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time', + signing_key: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # Key used to sign and check payload sent to the target. + # @example null + attribute :signing_key, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_a_p_i_auth_method_type.rb b/lib/zitadel/client/models/beta_app_service_a_p_i_auth_method_type.rb deleted file mode 100644 index a42d1f51..00000000 --- a/lib/zitadel/client/models/beta_app_service_a_p_i_auth_method_type.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceAPIAuthMethodType - API_AUTH_METHOD_TYPE_BASIC = "API_AUTH_METHOD_TYPE_BASIC".freeze - API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT".freeze - - def self.all_vars - @all_vars ||= [API_AUTH_METHOD_TYPE_BASIC, API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceAPIAuthMethodType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceAPIAuthMethodType" - end - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_a_p_i_config.rb b/lib/zitadel/client/models/beta_app_service_a_p_i_config.rb deleted file mode 100644 index 565d3cdb..00000000 --- a/lib/zitadel/client/models/beta_app_service_a_p_i_config.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceAPIConfig - attr_accessor :client_id - - attr_accessor :auth_method_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'auth_method_type' => :'authMethodType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'auth_method_type' => :'BetaAppServiceAPIAuthMethodType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceAPIConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceAPIConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - auth_method_type == o.auth_method_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, auth_method_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_any.rb b/lib/zitadel/client/models/beta_app_service_any.rb index 4da62bde..3bfce910 100644 --- a/lib/zitadel/client/models/beta_app_service_any.rb +++ b/lib/zitadel/client/models/beta_app_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaAppServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaAppServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_api_auth_method_type.rb b/lib/zitadel/client/models/beta_app_service_api_auth_method_type.rb new file mode 100644 index 00000000..2478a64a --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_api_auth_method_type.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceAPIAuthMethodType. + class BetaAppServiceAPIAuthMethodType + API_AUTH_METHOD_TYPE_BASIC = 'API_AUTH_METHOD_TYPE_BASIC' + API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = 'API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT' + + # Frozen set of all allowed values, used for validation. + VALUES = [API_AUTH_METHOD_TYPE_BASIC, API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceAPIAuthMethodType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_api_config.rb b/lib/zitadel/client/models/beta_app_service_api_config.rb new file mode 100644 index 00000000..8dfad73d --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_api_config.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceAPIConfig. + class BetaAppServiceAPIConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + auth_method_type: 'authMethodType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + auth_method_type: 'BetaAppServiceAPIAuthMethodType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_app_sorting.rb b/lib/zitadel/client/models/beta_app_service_app_sorting.rb index aa8d6253..7f279543 100644 --- a/lib/zitadel/client/models/beta_app_service_app_sorting.rb +++ b/lib/zitadel/client/models/beta_app_service_app_sorting.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaAppServiceAppSorting - APP_SORT_BY_ID = "APP_SORT_BY_ID".freeze - APP_SORT_BY_NAME = "APP_SORT_BY_NAME".freeze - APP_SORT_BY_STATE = "APP_SORT_BY_STATE".freeze - APP_SORT_BY_CREATION_DATE = "APP_SORT_BY_CREATION_DATE".freeze - APP_SORT_BY_CHANGE_DATE = "APP_SORT_BY_CHANGE_DATE".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceAppSorting. + class BetaAppServiceAppSorting + APP_SORT_BY_ID = 'APP_SORT_BY_ID' + APP_SORT_BY_NAME = 'APP_SORT_BY_NAME' + APP_SORT_BY_STATE = 'APP_SORT_BY_STATE' + APP_SORT_BY_CREATION_DATE = 'APP_SORT_BY_CREATION_DATE' + APP_SORT_BY_CHANGE_DATE = 'APP_SORT_BY_CHANGE_DATE' - def self.all_vars - @all_vars ||= [APP_SORT_BY_ID, APP_SORT_BY_NAME, APP_SORT_BY_STATE, APP_SORT_BY_CREATION_DATE, APP_SORT_BY_CHANGE_DATE].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [APP_SORT_BY_ID, APP_SORT_BY_NAME, APP_SORT_BY_STATE, APP_SORT_BY_CREATION_DATE, APP_SORT_BY_CHANGE_DATE].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceAppSorting.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceAppSorting" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceAppSorting: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_app_service_app_state.rb b/lib/zitadel/client/models/beta_app_service_app_state.rb index 43165fd1..8e62edf7 100644 --- a/lib/zitadel/client/models/beta_app_service_app_state.rb +++ b/lib/zitadel/client/models/beta_app_service_app_state.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaAppServiceAppState - APP_STATE_UNSPECIFIED = "APP_STATE_UNSPECIFIED".freeze - APP_STATE_ACTIVE = "APP_STATE_ACTIVE".freeze - APP_STATE_INACTIVE = "APP_STATE_INACTIVE".freeze - APP_STATE_REMOVED = "APP_STATE_REMOVED".freeze - - def self.all_vars - @all_vars ||= [APP_STATE_UNSPECIFIED, APP_STATE_ACTIVE, APP_STATE_INACTIVE, APP_STATE_REMOVED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceAppState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceAppState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceAppState. + class BetaAppServiceAppState + APP_STATE_UNSPECIFIED = 'APP_STATE_UNSPECIFIED' + APP_STATE_ACTIVE = 'APP_STATE_ACTIVE' + APP_STATE_INACTIVE = 'APP_STATE_INACTIVE' + APP_STATE_REMOVED = 'APP_STATE_REMOVED' + + # Frozen set of all allowed values, used for validation. + VALUES = [APP_STATE_UNSPECIFIED, APP_STATE_ACTIVE, APP_STATE_INACTIVE, APP_STATE_REMOVED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceAppState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_app_service_application.rb b/lib/zitadel/client/models/beta_app_service_application.rb index e110b808..8947e773 100644 --- a/lib/zitadel/client/models/beta_app_service_application.rb +++ b/lib/zitadel/client/models/beta_app_service_application.rb @@ -1,302 +1,103 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceApplication - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :state - - attr_accessor :name - - attr_accessor :api_config - - attr_accessor :oidc_config - - attr_accessor :saml_config - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'state' => :'state', - :'name' => :'name', - :'api_config' => :'apiConfig', - :'oidc_config' => :'oidcConfig', - :'saml_config' => :'samlConfig' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'state' => :'BetaAppServiceAppState', - :'name' => :'String', - :'api_config' => :'BetaAppServiceAPIConfig', - :'oidc_config' => :'BetaAppServiceOIDCConfig', - :'saml_config' => :'BetaAppServiceSAMLConfig' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceApplication` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceApplication`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'api_config') - self.api_config = attributes[:'api_config'] - end - - if attributes.key?(:'oidc_config') - self.oidc_config = attributes[:'oidc_config'] - end - - if attributes.key?(:'saml_config') - self.saml_config = attributes[:'saml_config'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - change_date == o.change_date && - state == o.state && - name == o.name && - api_config == o.api_config && - oidc_config == o.oidc_config && - saml_config == o.saml_config - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, change_date, state, name, api_config, oidc_config, saml_config].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceApplication. + class BetaAppServiceApplication < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + change_date: 'changeDate', + state: 'state', + name: 'name', + api_config: 'apiConfig', + oidc_config: 'oidcConfig', + saml_config: 'samlConfig' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + change_date: 'Time', + state: 'BetaAppServiceAppState', + name: 'String', + api_config: 'BetaAppServiceAPIConfig', + oidc_config: 'BetaAppServiceOIDCConfig', + saml_config: 'BetaAppServiceSAMLConfig' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :api_config, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_config, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml_config, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_application_key.rb b/lib/zitadel/client/models/beta_app_service_application_key.rb index 7f956550..ded0d7a1 100644 --- a/lib/zitadel/client/models/beta_app_service_application_key.rb +++ b/lib/zitadel/client/models/beta_app_service_application_key.rb @@ -1,262 +1,95 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceApplicationKey - attr_accessor :id - - attr_accessor :application_id - - attr_accessor :project_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :organization_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'application_id' => :'applicationId', - :'project_id' => :'projectId', - :'creation_date' => :'creationDate', - :'organization_id' => :'organizationId', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'application_id' => :'String', - :'project_id' => :'String', - :'creation_date' => :'Time', - :'organization_id' => :'String', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceApplicationKey` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceApplicationKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - application_id == o.application_id && - project_id == o.project_id && - creation_date == o.creation_date && - organization_id == o.organization_id && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, application_id, project_id, creation_date, organization_id, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceApplicationKey. + class BetaAppServiceApplicationKey < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + application_id: 'applicationId', + project_id: 'projectId', + creation_date: 'creationDate', + organization_id: 'organizationId', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + application_id: 'String', + project_id: 'String', + creation_date: 'Time', + organization_id: 'String', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_application_keys_sorting.rb b/lib/zitadel/client/models/beta_app_service_application_keys_sorting.rb index 91aa9fbc..b8403534 100644 --- a/lib/zitadel/client/models/beta_app_service_application_keys_sorting.rb +++ b/lib/zitadel/client/models/beta_app_service_application_keys_sorting.rb @@ -1,46 +1,66 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaAppServiceApplicationKeysSorting - APPLICATION_KEYS_SORT_BY_ID = "APPLICATION_KEYS_SORT_BY_ID".freeze - APPLICATION_KEYS_SORT_BY_PROJECT_ID = "APPLICATION_KEYS_SORT_BY_PROJECT_ID".freeze - APPLICATION_KEYS_SORT_BY_APPLICATION_ID = "APPLICATION_KEYS_SORT_BY_APPLICATION_ID".freeze - APPLICATION_KEYS_SORT_BY_CREATION_DATE = "APPLICATION_KEYS_SORT_BY_CREATION_DATE".freeze - APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID = "APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID".freeze - APPLICATION_KEYS_SORT_BY_EXPIRATION = "APPLICATION_KEYS_SORT_BY_EXPIRATION".freeze - APPLICATION_KEYS_SORT_BY_TYPE = "APPLICATION_KEYS_SORT_BY_TYPE".freeze - - def self.all_vars - @all_vars ||= [APPLICATION_KEYS_SORT_BY_ID, APPLICATION_KEYS_SORT_BY_PROJECT_ID, APPLICATION_KEYS_SORT_BY_APPLICATION_ID, APPLICATION_KEYS_SORT_BY_CREATION_DATE, APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID, APPLICATION_KEYS_SORT_BY_EXPIRATION, APPLICATION_KEYS_SORT_BY_TYPE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceApplicationKeysSorting. + class BetaAppServiceApplicationKeysSorting + APPLICATION_KEYS_SORT_BY_ID = 'APPLICATION_KEYS_SORT_BY_ID' + APPLICATION_KEYS_SORT_BY_PROJECT_ID = 'APPLICATION_KEYS_SORT_BY_PROJECT_ID' + APPLICATION_KEYS_SORT_BY_APPLICATION_ID = 'APPLICATION_KEYS_SORT_BY_APPLICATION_ID' + APPLICATION_KEYS_SORT_BY_CREATION_DATE = 'APPLICATION_KEYS_SORT_BY_CREATION_DATE' + APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID = 'APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID' + APPLICATION_KEYS_SORT_BY_EXPIRATION = 'APPLICATION_KEYS_SORT_BY_EXPIRATION' + APPLICATION_KEYS_SORT_BY_TYPE = 'APPLICATION_KEYS_SORT_BY_TYPE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [APPLICATION_KEYS_SORT_BY_ID, APPLICATION_KEYS_SORT_BY_PROJECT_ID, APPLICATION_KEYS_SORT_BY_APPLICATION_ID, APPLICATION_KEYS_SORT_BY_CREATION_DATE, APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID, APPLICATION_KEYS_SORT_BY_EXPIRATION, APPLICATION_KEYS_SORT_BY_TYPE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceApplicationKeysSorting.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceApplicationKeysSorting" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceApplicationKeysSorting: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_app_service_application_name_query.rb b/lib/zitadel/client/models/beta_app_service_application_name_query.rb index f36b7d74..9b8507d2 100644 --- a/lib/zitadel/client/models/beta_app_service_application_name_query.rb +++ b/lib/zitadel/client/models/beta_app_service_application_name_query.rb @@ -1,246 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceApplicationNameQuery - attr_accessor :name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'method' => :'BetaAppServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceApplicationNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceApplicationNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceApplicationNameQuery. + class BetaAppServiceApplicationNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + method: 'BetaAppServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_application_search_filter.rb b/lib/zitadel/client/models/beta_app_service_application_search_filter.rb index dcc985da..deb9205c 100644 --- a/lib/zitadel/client/models/beta_app_service_application_search_filter.rb +++ b/lib/zitadel/client/models/beta_app_service_application_search_filter.rb @@ -1,273 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceApplicationSearchFilter - attr_accessor :api_app_only - - attr_accessor :name_filter - - attr_accessor :oidc_app_only - - attr_accessor :saml_app_only - - attr_accessor :state_filter - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'api_app_only' => :'apiAppOnly', - :'name_filter' => :'nameFilter', - :'oidc_app_only' => :'oidcAppOnly', - :'saml_app_only' => :'samlAppOnly', - :'state_filter' => :'stateFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'api_app_only' => :'Boolean', - :'name_filter' => :'BetaAppServiceApplicationNameQuery', - :'oidc_app_only' => :'Boolean', - :'saml_app_only' => :'Boolean', - :'state_filter' => :'BetaAppServiceAppState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceApplicationSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceApplicationSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'api_app_only') - self.api_app_only = attributes[:'api_app_only'] - end - - if attributes.key?(:'name_filter') - self.name_filter = attributes[:'name_filter'] - end - - if attributes.key?(:'oidc_app_only') - self.oidc_app_only = attributes[:'oidc_app_only'] - end - - if attributes.key?(:'saml_app_only') - self.saml_app_only = attributes[:'saml_app_only'] - end - - if attributes.key?(:'state_filter') - self.state_filter = attributes[:'state_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - api_app_only == o.api_app_only && - name_filter == o.name_filter && - oidc_app_only == o.oidc_app_only && - saml_app_only == o.saml_app_only && - state_filter == o.state_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [api_app_only, name_filter, oidc_app_only, saml_app_only, state_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceApplicationSearchFilter. + class BetaAppServiceApplicationSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + api_app_only: 'apiAppOnly', + name_filter: 'nameFilter', + oidc_app_only: 'oidcAppOnly', + saml_app_only: 'samlAppOnly', + state_filter: 'stateFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + api_app_only: 'Boolean', + name_filter: 'BetaAppServiceApplicationNameQuery', + oidc_app_only: 'Boolean', + saml_app_only: 'Boolean', + state_filter: 'BetaAppServiceAppState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :api_app_only, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_app_only, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml_app_only, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_connect_error.rb b/lib/zitadel/client/models/beta_app_service_connect_error.rb index b0d2b4ac..e159a702 100644 --- a/lib/zitadel/client/models/beta_app_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_app_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaAppServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaAppServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_create_a_p_i_application_request.rb b/lib/zitadel/client/models/beta_app_service_create_a_p_i_application_request.rb deleted file mode 100644 index bda1a725..00000000 --- a/lib/zitadel/client/models/beta_app_service_create_a_p_i_application_request.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceCreateAPIApplicationRequest - attr_accessor :auth_method_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_method_type' => :'authMethodType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_method_type' => :'BetaAppServiceAPIAuthMethodType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceCreateAPIApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceCreateAPIApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_method_type == o.auth_method_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_method_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_create_a_p_i_application_response.rb b/lib/zitadel/client/models/beta_app_service_create_a_p_i_application_response.rb deleted file mode 100644 index dccca43d..00000000 --- a/lib/zitadel/client/models/beta_app_service_create_a_p_i_application_response.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceCreateAPIApplicationResponse - attr_accessor :client_id - - attr_accessor :client_secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'client_secret' => :'clientSecret' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'client_secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceCreateAPIApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceCreateAPIApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'client_secret') - self.client_secret = attributes[:'client_secret'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - client_secret == o.client_secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, client_secret].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_create_api_application_request.rb b/lib/zitadel/client/models/beta_app_service_create_api_application_request.rb new file mode 100644 index 00000000..4b5c8eb8 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_create_api_application_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceCreateAPIApplicationRequest. + class BetaAppServiceCreateAPIApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_method_type: 'authMethodType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_method_type: 'BetaAppServiceAPIAuthMethodType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_create_api_application_response.rb b/lib/zitadel/client/models/beta_app_service_create_api_application_response.rb new file mode 100644 index 00000000..106beaf3 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_create_api_application_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceCreateAPIApplicationResponse. + class BetaAppServiceCreateAPIApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + client_secret: 'clientSecret' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + client_secret: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :client_secret, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_create_application_key_request.rb b/lib/zitadel/client/models/beta_app_service_create_application_key_request.rb index 4441454c..41197cd5 100644 --- a/lib/zitadel/client/models/beta_app_service_create_application_key_request.rb +++ b/lib/zitadel/client/models/beta_app_service_create_application_key_request.rb @@ -1,234 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceCreateApplicationKeyRequest - attr_accessor :app_id - - attr_accessor :project_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'app_id' => :'appId', - :'project_id' => :'projectId', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'app_id' => :'String', - :'project_id' => :'String', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceCreateApplicationKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceCreateApplicationKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'app_id') - self.app_id = attributes[:'app_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - app_id == o.app_id && - project_id == o.project_id && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [app_id, project_id, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceCreateApplicationKeyRequest. + class BetaAppServiceCreateApplicationKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + app_id: 'appId', + project_id: 'projectId', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + app_id: 'String', + project_id: 'String', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :app_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_create_application_key_response.rb b/lib/zitadel/client/models/beta_app_service_create_application_key_response.rb index e299b3a0..dcfe5406 100644 --- a/lib/zitadel/client/models/beta_app_service_create_application_key_response.rb +++ b/lib/zitadel/client/models/beta_app_service_create_application_key_response.rb @@ -1,234 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceCreateApplicationKeyResponse - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :key_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'key_details' => :'keyDetails' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'key_details' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceCreateApplicationKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceCreateApplicationKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'key_details') - self.key_details = attributes[:'key_details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - key_details == o.key_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, key_details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceCreateApplicationKeyResponse. + class BetaAppServiceCreateApplicationKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + key_details: 'keyDetails' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + key_details: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + key_details: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :key_details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_create_application_request.rb b/lib/zitadel/client/models/beta_app_service_create_application_request.rb index 727fea45..f97b9e33 100644 --- a/lib/zitadel/client/models/beta_app_service_create_application_request.rb +++ b/lib/zitadel/client/models/beta_app_service_create_application_request.rb @@ -1,260 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceCreateApplicationRequest - attr_accessor :project_id - - attr_accessor :id - - attr_accessor :name - - attr_accessor :api_request - - attr_accessor :oidc_request - - attr_accessor :saml_request - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'id' => :'id', - :'name' => :'name', - :'api_request' => :'apiRequest', - :'oidc_request' => :'oidcRequest', - :'saml_request' => :'samlRequest' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'id' => :'String', - :'name' => :'String', - :'api_request' => :'BetaAppServiceCreateAPIApplicationRequest', - :'oidc_request' => :'BetaAppServiceCreateOIDCApplicationRequest', - :'saml_request' => :'BetaAppServiceCreateSAMLApplicationRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceCreateApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceCreateApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'api_request') - self.api_request = attributes[:'api_request'] - end - - if attributes.key?(:'oidc_request') - self.oidc_request = attributes[:'oidc_request'] - end - - if attributes.key?(:'saml_request') - self.saml_request = attributes[:'saml_request'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - id == o.id && - name == o.name && - api_request == o.api_request && - oidc_request == o.oidc_request && - saml_request == o.saml_request - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, id, name, api_request, oidc_request, saml_request].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceCreateApplicationRequest. + class BetaAppServiceCreateApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + id: 'id', + name: 'name', + api_request: 'apiRequest', + oidc_request: 'oidcRequest', + saml_request: 'samlRequest' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + id: 'String', + name: 'String', + api_request: 'BetaAppServiceCreateAPIApplicationRequest', + oidc_request: 'BetaAppServiceCreateOIDCApplicationRequest', + saml_request: 'BetaAppServiceCreateSAMLApplicationRequest' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :api_request, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_request, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml_request, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_create_application_response.rb b/lib/zitadel/client/models/beta_app_service_create_application_response.rb index 515e34c9..0cf1d8a4 100644 --- a/lib/zitadel/client/models/beta_app_service_create_application_response.rb +++ b/lib/zitadel/client/models/beta_app_service_create_application_response.rb @@ -1,252 +1,90 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceCreateApplicationResponse - attr_accessor :app_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :api_response - - attr_accessor :oidc_response - - attr_accessor :saml_response - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'app_id' => :'appId', - :'creation_date' => :'creationDate', - :'api_response' => :'apiResponse', - :'oidc_response' => :'oidcResponse', - :'saml_response' => :'samlResponse' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'app_id' => :'String', - :'creation_date' => :'Time', - :'api_response' => :'BetaAppServiceCreateAPIApplicationResponse', - :'oidc_response' => :'BetaAppServiceCreateOIDCApplicationResponse', - :'saml_response' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceCreateApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceCreateApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'app_id') - self.app_id = attributes[:'app_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'api_response') - self.api_response = attributes[:'api_response'] - end - - if attributes.key?(:'oidc_response') - self.oidc_response = attributes[:'oidc_response'] - end - - if attributes.key?(:'saml_response') - self.saml_response = attributes[:'saml_response'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - app_id == o.app_id && - creation_date == o.creation_date && - api_response == o.api_response && - oidc_response == o.oidc_response && - saml_response == o.saml_response - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [app_id, creation_date, api_response, oidc_response, saml_response].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceCreateApplicationResponse. + class BetaAppServiceCreateApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + app_id: 'appId', + creation_date: 'creationDate', + api_response: 'apiResponse', + oidc_response: 'oidcResponse', + saml_response: 'samlResponse' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + app_id: 'String', + creation_date: 'Time', + api_response: 'BetaAppServiceCreateAPIApplicationResponse', + oidc_response: 'BetaAppServiceCreateOIDCApplicationResponse', + saml_response: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :app_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :api_response, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_response, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml_response, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_create_o_i_d_c_application_request.rb b/lib/zitadel/client/models/beta_app_service_create_o_i_d_c_application_request.rb deleted file mode 100644 index 19eed105..00000000 --- a/lib/zitadel/client/models/beta_app_service_create_o_i_d_c_application_request.rb +++ /dev/null @@ -1,394 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceCreateOIDCApplicationRequest - # Callback URI of the authorization request where the code or tokens will be sent to - attr_accessor :redirect_uris - - attr_accessor :response_types - - attr_accessor :grant_types - - attr_accessor :app_type - - attr_accessor :auth_method_type - - # ZITADEL will redirect to this link after a successful logout - attr_accessor :post_logout_redirect_uris - - attr_accessor :version - - attr_accessor :dev_mode - - attr_accessor :access_token_type - - attr_accessor :access_token_role_assertion - - attr_accessor :id_token_role_assertion - - attr_accessor :id_token_userinfo_assertion - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :clock_skew - - attr_accessor :additional_origins - - attr_accessor :skip_native_app_success_page - - attr_accessor :back_channel_logout_uri - - attr_accessor :login_version - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'redirect_uris' => :'redirectUris', - :'response_types' => :'responseTypes', - :'grant_types' => :'grantTypes', - :'app_type' => :'appType', - :'auth_method_type' => :'authMethodType', - :'post_logout_redirect_uris' => :'postLogoutRedirectUris', - :'version' => :'version', - :'dev_mode' => :'devMode', - :'access_token_type' => :'accessTokenType', - :'access_token_role_assertion' => :'accessTokenRoleAssertion', - :'id_token_role_assertion' => :'idTokenRoleAssertion', - :'id_token_userinfo_assertion' => :'idTokenUserinfoAssertion', - :'clock_skew' => :'clockSkew', - :'additional_origins' => :'additionalOrigins', - :'skip_native_app_success_page' => :'skipNativeAppSuccessPage', - :'back_channel_logout_uri' => :'backChannelLogoutUri', - :'login_version' => :'loginVersion' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'redirect_uris' => :'Array', - :'response_types' => :'Array', - :'grant_types' => :'Array', - :'app_type' => :'BetaAppServiceOIDCAppType', - :'auth_method_type' => :'BetaAppServiceOIDCAuthMethodType', - :'post_logout_redirect_uris' => :'Array', - :'version' => :'BetaAppServiceOIDCVersion', - :'dev_mode' => :'Boolean', - :'access_token_type' => :'BetaAppServiceOIDCTokenType', - :'access_token_role_assertion' => :'Boolean', - :'id_token_role_assertion' => :'Boolean', - :'id_token_userinfo_assertion' => :'Boolean', - :'clock_skew' => :'String', - :'additional_origins' => :'Array', - :'skip_native_app_success_page' => :'Boolean', - :'back_channel_logout_uri' => :'String', - :'login_version' => :'BetaAppServiceLoginVersion' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceCreateOIDCApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceCreateOIDCApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'redirect_uris') - if (value = attributes[:'redirect_uris']).is_a?(Array) - self.redirect_uris = value - end - end - - if attributes.key?(:'response_types') - if (value = attributes[:'response_types']).is_a?(Array) - self.response_types = value - end - end - - if attributes.key?(:'grant_types') - if (value = attributes[:'grant_types']).is_a?(Array) - self.grant_types = value - end - end - - if attributes.key?(:'app_type') - self.app_type = attributes[:'app_type'] - end - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - - if attributes.key?(:'post_logout_redirect_uris') - if (value = attributes[:'post_logout_redirect_uris']).is_a?(Array) - self.post_logout_redirect_uris = value - end - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'dev_mode') - self.dev_mode = attributes[:'dev_mode'] - end - - if attributes.key?(:'access_token_type') - self.access_token_type = attributes[:'access_token_type'] - end - - if attributes.key?(:'access_token_role_assertion') - self.access_token_role_assertion = attributes[:'access_token_role_assertion'] - end - - if attributes.key?(:'id_token_role_assertion') - self.id_token_role_assertion = attributes[:'id_token_role_assertion'] - end - - if attributes.key?(:'id_token_userinfo_assertion') - self.id_token_userinfo_assertion = attributes[:'id_token_userinfo_assertion'] - end - - if attributes.key?(:'clock_skew') - self.clock_skew = attributes[:'clock_skew'] - end - - if attributes.key?(:'additional_origins') - if (value = attributes[:'additional_origins']).is_a?(Array) - self.additional_origins = value - end - end - - if attributes.key?(:'skip_native_app_success_page') - self.skip_native_app_success_page = attributes[:'skip_native_app_success_page'] - end - - if attributes.key?(:'back_channel_logout_uri') - self.back_channel_logout_uri = attributes[:'back_channel_logout_uri'] - end - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - redirect_uris == o.redirect_uris && - response_types == o.response_types && - grant_types == o.grant_types && - app_type == o.app_type && - auth_method_type == o.auth_method_type && - post_logout_redirect_uris == o.post_logout_redirect_uris && - version == o.version && - dev_mode == o.dev_mode && - access_token_type == o.access_token_type && - access_token_role_assertion == o.access_token_role_assertion && - id_token_role_assertion == o.id_token_role_assertion && - id_token_userinfo_assertion == o.id_token_userinfo_assertion && - clock_skew == o.clock_skew && - additional_origins == o.additional_origins && - skip_native_app_success_page == o.skip_native_app_success_page && - back_channel_logout_uri == o.back_channel_logout_uri && - login_version == o.login_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [redirect_uris, response_types, grant_types, app_type, auth_method_type, post_logout_redirect_uris, version, dev_mode, access_token_type, access_token_role_assertion, id_token_role_assertion, id_token_userinfo_assertion, clock_skew, additional_origins, skip_native_app_success_page, back_channel_logout_uri, login_version].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_create_o_i_d_c_application_response.rb b/lib/zitadel/client/models/beta_app_service_create_o_i_d_c_application_response.rb deleted file mode 100644 index 62ade8fe..00000000 --- a/lib/zitadel/client/models/beta_app_service_create_o_i_d_c_application_response.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceCreateOIDCApplicationResponse - attr_accessor :client_id - - attr_accessor :client_secret - - attr_accessor :none_compliant - - attr_accessor :compliance_problems - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'client_secret' => :'clientSecret', - :'none_compliant' => :'noneCompliant', - :'compliance_problems' => :'complianceProblems' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'client_secret' => :'String', - :'none_compliant' => :'Boolean', - :'compliance_problems' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceCreateOIDCApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceCreateOIDCApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'client_secret') - self.client_secret = attributes[:'client_secret'] - end - - if attributes.key?(:'none_compliant') - self.none_compliant = attributes[:'none_compliant'] - end - - if attributes.key?(:'compliance_problems') - if (value = attributes[:'compliance_problems']).is_a?(Array) - self.compliance_problems = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - client_secret == o.client_secret && - none_compliant == o.none_compliant && - compliance_problems == o.compliance_problems - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, client_secret, none_compliant, compliance_problems].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_create_oidc_application_request.rb b/lib/zitadel/client/models/beta_app_service_create_oidc_application_request.rb new file mode 100644 index 00000000..eb919eba --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_create_oidc_application_request.rb @@ -0,0 +1,140 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceCreateOIDCApplicationRequest. + class BetaAppServiceCreateOIDCApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + redirect_uris: 'redirectUris', + response_types: 'responseTypes', + grant_types: 'grantTypes', + app_type: 'appType', + auth_method_type: 'authMethodType', + post_logout_redirect_uris: 'postLogoutRedirectUris', + version: 'version', + dev_mode: 'devMode', + access_token_type: 'accessTokenType', + access_token_role_assertion: 'accessTokenRoleAssertion', + id_token_role_assertion: 'idTokenRoleAssertion', + id_token_userinfo_assertion: 'idTokenUserinfoAssertion', + clock_skew: 'clockSkew', + additional_origins: 'additionalOrigins', + skip_native_app_success_page: 'skipNativeAppSuccessPage', + back_channel_logout_uri: 'backChannelLogoutUri', + login_version: 'loginVersion' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + redirect_uris: 'Array', + response_types: 'Array', + grant_types: 'Array', + app_type: 'BetaAppServiceOIDCAppType', + auth_method_type: 'BetaAppServiceOIDCAuthMethodType', + post_logout_redirect_uris: 'Array', + version: 'BetaAppServiceOIDCVersion', + dev_mode: 'Boolean', + access_token_type: 'BetaAppServiceOIDCTokenType', + access_token_role_assertion: 'Boolean', + id_token_role_assertion: 'Boolean', + id_token_userinfo_assertion: 'Boolean', + clock_skew: 'ISO8601::Duration', + additional_origins: 'Array', + skip_native_app_success_page: 'Boolean', + back_channel_logout_uri: 'String', + login_version: 'BetaAppServiceLoginVersion' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Callback URI of the authorization request where the code or tokens will be sent to + # @example null + attribute :redirect_uris, Types::Any.optional.meta(omittable: true) + # @example null + attribute :response_types, Types::Any.optional.meta(omittable: true) + # @example null + attribute :grant_types, Types::Any.optional.meta(omittable: true) + # @example null + attribute :app_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + # ZITADEL will redirect to this link after a successful logout + # @example null + attribute :post_logout_redirect_uris, Types::Any.optional.meta(omittable: true) + # @example null + attribute :version, Types::Any.optional.meta(omittable: true) + # @example null + attribute :dev_mode, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_role_assertion, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_token_role_assertion, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_token_userinfo_assertion, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :clock_skew, Types::Any.optional.meta(omittable: true) + # @example null + attribute :additional_origins, Types::Any.optional.meta(omittable: true) + # @example null + attribute :skip_native_app_success_page, Types::Any.optional.meta(omittable: true) + # @example null + attribute :back_channel_logout_uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_create_oidc_application_response.rb b/lib/zitadel/client/models/beta_app_service_create_oidc_application_response.rb new file mode 100644 index 00000000..02498a73 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_create_oidc_application_response.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceCreateOIDCApplicationResponse. + class BetaAppServiceCreateOIDCApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + client_secret: 'clientSecret', + none_compliant: 'noneCompliant', + compliance_problems: 'complianceProblems' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + client_secret: 'String', + none_compliant: 'Boolean', + compliance_problems: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :client_secret, Types::Any.optional.meta(omittable: true) + # @example null + attribute :none_compliant, Types::Any.optional.meta(omittable: true) + # @example null + attribute :compliance_problems, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_create_s_a_m_l_application_request.rb b/lib/zitadel/client/models/beta_app_service_create_s_a_m_l_application_request.rb deleted file mode 100644 index ed70d82c..00000000 --- a/lib/zitadel/client/models/beta_app_service_create_s_a_m_l_application_request.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceCreateSAMLApplicationRequest - attr_accessor :login_version - - attr_accessor :metadata_url - - attr_accessor :metadata_xml - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_version' => :'loginVersion', - :'metadata_url' => :'metadataUrl', - :'metadata_xml' => :'metadataXml' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_version' => :'BetaAppServiceLoginVersion', - :'metadata_url' => :'String', - :'metadata_xml' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceCreateSAMLApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceCreateSAMLApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - - if attributes.key?(:'metadata_url') - self.metadata_url = attributes[:'metadata_url'] - end - - if attributes.key?(:'metadata_xml') - self.metadata_xml = attributes[:'metadata_xml'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_version == o.login_version && - metadata_url == o.metadata_url && - metadata_xml == o.metadata_xml - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_version, metadata_url, metadata_xml].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_create_saml_application_request.rb b/lib/zitadel/client/models/beta_app_service_create_saml_application_request.rb new file mode 100644 index 00000000..ecb6e125 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_create_saml_application_request.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceCreateSAMLApplicationRequest. + class BetaAppServiceCreateSAMLApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_version: 'loginVersion', + metadata_url: 'metadataUrl', + metadata_xml: 'metadataXml' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_version: 'BetaAppServiceLoginVersion', + metadata_url: 'String', + metadata_xml: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + metadata_xml: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_xml, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_deactivate_application_request.rb b/lib/zitadel/client/models/beta_app_service_deactivate_application_request.rb index 4e08e3ad..980d4652 100644 --- a/lib/zitadel/client/models/beta_app_service_deactivate_application_request.rb +++ b/lib/zitadel/client/models/beta_app_service_deactivate_application_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceDeactivateApplicationRequest - attr_accessor :project_id - - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceDeactivateApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceDeactivateApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceDeactivateApplicationRequest. + class BetaAppServiceDeactivateApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_deactivate_application_response.rb b/lib/zitadel/client/models/beta_app_service_deactivate_application_response.rb index 49f3b576..f8fec4a3 100644 --- a/lib/zitadel/client/models/beta_app_service_deactivate_application_response.rb +++ b/lib/zitadel/client/models/beta_app_service_deactivate_application_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceDeactivateApplicationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deactivation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deactivation_date' => :'deactivationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deactivation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceDeactivateApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceDeactivateApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deactivation_date') - self.deactivation_date = attributes[:'deactivation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deactivation_date == o.deactivation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deactivation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceDeactivateApplicationResponse. + class BetaAppServiceDeactivateApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deactivation_date: 'deactivationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deactivation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deactivation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_delete_application_key_request.rb b/lib/zitadel/client/models/beta_app_service_delete_application_key_request.rb index e357a5d4..ffddc1b4 100644 --- a/lib/zitadel/client/models/beta_app_service_delete_application_key_request.rb +++ b/lib/zitadel/client/models/beta_app_service_delete_application_key_request.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceDeleteApplicationKeyRequest - attr_accessor :id - - attr_accessor :project_id - - attr_accessor :application_id - - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'project_id' => :'projectId', - :'application_id' => :'applicationId', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'project_id' => :'String', - :'application_id' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceDeleteApplicationKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceDeleteApplicationKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - project_id == o.project_id && - application_id == o.application_id && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, project_id, application_id, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceDeleteApplicationKeyRequest. + class BetaAppServiceDeleteApplicationKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + project_id: 'projectId', + application_id: 'applicationId', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + project_id: 'String', + application_id: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_delete_application_key_response.rb b/lib/zitadel/client/models/beta_app_service_delete_application_key_response.rb index 17f70eb1..ded91e9a 100644 --- a/lib/zitadel/client/models/beta_app_service_delete_application_key_response.rb +++ b/lib/zitadel/client/models/beta_app_service_delete_application_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceDeleteApplicationKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceDeleteApplicationKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceDeleteApplicationKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceDeleteApplicationKeyResponse. + class BetaAppServiceDeleteApplicationKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_delete_application_request.rb b/lib/zitadel/client/models/beta_app_service_delete_application_request.rb index d3f62bf8..8bfd7330 100644 --- a/lib/zitadel/client/models/beta_app_service_delete_application_request.rb +++ b/lib/zitadel/client/models/beta_app_service_delete_application_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceDeleteApplicationRequest - attr_accessor :project_id - - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceDeleteApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceDeleteApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceDeleteApplicationRequest. + class BetaAppServiceDeleteApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_delete_application_response.rb b/lib/zitadel/client/models/beta_app_service_delete_application_response.rb index 91b4ca53..7263e6c8 100644 --- a/lib/zitadel/client/models/beta_app_service_delete_application_response.rb +++ b/lib/zitadel/client/models/beta_app_service_delete_application_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceDeleteApplicationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceDeleteApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceDeleteApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceDeleteApplicationResponse. + class BetaAppServiceDeleteApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_get_application_key_request.rb b/lib/zitadel/client/models/beta_app_service_get_application_key_request.rb index 37e36f9b..78871d2a 100644 --- a/lib/zitadel/client/models/beta_app_service_get_application_key_request.rb +++ b/lib/zitadel/client/models/beta_app_service_get_application_key_request.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceGetApplicationKeyRequest - attr_accessor :id - - attr_accessor :project_id - - attr_accessor :application_id - - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'project_id' => :'projectId', - :'application_id' => :'applicationId', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'project_id' => :'String', - :'application_id' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceGetApplicationKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceGetApplicationKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - project_id == o.project_id && - application_id == o.application_id && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, project_id, application_id, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceGetApplicationKeyRequest. + class BetaAppServiceGetApplicationKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + project_id: 'projectId', + application_id: 'applicationId', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + project_id: 'String', + application_id: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_get_application_key_response.rb b/lib/zitadel/client/models/beta_app_service_get_application_key_response.rb index 61ae9200..404b0077 100644 --- a/lib/zitadel/client/models/beta_app_service_get_application_key_response.rb +++ b/lib/zitadel/client/models/beta_app_service_get_application_key_response.rb @@ -1,235 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceGetApplicationKeyResponse - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceGetApplicationKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceGetApplicationKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceGetApplicationKeyResponse. + class BetaAppServiceGetApplicationKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_get_application_request.rb b/lib/zitadel/client/models/beta_app_service_get_application_request.rb index 2355f2bc..941e1ae6 100644 --- a/lib/zitadel/client/models/beta_app_service_get_application_request.rb +++ b/lib/zitadel/client/models/beta_app_service_get_application_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceGetApplicationRequest - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceGetApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceGetApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceGetApplicationRequest. + class BetaAppServiceGetApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_get_application_response.rb b/lib/zitadel/client/models/beta_app_service_get_application_response.rb index dde57e93..408ceb1f 100644 --- a/lib/zitadel/client/models/beta_app_service_get_application_response.rb +++ b/lib/zitadel/client/models/beta_app_service_get_application_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceGetApplicationResponse - attr_accessor :app - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'app' => :'app' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'app' => :'BetaAppServiceApplication' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceGetApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceGetApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'app') - self.app = attributes[:'app'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - app == o.app - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [app].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceGetApplicationResponse. + class BetaAppServiceGetApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + app: 'app' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + app: 'BetaAppServiceApplication' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :app, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_list_application_keys_request.rb b/lib/zitadel/client/models/beta_app_service_list_application_keys_request.rb index f2117c24..b476727a 100644 --- a/lib/zitadel/client/models/beta_app_service_list_application_keys_request.rb +++ b/lib/zitadel/client/models/beta_app_service_list_application_keys_request.rb @@ -1,273 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceListApplicationKeysRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - attr_accessor :application_id - - attr_accessor :organization_id - - attr_accessor :project_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'application_id' => :'applicationId', - :'organization_id' => :'organizationId', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaAppServicePaginationRequest', - :'sorting_column' => :'BetaAppServiceApplicationKeysSorting', - :'application_id' => :'String', - :'organization_id' => :'String', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceListApplicationKeysRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceListApplicationKeysRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - application_id == o.application_id && - organization_id == o.organization_id && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, application_id, organization_id, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceListApplicationKeysRequest. + class BetaAppServiceListApplicationKeysRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + application_id: 'applicationId', + organization_id: 'organizationId', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaAppServicePaginationRequest', + sorting_column: 'BetaAppServiceApplicationKeysSorting', + application_id: 'String', + organization_id: 'String', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_list_application_keys_response.rb b/lib/zitadel/client/models/beta_app_service_list_application_keys_response.rb index 76cbe62e..72d9959d 100644 --- a/lib/zitadel/client/models/beta_app_service_list_application_keys_response.rb +++ b/lib/zitadel/client/models/beta_app_service_list_application_keys_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceListApplicationKeysResponse - attr_accessor :keys - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'keys' => :'keys', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'keys' => :'Array', - :'pagination' => :'BetaAppServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceListApplicationKeysResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceListApplicationKeysResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'keys') - if (value = attributes[:'keys']).is_a?(Array) - self.keys = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - keys == o.keys && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [keys, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceListApplicationKeysResponse. + class BetaAppServiceListApplicationKeysResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + keys: 'keys', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + keys: 'Array', + pagination: 'BetaAppServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :keys, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_list_applications_request.rb b/lib/zitadel/client/models/beta_app_service_list_applications_request.rb index 2fa4e93a..839c7219 100644 --- a/lib/zitadel/client/models/beta_app_service_list_applications_request.rb +++ b/lib/zitadel/client/models/beta_app_service_list_applications_request.rb @@ -1,267 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceListApplicationsRequest - attr_accessor :project_id - - attr_accessor :pagination - - # criteria the client is looking for - attr_accessor :filters - - attr_accessor :sorting_column - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'pagination' => :'pagination', - :'filters' => :'filters', - :'sorting_column' => :'sortingColumn' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'pagination' => :'BetaAppServicePaginationRequest', - :'filters' => :'Array', - :'sorting_column' => :'BetaAppServiceAppSorting' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceListApplicationsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceListApplicationsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - pagination == o.pagination && - filters == o.filters && - sorting_column == o.sorting_column - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, pagination, filters, sorting_column].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceListApplicationsRequest. + class BetaAppServiceListApplicationsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + pagination: 'pagination', + filters: 'filters', + sorting_column: 'sortingColumn' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + pagination: 'BetaAppServicePaginationRequest', + filters: 'Array', + sorting_column: 'BetaAppServiceAppSorting' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # criteria the client is looking for + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_list_applications_response.rb b/lib/zitadel/client/models/beta_app_service_list_applications_response.rb index a2eaa4f8..c462dbb2 100644 --- a/lib/zitadel/client/models/beta_app_service_list_applications_response.rb +++ b/lib/zitadel/client/models/beta_app_service_list_applications_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceListApplicationsResponse - attr_accessor :applications - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'applications' => :'applications', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'applications' => :'Array', - :'pagination' => :'BetaAppServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceListApplicationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceListApplicationsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'applications') - if (value = attributes[:'applications']).is_a?(Array) - self.applications = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - applications == o.applications && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [applications, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceListApplicationsResponse. + class BetaAppServiceListApplicationsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + applications: 'applications', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + applications: 'Array', + pagination: 'BetaAppServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :applications, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_login_v2.rb b/lib/zitadel/client/models/beta_app_service_login_v2.rb index f99425e9..30711c61 100644 --- a/lib/zitadel/client/models/beta_app_service_login_v2.rb +++ b/lib/zitadel/client/models/beta_app_service_login_v2.rb @@ -1,217 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceLoginV2 - # Optionally specify a base uri of the login UI. If unspecified the default URI will be used. - attr_accessor :base_uri - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'base_uri' => :'baseUri' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'base_uri' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'base_uri' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceLoginV2` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceLoginV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'base_uri') - self.base_uri = attributes[:'base_uri'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - base_uri == o.base_uri - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [base_uri].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceLoginV2. + class BetaAppServiceLoginV2 < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + base_uri: 'baseUri' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + base_uri: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Optionally specify a base uri of the login UI. If unspecified the default URI will be used. + # @example null + attribute :base_uri, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_login_version.rb b/lib/zitadel/client/models/beta_app_service_login_version.rb index 21dcd70e..e0016762 100644 --- a/lib/zitadel/client/models/beta_app_service_login_version.rb +++ b/lib/zitadel/client/models/beta_app_service_login_version.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceLoginVersion - attr_accessor :login_v1 - - attr_accessor :login_v2 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_v1' => :'loginV1', - :'login_v2' => :'loginV2' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_v1' => :'Object', - :'login_v2' => :'BetaAppServiceLoginV2' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceLoginVersion` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceLoginVersion`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_v1') - self.login_v1 = attributes[:'login_v1'] - end - - if attributes.key?(:'login_v2') - self.login_v2 = attributes[:'login_v2'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_v1 == o.login_v1 && - login_v2 == o.login_v2 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_v1, login_v2].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceLoginVersion. + class BetaAppServiceLoginVersion < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_v1: 'loginV1', + login_v2: 'loginV2' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_v1: 'Object', + login_v2: 'BetaAppServiceLoginV2' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_v1, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_v2, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_o_i_d_c_app_type.rb b/lib/zitadel/client/models/beta_app_service_o_i_d_c_app_type.rb deleted file mode 100644 index e8551379..00000000 --- a/lib/zitadel/client/models/beta_app_service_o_i_d_c_app_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceOIDCAppType - OIDC_APP_TYPE_WEB = "OIDC_APP_TYPE_WEB".freeze - OIDC_APP_TYPE_USER_AGENT = "OIDC_APP_TYPE_USER_AGENT".freeze - OIDC_APP_TYPE_NATIVE = "OIDC_APP_TYPE_NATIVE".freeze - - def self.all_vars - @all_vars ||= [OIDC_APP_TYPE_WEB, OIDC_APP_TYPE_USER_AGENT, OIDC_APP_TYPE_NATIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceOIDCAppType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceOIDCAppType" - end - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_o_i_d_c_auth_method_type.rb b/lib/zitadel/client/models/beta_app_service_o_i_d_c_auth_method_type.rb deleted file mode 100644 index 9a44215f..00000000 --- a/lib/zitadel/client/models/beta_app_service_o_i_d_c_auth_method_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceOIDCAuthMethodType - OIDC_AUTH_METHOD_TYPE_BASIC = "OIDC_AUTH_METHOD_TYPE_BASIC".freeze - OIDC_AUTH_METHOD_TYPE_POST = "OIDC_AUTH_METHOD_TYPE_POST".freeze - OIDC_AUTH_METHOD_TYPE_NONE = "OIDC_AUTH_METHOD_TYPE_NONE".freeze - OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = "OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT".freeze - - def self.all_vars - @all_vars ||= [OIDC_AUTH_METHOD_TYPE_BASIC, OIDC_AUTH_METHOD_TYPE_POST, OIDC_AUTH_METHOD_TYPE_NONE, OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceOIDCAuthMethodType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceOIDCAuthMethodType" - end - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_o_i_d_c_config.rb b/lib/zitadel/client/models/beta_app_service_o_i_d_c_config.rb deleted file mode 100644 index 23021245..00000000 --- a/lib/zitadel/client/models/beta_app_service_o_i_d_c_config.rb +++ /dev/null @@ -1,432 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceOIDCConfig - attr_accessor :redirect_uris - - attr_accessor :response_types - - attr_accessor :grant_types - - attr_accessor :app_type - - attr_accessor :client_id - - attr_accessor :auth_method_type - - attr_accessor :post_logout_redirect_uris - - attr_accessor :version - - attr_accessor :none_compliant - - attr_accessor :compliance_problems - - attr_accessor :dev_mode - - attr_accessor :access_token_type - - attr_accessor :access_token_role_assertion - - attr_accessor :id_token_role_assertion - - attr_accessor :id_token_userinfo_assertion - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :clock_skew - - attr_accessor :additional_origins - - attr_accessor :allowed_origins - - attr_accessor :skip_native_app_success_page - - attr_accessor :back_channel_logout_uri - - attr_accessor :login_version - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'redirect_uris' => :'redirectUris', - :'response_types' => :'responseTypes', - :'grant_types' => :'grantTypes', - :'app_type' => :'appType', - :'client_id' => :'clientId', - :'auth_method_type' => :'authMethodType', - :'post_logout_redirect_uris' => :'postLogoutRedirectUris', - :'version' => :'version', - :'none_compliant' => :'noneCompliant', - :'compliance_problems' => :'complianceProblems', - :'dev_mode' => :'devMode', - :'access_token_type' => :'accessTokenType', - :'access_token_role_assertion' => :'accessTokenRoleAssertion', - :'id_token_role_assertion' => :'idTokenRoleAssertion', - :'id_token_userinfo_assertion' => :'idTokenUserinfoAssertion', - :'clock_skew' => :'clockSkew', - :'additional_origins' => :'additionalOrigins', - :'allowed_origins' => :'allowedOrigins', - :'skip_native_app_success_page' => :'skipNativeAppSuccessPage', - :'back_channel_logout_uri' => :'backChannelLogoutUri', - :'login_version' => :'loginVersion' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'redirect_uris' => :'Array', - :'response_types' => :'Array', - :'grant_types' => :'Array', - :'app_type' => :'BetaAppServiceOIDCAppType', - :'client_id' => :'String', - :'auth_method_type' => :'BetaAppServiceOIDCAuthMethodType', - :'post_logout_redirect_uris' => :'Array', - :'version' => :'BetaAppServiceOIDCVersion', - :'none_compliant' => :'Boolean', - :'compliance_problems' => :'Array', - :'dev_mode' => :'Boolean', - :'access_token_type' => :'BetaAppServiceOIDCTokenType', - :'access_token_role_assertion' => :'Boolean', - :'id_token_role_assertion' => :'Boolean', - :'id_token_userinfo_assertion' => :'Boolean', - :'clock_skew' => :'String', - :'additional_origins' => :'Array', - :'allowed_origins' => :'Array', - :'skip_native_app_success_page' => :'Boolean', - :'back_channel_logout_uri' => :'String', - :'login_version' => :'BetaAppServiceLoginVersion' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceOIDCConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceOIDCConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'redirect_uris') - if (value = attributes[:'redirect_uris']).is_a?(Array) - self.redirect_uris = value - end - end - - if attributes.key?(:'response_types') - if (value = attributes[:'response_types']).is_a?(Array) - self.response_types = value - end - end - - if attributes.key?(:'grant_types') - if (value = attributes[:'grant_types']).is_a?(Array) - self.grant_types = value - end - end - - if attributes.key?(:'app_type') - self.app_type = attributes[:'app_type'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - - if attributes.key?(:'post_logout_redirect_uris') - if (value = attributes[:'post_logout_redirect_uris']).is_a?(Array) - self.post_logout_redirect_uris = value - end - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'none_compliant') - self.none_compliant = attributes[:'none_compliant'] - end - - if attributes.key?(:'compliance_problems') - if (value = attributes[:'compliance_problems']).is_a?(Array) - self.compliance_problems = value - end - end - - if attributes.key?(:'dev_mode') - self.dev_mode = attributes[:'dev_mode'] - end - - if attributes.key?(:'access_token_type') - self.access_token_type = attributes[:'access_token_type'] - end - - if attributes.key?(:'access_token_role_assertion') - self.access_token_role_assertion = attributes[:'access_token_role_assertion'] - end - - if attributes.key?(:'id_token_role_assertion') - self.id_token_role_assertion = attributes[:'id_token_role_assertion'] - end - - if attributes.key?(:'id_token_userinfo_assertion') - self.id_token_userinfo_assertion = attributes[:'id_token_userinfo_assertion'] - end - - if attributes.key?(:'clock_skew') - self.clock_skew = attributes[:'clock_skew'] - end - - if attributes.key?(:'additional_origins') - if (value = attributes[:'additional_origins']).is_a?(Array) - self.additional_origins = value - end - end - - if attributes.key?(:'allowed_origins') - if (value = attributes[:'allowed_origins']).is_a?(Array) - self.allowed_origins = value - end - end - - if attributes.key?(:'skip_native_app_success_page') - self.skip_native_app_success_page = attributes[:'skip_native_app_success_page'] - end - - if attributes.key?(:'back_channel_logout_uri') - self.back_channel_logout_uri = attributes[:'back_channel_logout_uri'] - end - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - redirect_uris == o.redirect_uris && - response_types == o.response_types && - grant_types == o.grant_types && - app_type == o.app_type && - client_id == o.client_id && - auth_method_type == o.auth_method_type && - post_logout_redirect_uris == o.post_logout_redirect_uris && - version == o.version && - none_compliant == o.none_compliant && - compliance_problems == o.compliance_problems && - dev_mode == o.dev_mode && - access_token_type == o.access_token_type && - access_token_role_assertion == o.access_token_role_assertion && - id_token_role_assertion == o.id_token_role_assertion && - id_token_userinfo_assertion == o.id_token_userinfo_assertion && - clock_skew == o.clock_skew && - additional_origins == o.additional_origins && - allowed_origins == o.allowed_origins && - skip_native_app_success_page == o.skip_native_app_success_page && - back_channel_logout_uri == o.back_channel_logout_uri && - login_version == o.login_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [redirect_uris, response_types, grant_types, app_type, client_id, auth_method_type, post_logout_redirect_uris, version, none_compliant, compliance_problems, dev_mode, access_token_type, access_token_role_assertion, id_token_role_assertion, id_token_userinfo_assertion, clock_skew, additional_origins, allowed_origins, skip_native_app_success_page, back_channel_logout_uri, login_version].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_o_i_d_c_grant_type.rb b/lib/zitadel/client/models/beta_app_service_o_i_d_c_grant_type.rb deleted file mode 100644 index 283e8cfe..00000000 --- a/lib/zitadel/client/models/beta_app_service_o_i_d_c_grant_type.rb +++ /dev/null @@ -1,44 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceOIDCGrantType - OIDC_GRANT_TYPE_AUTHORIZATION_CODE = "OIDC_GRANT_TYPE_AUTHORIZATION_CODE".freeze - OIDC_GRANT_TYPE_IMPLICIT = "OIDC_GRANT_TYPE_IMPLICIT".freeze - OIDC_GRANT_TYPE_REFRESH_TOKEN = "OIDC_GRANT_TYPE_REFRESH_TOKEN".freeze - OIDC_GRANT_TYPE_DEVICE_CODE = "OIDC_GRANT_TYPE_DEVICE_CODE".freeze - OIDC_GRANT_TYPE_TOKEN_EXCHANGE = "OIDC_GRANT_TYPE_TOKEN_EXCHANGE".freeze - - def self.all_vars - @all_vars ||= [OIDC_GRANT_TYPE_AUTHORIZATION_CODE, OIDC_GRANT_TYPE_IMPLICIT, OIDC_GRANT_TYPE_REFRESH_TOKEN, OIDC_GRANT_TYPE_DEVICE_CODE, OIDC_GRANT_TYPE_TOKEN_EXCHANGE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceOIDCGrantType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceOIDCGrantType" - end - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_o_i_d_c_localized_message.rb b/lib/zitadel/client/models/beta_app_service_o_i_d_c_localized_message.rb deleted file mode 100644 index a7e1b39d..00000000 --- a/lib/zitadel/client/models/beta_app_service_o_i_d_c_localized_message.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceOIDCLocalizedMessage - attr_accessor :key - - attr_accessor :localized_message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'localized_message' => :'localizedMessage' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'localized_message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceOIDCLocalizedMessage` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceOIDCLocalizedMessage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'localized_message') - self.localized_message = attributes[:'localized_message'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - localized_message == o.localized_message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, localized_message].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_o_i_d_c_response_type.rb b/lib/zitadel/client/models/beta_app_service_o_i_d_c_response_type.rb deleted file mode 100644 index 4e8ed7bf..00000000 --- a/lib/zitadel/client/models/beta_app_service_o_i_d_c_response_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceOIDCResponseType - OIDC_RESPONSE_TYPE_UNSPECIFIED = "OIDC_RESPONSE_TYPE_UNSPECIFIED".freeze - OIDC_RESPONSE_TYPE_CODE = "OIDC_RESPONSE_TYPE_CODE".freeze - OIDC_RESPONSE_TYPE_ID_TOKEN = "OIDC_RESPONSE_TYPE_ID_TOKEN".freeze - OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN = "OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN".freeze - - def self.all_vars - @all_vars ||= [OIDC_RESPONSE_TYPE_UNSPECIFIED, OIDC_RESPONSE_TYPE_CODE, OIDC_RESPONSE_TYPE_ID_TOKEN, OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceOIDCResponseType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceOIDCResponseType" - end - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_o_i_d_c_token_type.rb b/lib/zitadel/client/models/beta_app_service_o_i_d_c_token_type.rb deleted file mode 100644 index 4d122fe3..00000000 --- a/lib/zitadel/client/models/beta_app_service_o_i_d_c_token_type.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceOIDCTokenType - OIDC_TOKEN_TYPE_BEARER = "OIDC_TOKEN_TYPE_BEARER".freeze - OIDC_TOKEN_TYPE_JWT = "OIDC_TOKEN_TYPE_JWT".freeze - - def self.all_vars - @all_vars ||= [OIDC_TOKEN_TYPE_BEARER, OIDC_TOKEN_TYPE_JWT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceOIDCTokenType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceOIDCTokenType" - end - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_o_i_d_c_version.rb b/lib/zitadel/client/models/beta_app_service_o_i_d_c_version.rb deleted file mode 100644 index 4df74348..00000000 --- a/lib/zitadel/client/models/beta_app_service_o_i_d_c_version.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceOIDCVersion - OIDC_VERSION_1_0 = "OIDC_VERSION_1_0".freeze - - def self.all_vars - @all_vars ||= [OIDC_VERSION_1_0].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceOIDCVersion.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceOIDCVersion" - end - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_oidc_app_type.rb b/lib/zitadel/client/models/beta_app_service_oidc_app_type.rb new file mode 100644 index 00000000..692d65e6 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_oidc_app_type.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceOIDCAppType. + class BetaAppServiceOIDCAppType + OIDC_APP_TYPE_WEB = 'OIDC_APP_TYPE_WEB' + OIDC_APP_TYPE_USER_AGENT = 'OIDC_APP_TYPE_USER_AGENT' + OIDC_APP_TYPE_NATIVE = 'OIDC_APP_TYPE_NATIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_APP_TYPE_WEB, OIDC_APP_TYPE_USER_AGENT, OIDC_APP_TYPE_NATIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceOIDCAppType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_oidc_auth_method_type.rb b/lib/zitadel/client/models/beta_app_service_oidc_auth_method_type.rb new file mode 100644 index 00000000..b19927d2 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_oidc_auth_method_type.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceOIDCAuthMethodType. + class BetaAppServiceOIDCAuthMethodType + OIDC_AUTH_METHOD_TYPE_BASIC = 'OIDC_AUTH_METHOD_TYPE_BASIC' + OIDC_AUTH_METHOD_TYPE_POST = 'OIDC_AUTH_METHOD_TYPE_POST' + OIDC_AUTH_METHOD_TYPE_NONE = 'OIDC_AUTH_METHOD_TYPE_NONE' + OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = 'OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_AUTH_METHOD_TYPE_BASIC, OIDC_AUTH_METHOD_TYPE_POST, OIDC_AUTH_METHOD_TYPE_NONE, OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceOIDCAuthMethodType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_oidc_config.rb b/lib/zitadel/client/models/beta_app_service_oidc_config.rb new file mode 100644 index 00000000..08ee5c5e --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_oidc_config.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceOIDCConfig. + class BetaAppServiceOIDCConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + redirect_uris: 'redirectUris', + response_types: 'responseTypes', + grant_types: 'grantTypes', + app_type: 'appType', + client_id: 'clientId', + auth_method_type: 'authMethodType', + post_logout_redirect_uris: 'postLogoutRedirectUris', + version: 'version', + none_compliant: 'noneCompliant', + compliance_problems: 'complianceProblems', + dev_mode: 'devMode', + access_token_type: 'accessTokenType', + access_token_role_assertion: 'accessTokenRoleAssertion', + id_token_role_assertion: 'idTokenRoleAssertion', + id_token_userinfo_assertion: 'idTokenUserinfoAssertion', + clock_skew: 'clockSkew', + additional_origins: 'additionalOrigins', + allowed_origins: 'allowedOrigins', + skip_native_app_success_page: 'skipNativeAppSuccessPage', + back_channel_logout_uri: 'backChannelLogoutUri', + login_version: 'loginVersion' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + redirect_uris: 'Array', + response_types: 'Array', + grant_types: 'Array', + app_type: 'BetaAppServiceOIDCAppType', + client_id: 'String', + auth_method_type: 'BetaAppServiceOIDCAuthMethodType', + post_logout_redirect_uris: 'Array', + version: 'BetaAppServiceOIDCVersion', + none_compliant: 'Boolean', + compliance_problems: 'Array', + dev_mode: 'Boolean', + access_token_type: 'BetaAppServiceOIDCTokenType', + access_token_role_assertion: 'Boolean', + id_token_role_assertion: 'Boolean', + id_token_userinfo_assertion: 'Boolean', + clock_skew: 'ISO8601::Duration', + additional_origins: 'Array', + allowed_origins: 'Array', + skip_native_app_success_page: 'Boolean', + back_channel_logout_uri: 'String', + login_version: 'BetaAppServiceLoginVersion' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :redirect_uris, Types::Any.optional.meta(omittable: true) + # @example null + attribute :response_types, Types::Any.optional.meta(omittable: true) + # @example null + attribute :grant_types, Types::Any.optional.meta(omittable: true) + # @example null + attribute :app_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :post_logout_redirect_uris, Types::Any.optional.meta(omittable: true) + # @example null + attribute :version, Types::Any.optional.meta(omittable: true) + # @example null + attribute :none_compliant, Types::Any.optional.meta(omittable: true) + # @example null + attribute :compliance_problems, Types::Any.optional.meta(omittable: true) + # @example null + attribute :dev_mode, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_role_assertion, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_token_role_assertion, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_token_userinfo_assertion, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :clock_skew, Types::Any.optional.meta(omittable: true) + # @example null + attribute :additional_origins, Types::Any.optional.meta(omittable: true) + # @example null + attribute :allowed_origins, Types::Any.optional.meta(omittable: true) + # @example null + attribute :skip_native_app_success_page, Types::Any.optional.meta(omittable: true) + # @example null + attribute :back_channel_logout_uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_oidc_grant_type.rb b/lib/zitadel/client/models/beta_app_service_oidc_grant_type.rb new file mode 100644 index 00000000..fe475c87 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_oidc_grant_type.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceOIDCGrantType. + class BetaAppServiceOIDCGrantType + OIDC_GRANT_TYPE_AUTHORIZATION_CODE = 'OIDC_GRANT_TYPE_AUTHORIZATION_CODE' + OIDC_GRANT_TYPE_IMPLICIT = 'OIDC_GRANT_TYPE_IMPLICIT' + OIDC_GRANT_TYPE_REFRESH_TOKEN = 'OIDC_GRANT_TYPE_REFRESH_TOKEN' + OIDC_GRANT_TYPE_DEVICE_CODE = 'OIDC_GRANT_TYPE_DEVICE_CODE' + OIDC_GRANT_TYPE_TOKEN_EXCHANGE = 'OIDC_GRANT_TYPE_TOKEN_EXCHANGE' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_GRANT_TYPE_AUTHORIZATION_CODE, OIDC_GRANT_TYPE_IMPLICIT, OIDC_GRANT_TYPE_REFRESH_TOKEN, OIDC_GRANT_TYPE_DEVICE_CODE, OIDC_GRANT_TYPE_TOKEN_EXCHANGE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceOIDCGrantType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_oidc_localized_message.rb b/lib/zitadel/client/models/beta_app_service_oidc_localized_message.rb new file mode 100644 index 00000000..52015ac8 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_oidc_localized_message.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceOIDCLocalizedMessage. + class BetaAppServiceOIDCLocalizedMessage < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + localized_message: 'localizedMessage' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + localized_message: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :localized_message, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_oidc_response_type.rb b/lib/zitadel/client/models/beta_app_service_oidc_response_type.rb new file mode 100644 index 00000000..cccfccbd --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_oidc_response_type.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceOIDCResponseType. + class BetaAppServiceOIDCResponseType + OIDC_RESPONSE_TYPE_UNSPECIFIED = 'OIDC_RESPONSE_TYPE_UNSPECIFIED' + OIDC_RESPONSE_TYPE_CODE = 'OIDC_RESPONSE_TYPE_CODE' + OIDC_RESPONSE_TYPE_ID_TOKEN = 'OIDC_RESPONSE_TYPE_ID_TOKEN' + OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN = 'OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_RESPONSE_TYPE_UNSPECIFIED, OIDC_RESPONSE_TYPE_CODE, OIDC_RESPONSE_TYPE_ID_TOKEN, OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceOIDCResponseType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_oidc_token_type.rb b/lib/zitadel/client/models/beta_app_service_oidc_token_type.rb new file mode 100644 index 00000000..bd9db2e5 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_oidc_token_type.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceOIDCTokenType. + class BetaAppServiceOIDCTokenType + OIDC_TOKEN_TYPE_BEARER = 'OIDC_TOKEN_TYPE_BEARER' + OIDC_TOKEN_TYPE_JWT = 'OIDC_TOKEN_TYPE_JWT' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_TOKEN_TYPE_BEARER, OIDC_TOKEN_TYPE_JWT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceOIDCTokenType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_oidc_version.rb b/lib/zitadel/client/models/beta_app_service_oidc_version.rb new file mode 100644 index 00000000..b0fb702e --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_oidc_version.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceOIDCVersion. + class BetaAppServiceOIDCVersion + OIDC_VERSION_1_0 = 'OIDC_VERSION_1_0' + + # Frozen set of all allowed values, used for validation. + VALUES = [OIDC_VERSION_1_0].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceOIDCVersion: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_pagination_request.rb b/lib/zitadel/client/models/beta_app_service_pagination_request.rb index 70a18d99..20e613f2 100644 --- a/lib/zitadel/client/models/beta_app_service_pagination_request.rb +++ b/lib/zitadel/client/models/beta_app_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServicePaginationRequest. + class BetaAppServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_pagination_response.rb b/lib/zitadel/client/models/beta_app_service_pagination_response.rb index 4c17b52e..9d27c4d8 100644 --- a/lib/zitadel/client/models/beta_app_service_pagination_response.rb +++ b/lib/zitadel/client/models/beta_app_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServicePaginationResponse. + class BetaAppServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_reactivate_application_request.rb b/lib/zitadel/client/models/beta_app_service_reactivate_application_request.rb index 51448be2..770eb9e9 100644 --- a/lib/zitadel/client/models/beta_app_service_reactivate_application_request.rb +++ b/lib/zitadel/client/models/beta_app_service_reactivate_application_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceReactivateApplicationRequest - attr_accessor :project_id - - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceReactivateApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceReactivateApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceReactivateApplicationRequest. + class BetaAppServiceReactivateApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_reactivate_application_response.rb b/lib/zitadel/client/models/beta_app_service_reactivate_application_response.rb index ebc21d6b..a1787319 100644 --- a/lib/zitadel/client/models/beta_app_service_reactivate_application_response.rb +++ b/lib/zitadel/client/models/beta_app_service_reactivate_application_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceReactivateApplicationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :reactivation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reactivation_date' => :'reactivationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reactivation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceReactivateApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceReactivateApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reactivation_date') - self.reactivation_date = attributes[:'reactivation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reactivation_date == o.reactivation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reactivation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceReactivateApplicationResponse. + class BetaAppServiceReactivateApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + reactivation_date: 'reactivationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + reactivation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :reactivation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_regenerate_client_secret_request.rb b/lib/zitadel/client/models/beta_app_service_regenerate_client_secret_request.rb index fb38cd97..d21f2c04 100644 --- a/lib/zitadel/client/models/beta_app_service_regenerate_client_secret_request.rb +++ b/lib/zitadel/client/models/beta_app_service_regenerate_client_secret_request.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceRegenerateClientSecretRequest - attr_accessor :project_id - - attr_accessor :application_id - - attr_accessor :is_api - - attr_accessor :is_oidc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'application_id' => :'applicationId', - :'is_api' => :'isApi', - :'is_oidc' => :'isOidc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'application_id' => :'String', - :'is_api' => :'Boolean', - :'is_oidc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceRegenerateClientSecretRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceRegenerateClientSecretRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'is_api') - self.is_api = attributes[:'is_api'] - end - - if attributes.key?(:'is_oidc') - self.is_oidc = attributes[:'is_oidc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - application_id == o.application_id && - is_api == o.is_api && - is_oidc == o.is_oidc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, application_id, is_api, is_oidc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceRegenerateClientSecretRequest. + class BetaAppServiceRegenerateClientSecretRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + application_id: 'applicationId', + is_api: 'isApi', + is_oidc: 'isOidc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + application_id: 'String', + is_api: 'Boolean', + is_oidc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :application_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_api, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_oidc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_regenerate_client_secret_response.rb b/lib/zitadel/client/models/beta_app_service_regenerate_client_secret_response.rb index 285f271d..2d95c35d 100644 --- a/lib/zitadel/client/models/beta_app_service_regenerate_client_secret_response.rb +++ b/lib/zitadel/client/models/beta_app_service_regenerate_client_secret_response.rb @@ -1,225 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceRegenerateClientSecretResponse - attr_accessor :client_secret - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_secret' => :'clientSecret', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_secret' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceRegenerateClientSecretResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceRegenerateClientSecretResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_secret') - self.client_secret = attributes[:'client_secret'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_secret == o.client_secret && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_secret, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceRegenerateClientSecretResponse. + class BetaAppServiceRegenerateClientSecretResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_secret: 'clientSecret', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_secret: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :client_secret, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_s_a_m_l_config.rb b/lib/zitadel/client/models/beta_app_service_s_a_m_l_config.rb deleted file mode 100644 index 7df0450a..00000000 --- a/lib/zitadel/client/models/beta_app_service_s_a_m_l_config.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceSAMLConfig - attr_accessor :login_version - - attr_accessor :metadata_url - - attr_accessor :metadata_xml - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_version' => :'loginVersion', - :'metadata_url' => :'metadataUrl', - :'metadata_xml' => :'metadataXml' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_version' => :'BetaAppServiceLoginVersion', - :'metadata_url' => :'String', - :'metadata_xml' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceSAMLConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceSAMLConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - - if attributes.key?(:'metadata_url') - self.metadata_url = attributes[:'metadata_url'] - end - - if attributes.key?(:'metadata_xml') - self.metadata_xml = attributes[:'metadata_xml'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_version == o.login_version && - metadata_url == o.metadata_url && - metadata_xml == o.metadata_xml - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_version, metadata_url, metadata_xml].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_saml_config.rb b/lib/zitadel/client/models/beta_app_service_saml_config.rb new file mode 100644 index 00000000..14a7a551 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_saml_config.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceSAMLConfig. + class BetaAppServiceSAMLConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_version: 'loginVersion', + metadata_url: 'metadataUrl', + metadata_xml: 'metadataXml' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_version: 'BetaAppServiceLoginVersion', + metadata_url: 'String', + metadata_xml: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + metadata_xml: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_xml, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_text_filter_method.rb b/lib/zitadel/client/models/beta_app_service_text_filter_method.rb index 208ab0d0..8f6b91a2 100644 --- a/lib/zitadel/client/models/beta_app_service_text_filter_method.rb +++ b/lib/zitadel/client/models/beta_app_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaAppServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAppServiceTextFilterMethod. + class BetaAppServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAppServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAppServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAppServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_app_service_update_a_p_i_application_configuration_request.rb b/lib/zitadel/client/models/beta_app_service_update_a_p_i_application_configuration_request.rb deleted file mode 100644 index f638ea32..00000000 --- a/lib/zitadel/client/models/beta_app_service_update_a_p_i_application_configuration_request.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceUpdateAPIApplicationConfigurationRequest - attr_accessor :auth_method_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_method_type' => :'authMethodType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_method_type' => :'BetaAppServiceAPIAuthMethodType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceUpdateAPIApplicationConfigurationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceUpdateAPIApplicationConfigurationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_method_type == o.auth_method_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_method_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_update_api_application_configuration_request.rb b/lib/zitadel/client/models/beta_app_service_update_api_application_configuration_request.rb new file mode 100644 index 00000000..79b6058a --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_update_api_application_configuration_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceUpdateAPIApplicationConfigurationRequest. + class BetaAppServiceUpdateAPIApplicationConfigurationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_method_type: 'authMethodType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_method_type: 'BetaAppServiceAPIAuthMethodType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_update_application_request.rb b/lib/zitadel/client/models/beta_app_service_update_application_request.rb index 1dfea42f..bc3b48af 100644 --- a/lib/zitadel/client/models/beta_app_service_update_application_request.rb +++ b/lib/zitadel/client/models/beta_app_service_update_application_request.rb @@ -1,260 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceUpdateApplicationRequest - attr_accessor :project_id - - attr_accessor :id - - attr_accessor :name - - attr_accessor :api_configuration_request - - attr_accessor :oidc_configuration_request - - attr_accessor :saml_configuration_request - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'id' => :'id', - :'name' => :'name', - :'api_configuration_request' => :'apiConfigurationRequest', - :'oidc_configuration_request' => :'oidcConfigurationRequest', - :'saml_configuration_request' => :'samlConfigurationRequest' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'id' => :'String', - :'name' => :'String', - :'api_configuration_request' => :'BetaAppServiceUpdateAPIApplicationConfigurationRequest', - :'oidc_configuration_request' => :'BetaAppServiceUpdateOIDCApplicationConfigurationRequest', - :'saml_configuration_request' => :'BetaAppServiceUpdateSAMLApplicationConfigurationRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceUpdateApplicationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceUpdateApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'api_configuration_request') - self.api_configuration_request = attributes[:'api_configuration_request'] - end - - if attributes.key?(:'oidc_configuration_request') - self.oidc_configuration_request = attributes[:'oidc_configuration_request'] - end - - if attributes.key?(:'saml_configuration_request') - self.saml_configuration_request = attributes[:'saml_configuration_request'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - id == o.id && - name == o.name && - api_configuration_request == o.api_configuration_request && - oidc_configuration_request == o.oidc_configuration_request && - saml_configuration_request == o.saml_configuration_request - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, id, name, api_configuration_request, oidc_configuration_request, saml_configuration_request].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceUpdateApplicationRequest. + class BetaAppServiceUpdateApplicationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + id: 'id', + name: 'name', + api_configuration_request: 'apiConfigurationRequest', + oidc_configuration_request: 'oidcConfigurationRequest', + saml_configuration_request: 'samlConfigurationRequest' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + id: 'String', + name: 'String', + api_configuration_request: 'BetaAppServiceUpdateAPIApplicationConfigurationRequest', + oidc_configuration_request: 'BetaAppServiceUpdateOIDCApplicationConfigurationRequest', + saml_configuration_request: 'BetaAppServiceUpdateSAMLApplicationConfigurationRequest' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :api_configuration_request, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_configuration_request, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml_configuration_request, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_app_service_update_application_response.rb b/lib/zitadel/client/models/beta_app_service_update_application_response.rb index 3725ce5c..b2bda5cd 100644 --- a/lib/zitadel/client/models/beta_app_service_update_application_response.rb +++ b/lib/zitadel/client/models/beta_app_service_update_application_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAppServiceUpdateApplicationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceUpdateApplicationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceUpdateApplicationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceUpdateApplicationResponse. + class BetaAppServiceUpdateApplicationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_app_service_update_o_i_d_c_application_configuration_request.rb b/lib/zitadel/client/models/beta_app_service_update_o_i_d_c_application_configuration_request.rb deleted file mode 100644 index cf66e5db..00000000 --- a/lib/zitadel/client/models/beta_app_service_update_o_i_d_c_application_configuration_request.rb +++ /dev/null @@ -1,398 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceUpdateOIDCApplicationConfigurationRequest - attr_accessor :redirect_uris - - attr_accessor :response_types - - attr_accessor :grant_types - - attr_accessor :app_type - - attr_accessor :auth_method_type - - attr_accessor :post_logout_redirect_uris - - attr_accessor :version - - attr_accessor :dev_mode - - attr_accessor :access_token_type - - attr_accessor :access_token_role_assertion - - attr_accessor :id_token_role_assertion - - attr_accessor :id_token_userinfo_assertion - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :clock_skew - - attr_accessor :additional_origins - - attr_accessor :skip_native_app_success_page - - attr_accessor :back_channel_logout_uri - - attr_accessor :login_version - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'redirect_uris' => :'redirectUris', - :'response_types' => :'responseTypes', - :'grant_types' => :'grantTypes', - :'app_type' => :'appType', - :'auth_method_type' => :'authMethodType', - :'post_logout_redirect_uris' => :'postLogoutRedirectUris', - :'version' => :'version', - :'dev_mode' => :'devMode', - :'access_token_type' => :'accessTokenType', - :'access_token_role_assertion' => :'accessTokenRoleAssertion', - :'id_token_role_assertion' => :'idTokenRoleAssertion', - :'id_token_userinfo_assertion' => :'idTokenUserinfoAssertion', - :'clock_skew' => :'clockSkew', - :'additional_origins' => :'additionalOrigins', - :'skip_native_app_success_page' => :'skipNativeAppSuccessPage', - :'back_channel_logout_uri' => :'backChannelLogoutUri', - :'login_version' => :'loginVersion' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'redirect_uris' => :'Array', - :'response_types' => :'Array', - :'grant_types' => :'Array', - :'app_type' => :'BetaAppServiceOIDCAppType', - :'auth_method_type' => :'BetaAppServiceOIDCAuthMethodType', - :'post_logout_redirect_uris' => :'Array', - :'version' => :'BetaAppServiceOIDCVersion', - :'dev_mode' => :'Boolean', - :'access_token_type' => :'BetaAppServiceOIDCTokenType', - :'access_token_role_assertion' => :'Boolean', - :'id_token_role_assertion' => :'Boolean', - :'id_token_userinfo_assertion' => :'Boolean', - :'clock_skew' => :'String', - :'additional_origins' => :'Array', - :'skip_native_app_success_page' => :'Boolean', - :'back_channel_logout_uri' => :'String', - :'login_version' => :'BetaAppServiceLoginVersion' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'dev_mode', - :'access_token_role_assertion', - :'id_token_role_assertion', - :'id_token_userinfo_assertion', - :'skip_native_app_success_page', - :'back_channel_logout_uri', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceUpdateOIDCApplicationConfigurationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceUpdateOIDCApplicationConfigurationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'redirect_uris') - if (value = attributes[:'redirect_uris']).is_a?(Array) - self.redirect_uris = value - end - end - - if attributes.key?(:'response_types') - if (value = attributes[:'response_types']).is_a?(Array) - self.response_types = value - end - end - - if attributes.key?(:'grant_types') - if (value = attributes[:'grant_types']).is_a?(Array) - self.grant_types = value - end - end - - if attributes.key?(:'app_type') - self.app_type = attributes[:'app_type'] - end - - if attributes.key?(:'auth_method_type') - self.auth_method_type = attributes[:'auth_method_type'] - end - - if attributes.key?(:'post_logout_redirect_uris') - if (value = attributes[:'post_logout_redirect_uris']).is_a?(Array) - self.post_logout_redirect_uris = value - end - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'dev_mode') - self.dev_mode = attributes[:'dev_mode'] - end - - if attributes.key?(:'access_token_type') - self.access_token_type = attributes[:'access_token_type'] - end - - if attributes.key?(:'access_token_role_assertion') - self.access_token_role_assertion = attributes[:'access_token_role_assertion'] - end - - if attributes.key?(:'id_token_role_assertion') - self.id_token_role_assertion = attributes[:'id_token_role_assertion'] - end - - if attributes.key?(:'id_token_userinfo_assertion') - self.id_token_userinfo_assertion = attributes[:'id_token_userinfo_assertion'] - end - - if attributes.key?(:'clock_skew') - self.clock_skew = attributes[:'clock_skew'] - end - - if attributes.key?(:'additional_origins') - if (value = attributes[:'additional_origins']).is_a?(Array) - self.additional_origins = value - end - end - - if attributes.key?(:'skip_native_app_success_page') - self.skip_native_app_success_page = attributes[:'skip_native_app_success_page'] - end - - if attributes.key?(:'back_channel_logout_uri') - self.back_channel_logout_uri = attributes[:'back_channel_logout_uri'] - end - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - redirect_uris == o.redirect_uris && - response_types == o.response_types && - grant_types == o.grant_types && - app_type == o.app_type && - auth_method_type == o.auth_method_type && - post_logout_redirect_uris == o.post_logout_redirect_uris && - version == o.version && - dev_mode == o.dev_mode && - access_token_type == o.access_token_type && - access_token_role_assertion == o.access_token_role_assertion && - id_token_role_assertion == o.id_token_role_assertion && - id_token_userinfo_assertion == o.id_token_userinfo_assertion && - clock_skew == o.clock_skew && - additional_origins == o.additional_origins && - skip_native_app_success_page == o.skip_native_app_success_page && - back_channel_logout_uri == o.back_channel_logout_uri && - login_version == o.login_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [redirect_uris, response_types, grant_types, app_type, auth_method_type, post_logout_redirect_uris, version, dev_mode, access_token_type, access_token_role_assertion, id_token_role_assertion, id_token_userinfo_assertion, clock_skew, additional_origins, skip_native_app_success_page, back_channel_logout_uri, login_version].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_update_oidc_application_configuration_request.rb b/lib/zitadel/client/models/beta_app_service_update_oidc_application_configuration_request.rb new file mode 100644 index 00000000..2dee8d63 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_update_oidc_application_configuration_request.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceUpdateOIDCApplicationConfigurationRequest. + class BetaAppServiceUpdateOIDCApplicationConfigurationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + redirect_uris: 'redirectUris', + response_types: 'responseTypes', + grant_types: 'grantTypes', + app_type: 'appType', + auth_method_type: 'authMethodType', + post_logout_redirect_uris: 'postLogoutRedirectUris', + version: 'version', + dev_mode: 'devMode', + access_token_type: 'accessTokenType', + access_token_role_assertion: 'accessTokenRoleAssertion', + id_token_role_assertion: 'idTokenRoleAssertion', + id_token_userinfo_assertion: 'idTokenUserinfoAssertion', + clock_skew: 'clockSkew', + additional_origins: 'additionalOrigins', + skip_native_app_success_page: 'skipNativeAppSuccessPage', + back_channel_logout_uri: 'backChannelLogoutUri', + login_version: 'loginVersion' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + redirect_uris: 'Array', + response_types: 'Array', + grant_types: 'Array', + app_type: 'BetaAppServiceOIDCAppType', + auth_method_type: 'BetaAppServiceOIDCAuthMethodType', + post_logout_redirect_uris: 'Array', + version: 'BetaAppServiceOIDCVersion', + dev_mode: 'Boolean', + access_token_type: 'BetaAppServiceOIDCTokenType', + access_token_role_assertion: 'Boolean', + id_token_role_assertion: 'Boolean', + id_token_userinfo_assertion: 'Boolean', + clock_skew: 'ISO8601::Duration', + additional_origins: 'Array', + skip_native_app_success_page: 'Boolean', + back_channel_logout_uri: 'String', + login_version: 'BetaAppServiceLoginVersion' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :redirect_uris, Types::Any.optional.meta(omittable: true) + # @example null + attribute :response_types, Types::Any.optional.meta(omittable: true) + # @example null + attribute :grant_types, Types::Any.optional.meta(omittable: true) + # @example null + attribute :app_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :post_logout_redirect_uris, Types::Any.optional.meta(omittable: true) + # @example null + attribute :version, Types::Any.optional.meta(omittable: true) + # @example null + attribute :dev_mode, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_role_assertion, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_token_role_assertion, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_token_userinfo_assertion, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :clock_skew, Types::Any.optional.meta(omittable: true) + # @example null + attribute :additional_origins, Types::Any.optional.meta(omittable: true) + # @example null + attribute :skip_native_app_success_page, Types::Any.optional.meta(omittable: true) + # @example null + attribute :back_channel_logout_uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_app_service_update_s_a_m_l_application_configuration_request.rb b/lib/zitadel/client/models/beta_app_service_update_s_a_m_l_application_configuration_request.rb deleted file mode 100644 index c7fafeb8..00000000 --- a/lib/zitadel/client/models/beta_app_service_update_s_a_m_l_application_configuration_request.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAppServiceUpdateSAMLApplicationConfigurationRequest - attr_accessor :login_version - - attr_accessor :metadata_url - - attr_accessor :metadata_xml - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_version' => :'loginVersion', - :'metadata_url' => :'metadataUrl', - :'metadata_xml' => :'metadataXml' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_version' => :'BetaAppServiceLoginVersion', - :'metadata_url' => :'String', - :'metadata_xml' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAppServiceUpdateSAMLApplicationConfigurationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAppServiceUpdateSAMLApplicationConfigurationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_version') - self.login_version = attributes[:'login_version'] - end - - if attributes.key?(:'metadata_url') - self.metadata_url = attributes[:'metadata_url'] - end - - if attributes.key?(:'metadata_xml') - self.metadata_xml = attributes[:'metadata_xml'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_version == o.login_version && - metadata_url == o.metadata_url && - metadata_xml == o.metadata_xml - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_version, metadata_url, metadata_xml].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_app_service_update_saml_application_configuration_request.rb b/lib/zitadel/client/models/beta_app_service_update_saml_application_configuration_request.rb new file mode 100644 index 00000000..4821c954 --- /dev/null +++ b/lib/zitadel/client/models/beta_app_service_update_saml_application_configuration_request.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAppServiceUpdateSAMLApplicationConfigurationRequest. + class BetaAppServiceUpdateSAMLApplicationConfigurationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_version: 'loginVersion', + metadata_url: 'metadataUrl', + metadata_xml: 'metadataXml' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_version: 'BetaAppServiceLoginVersion', + metadata_url: 'String', + metadata_xml: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + metadata_xml: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :login_version, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_xml, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_authorization_service_activate_authorization_request.rb b/lib/zitadel/client/models/beta_authorization_service_activate_authorization_request.rb index f2e7dbed..17ea9d84 100644 --- a/lib/zitadel/client/models/beta_authorization_service_activate_authorization_request.rb +++ b/lib/zitadel/client/models/beta_authorization_service_activate_authorization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceActivateAuthorizationRequest - # ID is the unique identifier of the authorization that should be activated. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceActivateAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceActivateAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceActivateAuthorizationRequest. + class BetaAuthorizationServiceActivateAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the authorization that should be activated. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_activate_authorization_response.rb b/lib/zitadel/client/models/beta_authorization_service_activate_authorization_response.rb index 13aa2d02..514ab87d 100644 --- a/lib/zitadel/client/models/beta_authorization_service_activate_authorization_response.rb +++ b/lib/zitadel/client/models/beta_authorization_service_activate_authorization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceActivateAuthorizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceActivateAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceActivateAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceActivateAuthorizationResponse. + class BetaAuthorizationServiceActivateAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_any.rb b/lib/zitadel/client/models/beta_authorization_service_any.rb index 92c939ff..4290eb2a 100644 --- a/lib/zitadel/client/models/beta_authorization_service_any.rb +++ b/lib/zitadel/client/models/beta_authorization_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaAuthorizationServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaAuthorizationServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_authorization.rb b/lib/zitadel/client/models/beta_authorization_service_authorization.rb index 26da11af..dc967f19 100644 --- a/lib/zitadel/client/models/beta_authorization_service_authorization.rb +++ b/lib/zitadel/client/models/beta_authorization_service_authorization.rb @@ -1,350 +1,127 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceAuthorization - # ID is the unique identifier of the authorization. - attr_accessor :id - - # ID is the unique identifier of the project the user was granted the authorization for. - attr_accessor :project_id - - # Name is the name of the project the user was granted the authorization for. - attr_accessor :project_name - - # OrganizationID is the ID of the organization the project belongs to. - attr_accessor :project_organization_id - - # ID of the granted project, only provided if it is a granted project. - attr_accessor :project_grant_id - - # ID of the organization the project is granted to, only provided if it is a granted project. - attr_accessor :granted_organization_id - - # The unique identifier of the organization the authorization belongs to. - attr_accessor :organization_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :state - - attr_accessor :user - - # Roles contains the roles the user was granted for the project. - attr_accessor :roles - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'project_id' => :'projectId', - :'project_name' => :'projectName', - :'project_organization_id' => :'projectOrganizationId', - :'project_grant_id' => :'projectGrantId', - :'granted_organization_id' => :'grantedOrganizationId', - :'organization_id' => :'organizationId', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'state' => :'state', - :'user' => :'user', - :'roles' => :'roles' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'project_id' => :'String', - :'project_name' => :'String', - :'project_organization_id' => :'String', - :'project_grant_id' => :'String', - :'granted_organization_id' => :'String', - :'organization_id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'state' => :'BetaAuthorizationServiceState', - :'user' => :'BetaAuthorizationServiceUser', - :'roles' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'project_grant_id', - :'granted_organization_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceAuthorization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceAuthorization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'project_name') - self.project_name = attributes[:'project_name'] - end - - if attributes.key?(:'project_organization_id') - self.project_organization_id = attributes[:'project_organization_id'] - end - - if attributes.key?(:'project_grant_id') - self.project_grant_id = attributes[:'project_grant_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - project_id == o.project_id && - project_name == o.project_name && - project_organization_id == o.project_organization_id && - project_grant_id == o.project_grant_id && - granted_organization_id == o.granted_organization_id && - organization_id == o.organization_id && - creation_date == o.creation_date && - change_date == o.change_date && - state == o.state && - user == o.user && - roles == o.roles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, project_id, project_name, project_organization_id, project_grant_id, granted_organization_id, organization_id, creation_date, change_date, state, user, roles].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceAuthorization. + class BetaAuthorizationServiceAuthorization < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + project_id: 'projectId', + project_name: 'projectName', + project_organization_id: 'projectOrganizationId', + project_grant_id: 'projectGrantId', + granted_organization_id: 'grantedOrganizationId', + organization_id: 'organizationId', + creation_date: 'creationDate', + change_date: 'changeDate', + state: 'state', + user: 'user', + roles: 'roles' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + project_id: 'String', + project_name: 'String', + project_organization_id: 'String', + project_grant_id: 'String', + granted_organization_id: 'String', + organization_id: 'String', + creation_date: 'Time', + change_date: 'Time', + state: 'BetaAuthorizationServiceState', + user: 'BetaAuthorizationServiceUser', + roles: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # ID is the unique identifier of the authorization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # ID is the unique identifier of the project the user was granted the authorization for. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Name is the name of the project the user was granted the authorization for. + # @example null + attribute :project_name, Types::Any.optional.meta(omittable: true) + # OrganizationID is the ID of the organization the project belongs to. + # @example null + attribute :project_organization_id, Types::Any.optional.meta(omittable: true) + # ID of the granted project, only provided if it is a granted project. + # @example null + attribute :project_grant_id, Types::Any.optional.meta(omittable: true) + # ID of the organization the project is granted to, only provided if it is a granted project. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) + # The unique identifier of the organization the authorization belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + # Roles contains the roles the user was granted for the project. + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_authorization_field_name.rb b/lib/zitadel/client/models/beta_authorization_service_authorization_field_name.rb index 303330e4..37b08486 100644 --- a/lib/zitadel/client/models/beta_authorization_service_authorization_field_name.rb +++ b/lib/zitadel/client/models/beta_authorization_service_authorization_field_name.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaAuthorizationServiceAuthorizationFieldName - AUTHORIZATION_FIELD_NAME_UNSPECIFIED = "AUTHORIZATION_FIELD_NAME_UNSPECIFIED".freeze - AUTHORIZATION_FIELD_NAME_CREATED_DATE = "AUTHORIZATION_FIELD_NAME_CREATED_DATE".freeze - AUTHORIZATION_FIELD_NAME_CHANGED_DATE = "AUTHORIZATION_FIELD_NAME_CHANGED_DATE".freeze - AUTHORIZATION_FIELD_NAME_ID = "AUTHORIZATION_FIELD_NAME_ID".freeze - AUTHORIZATION_FIELD_NAME_USER_ID = "AUTHORIZATION_FIELD_NAME_USER_ID".freeze - AUTHORIZATION_FIELD_NAME_PROJECT_ID = "AUTHORIZATION_FIELD_NAME_PROJECT_ID".freeze - AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID = "AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID".freeze - AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID = "AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID".freeze - - def self.all_vars - @all_vars ||= [AUTHORIZATION_FIELD_NAME_UNSPECIFIED, AUTHORIZATION_FIELD_NAME_CREATED_DATE, AUTHORIZATION_FIELD_NAME_CHANGED_DATE, AUTHORIZATION_FIELD_NAME_ID, AUTHORIZATION_FIELD_NAME_USER_ID, AUTHORIZATION_FIELD_NAME_PROJECT_ID, AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID, AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAuthorizationServiceAuthorizationFieldName. + class BetaAuthorizationServiceAuthorizationFieldName + AUTHORIZATION_FIELD_NAME_UNSPECIFIED = 'AUTHORIZATION_FIELD_NAME_UNSPECIFIED' + AUTHORIZATION_FIELD_NAME_CREATED_DATE = 'AUTHORIZATION_FIELD_NAME_CREATED_DATE' + AUTHORIZATION_FIELD_NAME_CHANGED_DATE = 'AUTHORIZATION_FIELD_NAME_CHANGED_DATE' + AUTHORIZATION_FIELD_NAME_ID = 'AUTHORIZATION_FIELD_NAME_ID' + AUTHORIZATION_FIELD_NAME_USER_ID = 'AUTHORIZATION_FIELD_NAME_USER_ID' + AUTHORIZATION_FIELD_NAME_PROJECT_ID = 'AUTHORIZATION_FIELD_NAME_PROJECT_ID' + AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID = 'AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID' + AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID = 'AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [AUTHORIZATION_FIELD_NAME_UNSPECIFIED, AUTHORIZATION_FIELD_NAME_CREATED_DATE, AUTHORIZATION_FIELD_NAME_CHANGED_DATE, AUTHORIZATION_FIELD_NAME_ID, AUTHORIZATION_FIELD_NAME_USER_ID, AUTHORIZATION_FIELD_NAME_PROJECT_ID, AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID, AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAuthorizationServiceAuthorizationFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAuthorizationServiceAuthorizationFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAuthorizationServiceAuthorizationFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_authorizations_search_filter.rb b/lib/zitadel/client/models/beta_authorization_service_authorizations_search_filter.rb index dde4c32d..c09363a0 100644 --- a/lib/zitadel/client/models/beta_authorization_service_authorizations_search_filter.rb +++ b/lib/zitadel/client/models/beta_authorization_service_authorizations_search_filter.rb @@ -1,314 +1,117 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceAuthorizationsSearchFilter - attr_accessor :authorization_ids - - attr_accessor :in_user_ids - - attr_accessor :organization_id - - attr_accessor :project_grant_id - - attr_accessor :project_id - - attr_accessor :project_name - - attr_accessor :role_key - - attr_accessor :state - - attr_accessor :user_display_name - - attr_accessor :user_id - - attr_accessor :user_organization_id - - attr_accessor :user_preferred_login_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'authorization_ids' => :'authorizationIds', - :'in_user_ids' => :'inUserIds', - :'organization_id' => :'organizationId', - :'project_grant_id' => :'projectGrantId', - :'project_id' => :'projectId', - :'project_name' => :'projectName', - :'role_key' => :'roleKey', - :'state' => :'state', - :'user_display_name' => :'userDisplayName', - :'user_id' => :'userId', - :'user_organization_id' => :'userOrganizationId', - :'user_preferred_login_name' => :'userPreferredLoginName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'authorization_ids' => :'BetaAuthorizationServiceInIDsFilter', - :'in_user_ids' => :'BetaAuthorizationServiceInIDsFilter', - :'organization_id' => :'BetaAuthorizationServiceIDFilter', - :'project_grant_id' => :'BetaAuthorizationServiceIDFilter', - :'project_id' => :'BetaAuthorizationServiceIDFilter', - :'project_name' => :'BetaAuthorizationServiceProjectNameQuery', - :'role_key' => :'BetaAuthorizationServiceRoleKeyQuery', - :'state' => :'BetaAuthorizationServiceStateQuery', - :'user_display_name' => :'BetaAuthorizationServiceUserDisplayNameQuery', - :'user_id' => :'BetaAuthorizationServiceIDFilter', - :'user_organization_id' => :'BetaAuthorizationServiceIDFilter', - :'user_preferred_login_name' => :'BetaAuthorizationServiceUserPreferredLoginNameQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceAuthorizationsSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceAuthorizationsSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'authorization_ids') - self.authorization_ids = attributes[:'authorization_ids'] - end - - if attributes.key?(:'in_user_ids') - self.in_user_ids = attributes[:'in_user_ids'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'project_grant_id') - self.project_grant_id = attributes[:'project_grant_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'project_name') - self.project_name = attributes[:'project_name'] - end - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'user_display_name') - self.user_display_name = attributes[:'user_display_name'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'user_organization_id') - self.user_organization_id = attributes[:'user_organization_id'] - end - - if attributes.key?(:'user_preferred_login_name') - self.user_preferred_login_name = attributes[:'user_preferred_login_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - authorization_ids == o.authorization_ids && - in_user_ids == o.in_user_ids && - organization_id == o.organization_id && - project_grant_id == o.project_grant_id && - project_id == o.project_id && - project_name == o.project_name && - role_key == o.role_key && - state == o.state && - user_display_name == o.user_display_name && - user_id == o.user_id && - user_organization_id == o.user_organization_id && - user_preferred_login_name == o.user_preferred_login_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [authorization_ids, in_user_ids, organization_id, project_grant_id, project_id, project_name, role_key, state, user_display_name, user_id, user_organization_id, user_preferred_login_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceAuthorizationsSearchFilter. + class BetaAuthorizationServiceAuthorizationsSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + authorization_ids: 'authorizationIds', + in_user_ids: 'inUserIds', + organization_id: 'organizationId', + project_grant_id: 'projectGrantId', + project_id: 'projectId', + project_name: 'projectName', + role_key: 'roleKey', + state: 'state', + user_display_name: 'userDisplayName', + user_id: 'userId', + user_organization_id: 'userOrganizationId', + user_preferred_login_name: 'userPreferredLoginName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + authorization_ids: 'BetaAuthorizationServiceInIDsFilter', + in_user_ids: 'BetaAuthorizationServiceInIDsFilter', + organization_id: 'BetaAuthorizationServiceIDFilter', + project_grant_id: 'BetaAuthorizationServiceIDFilter', + project_id: 'BetaAuthorizationServiceIDFilter', + project_name: 'BetaAuthorizationServiceProjectNameQuery', + role_key: 'BetaAuthorizationServiceRoleKeyQuery', + state: 'BetaAuthorizationServiceStateQuery', + user_display_name: 'BetaAuthorizationServiceUserDisplayNameQuery', + user_id: 'BetaAuthorizationServiceIDFilter', + user_organization_id: 'BetaAuthorizationServiceIDFilter', + user_preferred_login_name: 'BetaAuthorizationServiceUserPreferredLoginNameQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :authorization_ids, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_user_ids, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grant_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_preferred_login_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_connect_error.rb b/lib/zitadel/client/models/beta_authorization_service_connect_error.rb index c624e747..cee5f955 100644 --- a/lib/zitadel/client/models/beta_authorization_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_authorization_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaAuthorizationServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaAuthorizationServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_create_authorization_request.rb b/lib/zitadel/client/models/beta_authorization_service_create_authorization_request.rb index 29ced1e6..c4e14c72 100644 --- a/lib/zitadel/client/models/beta_authorization_service_create_authorization_request.rb +++ b/lib/zitadel/client/models/beta_authorization_service_create_authorization_request.rb @@ -1,249 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceCreateAuthorizationRequest - # UserID is the ID of the user who should be granted the authorization. - attr_accessor :user_id - - # Project ID is the ID of the project the user should be authorized for. - attr_accessor :project_id - - # OrganizationID is the ID of the organization on which the authorization should be created. The organization must either own the project or have a grant for the project. If omitted, the authorization is created on the projects organization. - attr_accessor :organization_id - - # RoleKeys are the keys of the roles the user should be granted. - attr_accessor :role_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'project_id' => :'projectId', - :'organization_id' => :'organizationId', - :'role_keys' => :'roleKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'project_id' => :'String', - :'organization_id' => :'String', - :'role_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'organization_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceCreateAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceCreateAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'role_keys') - if (value = attributes[:'role_keys']).is_a?(Array) - self.role_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - project_id == o.project_id && - organization_id == o.organization_id && - role_keys == o.role_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, project_id, organization_id, role_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceCreateAuthorizationRequest. + class BetaAuthorizationServiceCreateAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + project_id: 'projectId', + organization_id: 'organizationId', + role_keys: 'roleKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + project_id: 'String', + organization_id: 'String', + role_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # UserID is the ID of the user who should be granted the authorization. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # Project ID is the ID of the project the user should be authorized for. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # OrganizationID is the ID of the organization on which the authorization should be created. The organization must either own the project or have a grant for the project. If omitted, the authorization is created on the projects organization. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # RoleKeys are the keys of the roles the user should be granted. + # @example null + attribute :role_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_create_authorization_response.rb b/lib/zitadel/client/models/beta_authorization_service_create_authorization_response.rb index e8c5b3c5..20842c6a 100644 --- a/lib/zitadel/client/models/beta_authorization_service_create_authorization_response.rb +++ b/lib/zitadel/client/models/beta_authorization_service_create_authorization_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceCreateAuthorizationResponse - # ID is the unique identifier of the newly created authorization. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceCreateAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceCreateAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceCreateAuthorizationResponse. + class BetaAuthorizationServiceCreateAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the newly created authorization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_request.rb b/lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_request.rb index 36780f60..f83343a3 100644 --- a/lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_request.rb +++ b/lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceDeactivateAuthorizationRequest - # ID is the unique identifier of the authorization that should be deactivated. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceDeactivateAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceDeactivateAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceDeactivateAuthorizationRequest. + class BetaAuthorizationServiceDeactivateAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the authorization that should be deactivated. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_response.rb b/lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_response.rb index a53e7aac..88138002 100644 --- a/lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_response.rb +++ b/lib/zitadel/client/models/beta_authorization_service_deactivate_authorization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceDeactivateAuthorizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceDeactivateAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceDeactivateAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceDeactivateAuthorizationResponse. + class BetaAuthorizationServiceDeactivateAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_delete_authorization_request.rb b/lib/zitadel/client/models/beta_authorization_service_delete_authorization_request.rb index dec1b972..f5775f75 100644 --- a/lib/zitadel/client/models/beta_authorization_service_delete_authorization_request.rb +++ b/lib/zitadel/client/models/beta_authorization_service_delete_authorization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceDeleteAuthorizationRequest - # ID is the unique identifier of the authorization that should be deleted. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceDeleteAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceDeleteAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceDeleteAuthorizationRequest. + class BetaAuthorizationServiceDeleteAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the authorization that should be deleted. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_delete_authorization_response.rb b/lib/zitadel/client/models/beta_authorization_service_delete_authorization_response.rb index 5949e29a..47019b65 100644 --- a/lib/zitadel/client/models/beta_authorization_service_delete_authorization_response.rb +++ b/lib/zitadel/client/models/beta_authorization_service_delete_authorization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceDeleteAuthorizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceDeleteAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceDeleteAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceDeleteAuthorizationResponse. + class BetaAuthorizationServiceDeleteAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_i_d_filter.rb b/lib/zitadel/client/models/beta_authorization_service_i_d_filter.rb deleted file mode 100644 index 6ec9864a..00000000 --- a/lib/zitadel/client/models/beta_authorization_service_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceIDFilter - # Only return resources that belong to this id. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_authorization_service_id_filter.rb b/lib/zitadel/client/models/beta_authorization_service_id_filter.rb new file mode 100644 index 00000000..f36a436a --- /dev/null +++ b/lib/zitadel/client/models/beta_authorization_service_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceIDFilter. + class BetaAuthorizationServiceIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Only return resources that belong to this id. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_authorization_service_in_i_ds_filter.rb b/lib/zitadel/client/models/beta_authorization_service_in_i_ds_filter.rb deleted file mode 100644 index d294035f..00000000 --- a/lib/zitadel/client/models/beta_authorization_service_in_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceInIDsFilter - # Defines the ids to query for. - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceInIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceInIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_authorization_service_in_ids_filter.rb b/lib/zitadel/client/models/beta_authorization_service_in_ids_filter.rb new file mode 100644 index 00000000..8f631d1e --- /dev/null +++ b/lib/zitadel/client/models/beta_authorization_service_in_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceInIDsFilter. + class BetaAuthorizationServiceInIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_authorization_service_list_authorizations_request.rb b/lib/zitadel/client/models/beta_authorization_service_list_authorizations_request.rb index 826c1425..75f202a3 100644 --- a/lib/zitadel/client/models/beta_authorization_service_list_authorizations_request.rb +++ b/lib/zitadel/client/models/beta_authorization_service_list_authorizations_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceListAuthorizationsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaAuthorizationServicePaginationRequest', - :'sorting_column' => :'BetaAuthorizationServiceAuthorizationFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceListAuthorizationsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceListAuthorizationsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceListAuthorizationsRequest. + class BetaAuthorizationServiceListAuthorizationsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaAuthorizationServicePaginationRequest', + sorting_column: 'BetaAuthorizationServiceAuthorizationFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_list_authorizations_response.rb b/lib/zitadel/client/models/beta_authorization_service_list_authorizations_response.rb index ad502ae4..99d99935 100644 --- a/lib/zitadel/client/models/beta_authorization_service_list_authorizations_response.rb +++ b/lib/zitadel/client/models/beta_authorization_service_list_authorizations_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceListAuthorizationsResponse - attr_accessor :pagination - - attr_accessor :authorizations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'authorizations' => :'authorizations' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaAuthorizationServicePaginationResponse', - :'authorizations' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceListAuthorizationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceListAuthorizationsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'authorizations') - if (value = attributes[:'authorizations']).is_a?(Array) - self.authorizations = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - authorizations == o.authorizations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, authorizations].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceListAuthorizationsResponse. + class BetaAuthorizationServiceListAuthorizationsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + authorizations: 'authorizations' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaAuthorizationServicePaginationResponse', + authorizations: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :authorizations, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_pagination_request.rb b/lib/zitadel/client/models/beta_authorization_service_pagination_request.rb index 61142d04..ae8a8274 100644 --- a/lib/zitadel/client/models/beta_authorization_service_pagination_request.rb +++ b/lib/zitadel/client/models/beta_authorization_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServicePaginationRequest. + class BetaAuthorizationServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_pagination_response.rb b/lib/zitadel/client/models/beta_authorization_service_pagination_response.rb index 1da3c539..3eb93cd5 100644 --- a/lib/zitadel/client/models/beta_authorization_service_pagination_response.rb +++ b/lib/zitadel/client/models/beta_authorization_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServicePaginationResponse. + class BetaAuthorizationServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_project_name_query.rb b/lib/zitadel/client/models/beta_authorization_service_project_name_query.rb index a0124423..4c0b1645 100644 --- a/lib/zitadel/client/models/beta_authorization_service_project_name_query.rb +++ b/lib/zitadel/client/models/beta_authorization_service_project_name_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceProjectNameQuery - # Specify the name of the project the user was granted the authorization for to search for. Note that this will also include authorizations granted for project grants of the same project. - attr_accessor :name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'method' => :'BetaAuthorizationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceProjectNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceProjectNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceProjectNameQuery. + class BetaAuthorizationServiceProjectNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + method: 'BetaAuthorizationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Specify the name of the project the user was granted the authorization for to search for. Note that this will also include authorizations granted for project grants of the same project. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_role_key_query.rb b/lib/zitadel/client/models/beta_authorization_service_role_key_query.rb index e9f7b134..76251f6c 100644 --- a/lib/zitadel/client/models/beta_authorization_service_role_key_query.rb +++ b/lib/zitadel/client/models/beta_authorization_service_role_key_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceRoleKeyQuery - # Specify the key of the role the user was granted to search for. - attr_accessor :key - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'method' => :'BetaAuthorizationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceRoleKeyQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceRoleKeyQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceRoleKeyQuery. + class BetaAuthorizationServiceRoleKeyQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + method: 'BetaAuthorizationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Specify the key of the role the user was granted to search for. + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_state.rb b/lib/zitadel/client/models/beta_authorization_service_state.rb index c17c6795..1aae340a 100644 --- a/lib/zitadel/client/models/beta_authorization_service_state.rb +++ b/lib/zitadel/client/models/beta_authorization_service_state.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaAuthorizationServiceState - STATE_UNSPECIFIED = "STATE_UNSPECIFIED".freeze - STATE_ACTIVE = "STATE_ACTIVE".freeze - STATE_INACTIVE = "STATE_INACTIVE".freeze - - def self.all_vars - @all_vars ||= [STATE_UNSPECIFIED, STATE_ACTIVE, STATE_INACTIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAuthorizationServiceState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAuthorizationServiceState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAuthorizationServiceState. + class BetaAuthorizationServiceState + STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' + STATE_ACTIVE = 'STATE_ACTIVE' + STATE_INACTIVE = 'STATE_INACTIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [STATE_UNSPECIFIED, STATE_ACTIVE, STATE_INACTIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAuthorizationServiceState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_state_query.rb b/lib/zitadel/client/models/beta_authorization_service_state_query.rb index 0975547b..cd848d0c 100644 --- a/lib/zitadel/client/models/beta_authorization_service_state_query.rb +++ b/lib/zitadel/client/models/beta_authorization_service_state_query.rb @@ -1,237 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceStateQuery - attr_accessor :state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'state' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'BetaAuthorizationServiceState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceStateQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceStateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceStateQuery. + class BetaAuthorizationServiceStateQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + state: 'state' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + state: 'BetaAuthorizationServiceState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_text_filter_method.rb b/lib/zitadel/client/models/beta_authorization_service_text_filter_method.rb index 40ad920d..3666b85c 100644 --- a/lib/zitadel/client/models/beta_authorization_service_text_filter_method.rb +++ b/lib/zitadel/client/models/beta_authorization_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaAuthorizationServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaAuthorizationServiceTextFilterMethod. + class BetaAuthorizationServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaAuthorizationServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaAuthorizationServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaAuthorizationServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_update_authorization_request.rb b/lib/zitadel/client/models/beta_authorization_service_update_authorization_request.rb index 286ec1d8..d2e340fe 100644 --- a/lib/zitadel/client/models/beta_authorization_service_update_authorization_request.rb +++ b/lib/zitadel/client/models/beta_authorization_service_update_authorization_request.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceUpdateAuthorizationRequest - # ID is the unique identifier of the authorization. - attr_accessor :id - - # RoleKeys are the keys of the roles the user should be granted. Note that any role keys previously granted to the user and not present in the list will be revoked. - attr_accessor :role_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'role_keys' => :'roleKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'role_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceUpdateAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceUpdateAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'role_keys') - if (value = attributes[:'role_keys']).is_a?(Array) - self.role_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - role_keys == o.role_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, role_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceUpdateAuthorizationRequest. + class BetaAuthorizationServiceUpdateAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + role_keys: 'roleKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + role_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the authorization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # RoleKeys are the keys of the roles the user should be granted. Note that any role keys previously granted to the user and not present in the list will be revoked. + # @example null + attribute :role_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_update_authorization_response.rb b/lib/zitadel/client/models/beta_authorization_service_update_authorization_response.rb index 6e42170c..70509871 100644 --- a/lib/zitadel/client/models/beta_authorization_service_update_authorization_response.rb +++ b/lib/zitadel/client/models/beta_authorization_service_update_authorization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceUpdateAuthorizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceUpdateAuthorizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceUpdateAuthorizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceUpdateAuthorizationResponse. + class BetaAuthorizationServiceUpdateAuthorizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_user.rb b/lib/zitadel/client/models/beta_authorization_service_user.rb index 7f2d02d3..08d8e99f 100644 --- a/lib/zitadel/client/models/beta_authorization_service_user.rb +++ b/lib/zitadel/client/models/beta_authorization_service_user.rb @@ -1,256 +1,94 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceUser - # ID represents the ID of the user who was granted the authorization. - attr_accessor :id - - # PreferredLoginName represents the preferred login name of the granted user. - attr_accessor :preferred_login_name - - # DisplayName represents the public display name of the granted user. - attr_accessor :display_name - - # AvatarURL is the URL to the user's public avatar image. - attr_accessor :avatar_url - - # The organization the user belong to. This does not have to correspond with the authorizations organization. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'preferred_login_name' => :'preferredLoginName', - :'display_name' => :'displayName', - :'avatar_url' => :'avatarUrl', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'preferred_login_name' => :'String', - :'display_name' => :'String', - :'avatar_url' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'avatar_url') - self.avatar_url = attributes[:'avatar_url'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - preferred_login_name == o.preferred_login_name && - display_name == o.display_name && - avatar_url == o.avatar_url && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, preferred_login_name, display_name, avatar_url, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceUser. + class BetaAuthorizationServiceUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + preferred_login_name: 'preferredLoginName', + display_name: 'displayName', + avatar_url: 'avatarUrl', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + preferred_login_name: 'String', + display_name: 'String', + avatar_url: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID represents the ID of the user who was granted the authorization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # PreferredLoginName represents the preferred login name of the granted user. + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # DisplayName represents the public display name of the granted user. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # AvatarURL is the URL to the user's public avatar image. + # @example null + attribute :avatar_url, Types::Any.optional.meta(omittable: true) + # The organization the user belong to. This does not have to correspond with the authorizations organization. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_user_display_name_query.rb b/lib/zitadel/client/models/beta_authorization_service_user_display_name_query.rb index f02b2e0d..17f318c8 100644 --- a/lib/zitadel/client/models/beta_authorization_service_user_display_name_query.rb +++ b/lib/zitadel/client/models/beta_authorization_service_user_display_name_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceUserDisplayNameQuery - # Specify the public display name of the granted user to search for. - attr_accessor :display_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name' => :'displayName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name' => :'String', - :'method' => :'BetaAuthorizationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceUserDisplayNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceUserDisplayNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name == o.display_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceUserDisplayNameQuery. + class BetaAuthorizationServiceUserDisplayNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name: 'displayName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name: 'String', + method: 'BetaAuthorizationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Specify the public display name of the granted user to search for. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_authorization_service_user_preferred_login_name_query.rb b/lib/zitadel/client/models/beta_authorization_service_user_preferred_login_name_query.rb index 46eee9d5..6f4f366a 100644 --- a/lib/zitadel/client/models/beta_authorization_service_user_preferred_login_name_query.rb +++ b/lib/zitadel/client/models/beta_authorization_service_user_preferred_login_name_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaAuthorizationServiceUserPreferredLoginNameQuery - # Specify the preferred login name of the granted user to search for. - attr_accessor :login_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_name' => :'loginName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_name' => :'String', - :'method' => :'BetaAuthorizationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaAuthorizationServiceUserPreferredLoginNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaAuthorizationServiceUserPreferredLoginNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_name') - self.login_name = attributes[:'login_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_name == o.login_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaAuthorizationServiceUserPreferredLoginNameQuery. + class BetaAuthorizationServiceUserPreferredLoginNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_name: 'loginName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_name: 'String', + method: 'BetaAuthorizationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Specify the preferred login name of the granted user to search for. + # @example null + attribute :login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_any.rb b/lib/zitadel/client/models/beta_feature_service_any.rb index 786c80b3..506a56f1 100644 --- a/lib/zitadel/client/models/beta_feature_service_any.rb +++ b/lib/zitadel/client/models/beta_feature_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaFeatureServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaFeatureServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_connect_error.rb b/lib/zitadel/client/models/beta_feature_service_connect_error.rb index 7c881f28..163e9d9b 100644 --- a/lib/zitadel/client/models/beta_feature_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_feature_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaFeatureServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaFeatureServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_details.rb b/lib/zitadel/client/models/beta_feature_service_details.rb index b91a6f88..5d3cd5ba 100644 --- a/lib/zitadel/client/models/beta_feature_service_details.rb +++ b/lib/zitadel/client/models/beta_feature_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceDetails. + class BetaFeatureServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_feature_flag.rb b/lib/zitadel/client/models/beta_feature_service_feature_flag.rb index a6ce34c6..375c53dc 100644 --- a/lib/zitadel/client/models/beta_feature_service_feature_flag.rb +++ b/lib/zitadel/client/models/beta_feature_service_feature_flag.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # FeatureFlag is a simple boolean Feature setting, without further payload. - class BetaFeatureServiceFeatureFlag - attr_accessor :enabled - - attr_accessor :source - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enabled' => :'enabled', - :'source' => :'source' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'enabled' => :'Boolean', - :'source' => :'BetaFeatureServiceSource' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceFeatureFlag` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceFeatureFlag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enabled') - self.enabled = attributes[:'enabled'] - end - - if attributes.key?(:'source') - self.source = attributes[:'source'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enabled == o.enabled && - source == o.source - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enabled, source].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # FeatureFlag is a simple boolean Feature setting, without further payload. + class BetaFeatureServiceFeatureFlag < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + enabled: 'enabled', + source: 'source' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + enabled: 'Boolean', + source: 'BetaFeatureServiceSource' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :enabled, Types::Any.optional.meta(omittable: true) + # @example null + attribute :source, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_get_instance_features_request.rb b/lib/zitadel/client/models/beta_feature_service_get_instance_features_request.rb index f12337ac..144227b4 100644 --- a/lib/zitadel/client/models/beta_feature_service_get_instance_features_request.rb +++ b/lib/zitadel/client/models/beta_feature_service_get_instance_features_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceGetInstanceFeaturesRequest - attr_accessor :inheritance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'inheritance' => :'inheritance' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'inheritance' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetInstanceFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetInstanceFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'inheritance') - self.inheritance = attributes[:'inheritance'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - inheritance == o.inheritance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [inheritance].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceGetInstanceFeaturesRequest. + class BetaFeatureServiceGetInstanceFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + inheritance: 'inheritance' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + inheritance: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :inheritance, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_get_instance_features_response.rb b/lib/zitadel/client/models/beta_feature_service_get_instance_features_response.rb index feda0816..67759744 100644 --- a/lib/zitadel/client/models/beta_feature_service_get_instance_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_get_instance_features_response.rb @@ -1,269 +1,97 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceGetInstanceFeaturesResponse - attr_accessor :details - - attr_accessor :login_default_org - - attr_accessor :user_schema - - attr_accessor :oidc_token_exchange - - attr_accessor :improved_performance - - attr_accessor :debug_oidc_parent_error - - attr_accessor :oidc_single_v1_session_termination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'login_default_org' => :'loginDefaultOrg', - :'user_schema' => :'userSchema', - :'oidc_token_exchange' => :'oidcTokenExchange', - :'improved_performance' => :'improvedPerformance', - :'debug_oidc_parent_error' => :'debugOidcParentError', - :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails', - :'login_default_org' => :'BetaFeatureServiceFeatureFlag', - :'user_schema' => :'BetaFeatureServiceFeatureFlag', - :'oidc_token_exchange' => :'BetaFeatureServiceFeatureFlag', - :'improved_performance' => :'BetaFeatureServiceImprovedPerformanceFeatureFlag', - :'debug_oidc_parent_error' => :'BetaFeatureServiceFeatureFlag', - :'oidc_single_v1_session_termination' => :'BetaFeatureServiceFeatureFlag' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetInstanceFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetInstanceFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'login_default_org') - self.login_default_org = attributes[:'login_default_org'] - end - - if attributes.key?(:'user_schema') - self.user_schema = attributes[:'user_schema'] - end - - if attributes.key?(:'oidc_token_exchange') - self.oidc_token_exchange = attributes[:'oidc_token_exchange'] - end - - if attributes.key?(:'improved_performance') - self.improved_performance = attributes[:'improved_performance'] - end - - if attributes.key?(:'debug_oidc_parent_error') - self.debug_oidc_parent_error = attributes[:'debug_oidc_parent_error'] - end - - if attributes.key?(:'oidc_single_v1_session_termination') - self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - login_default_org == o.login_default_org && - user_schema == o.user_schema && - oidc_token_exchange == o.oidc_token_exchange && - improved_performance == o.improved_performance && - debug_oidc_parent_error == o.debug_oidc_parent_error && - oidc_single_v1_session_termination == o.oidc_single_v1_session_termination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, login_default_org, user_schema, oidc_token_exchange, improved_performance, debug_oidc_parent_error, oidc_single_v1_session_termination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceGetInstanceFeaturesResponse. + class BetaFeatureServiceGetInstanceFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + login_default_org: 'loginDefaultOrg', + user_schema: 'userSchema', + oidc_token_exchange: 'oidcTokenExchange', + improved_performance: 'improvedPerformance', + debug_oidc_parent_error: 'debugOidcParentError', + oidc_single_v1_session_termination: 'oidcSingleV1SessionTermination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails', + login_default_org: 'BetaFeatureServiceFeatureFlag', + user_schema: 'BetaFeatureServiceFeatureFlag', + oidc_token_exchange: 'BetaFeatureServiceFeatureFlag', + improved_performance: 'BetaFeatureServiceImprovedPerformanceFeatureFlag', + debug_oidc_parent_error: 'BetaFeatureServiceFeatureFlag', + oidc_single_v1_session_termination: 'BetaFeatureServiceFeatureFlag' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_default_org, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_schema, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_token_exchange, Types::Any.optional.meta(omittable: true) + # @example null + attribute :improved_performance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :debug_oidc_parent_error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_single_v1_session_termination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_get_organization_features_request.rb b/lib/zitadel/client/models/beta_feature_service_get_organization_features_request.rb index ad17c735..3d634402 100644 --- a/lib/zitadel/client/models/beta_feature_service_get_organization_features_request.rb +++ b/lib/zitadel/client/models/beta_feature_service_get_organization_features_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceGetOrganizationFeaturesRequest - attr_accessor :organization_id - - attr_accessor :inheritance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'inheritance' => :'inheritance' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'inheritance' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetOrganizationFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'inheritance') - self.inheritance = attributes[:'inheritance'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - inheritance == o.inheritance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, inheritance].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceGetOrganizationFeaturesRequest. + class BetaFeatureServiceGetOrganizationFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + inheritance: 'inheritance' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + inheritance: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :inheritance, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_get_organization_features_response.rb b/lib/zitadel/client/models/beta_feature_service_get_organization_features_response.rb index 52b758c6..4da7b2c4 100644 --- a/lib/zitadel/client/models/beta_feature_service_get_organization_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_get_organization_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceGetOrganizationFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetOrganizationFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetOrganizationFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceGetOrganizationFeaturesResponse. + class BetaFeatureServiceGetOrganizationFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_get_system_features_response.rb b/lib/zitadel/client/models/beta_feature_service_get_system_features_response.rb index fa3540ae..88ed5a49 100644 --- a/lib/zitadel/client/models/beta_feature_service_get_system_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_get_system_features_response.rb @@ -1,260 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceGetSystemFeaturesResponse - attr_accessor :details - - attr_accessor :login_default_org - - attr_accessor :user_schema - - attr_accessor :oidc_token_exchange - - attr_accessor :improved_performance - - attr_accessor :oidc_single_v1_session_termination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'login_default_org' => :'loginDefaultOrg', - :'user_schema' => :'userSchema', - :'oidc_token_exchange' => :'oidcTokenExchange', - :'improved_performance' => :'improvedPerformance', - :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails', - :'login_default_org' => :'BetaFeatureServiceFeatureFlag', - :'user_schema' => :'BetaFeatureServiceFeatureFlag', - :'oidc_token_exchange' => :'BetaFeatureServiceFeatureFlag', - :'improved_performance' => :'BetaFeatureServiceImprovedPerformanceFeatureFlag', - :'oidc_single_v1_session_termination' => :'BetaFeatureServiceFeatureFlag' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetSystemFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetSystemFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'login_default_org') - self.login_default_org = attributes[:'login_default_org'] - end - - if attributes.key?(:'user_schema') - self.user_schema = attributes[:'user_schema'] - end - - if attributes.key?(:'oidc_token_exchange') - self.oidc_token_exchange = attributes[:'oidc_token_exchange'] - end - - if attributes.key?(:'improved_performance') - self.improved_performance = attributes[:'improved_performance'] - end - - if attributes.key?(:'oidc_single_v1_session_termination') - self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - login_default_org == o.login_default_org && - user_schema == o.user_schema && - oidc_token_exchange == o.oidc_token_exchange && - improved_performance == o.improved_performance && - oidc_single_v1_session_termination == o.oidc_single_v1_session_termination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, login_default_org, user_schema, oidc_token_exchange, improved_performance, oidc_single_v1_session_termination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceGetSystemFeaturesResponse. + class BetaFeatureServiceGetSystemFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + login_default_org: 'loginDefaultOrg', + user_schema: 'userSchema', + oidc_token_exchange: 'oidcTokenExchange', + improved_performance: 'improvedPerformance', + oidc_single_v1_session_termination: 'oidcSingleV1SessionTermination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails', + login_default_org: 'BetaFeatureServiceFeatureFlag', + user_schema: 'BetaFeatureServiceFeatureFlag', + oidc_token_exchange: 'BetaFeatureServiceFeatureFlag', + improved_performance: 'BetaFeatureServiceImprovedPerformanceFeatureFlag', + oidc_single_v1_session_termination: 'BetaFeatureServiceFeatureFlag' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_default_org, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_schema, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_token_exchange, Types::Any.optional.meta(omittable: true) + # @example null + attribute :improved_performance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_single_v1_session_termination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_get_user_features_request.rb b/lib/zitadel/client/models/beta_feature_service_get_user_features_request.rb index bcf82e70..fe2fd92c 100644 --- a/lib/zitadel/client/models/beta_feature_service_get_user_features_request.rb +++ b/lib/zitadel/client/models/beta_feature_service_get_user_features_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceGetUserFeaturesRequest - attr_accessor :user_id - - attr_accessor :inheritance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'inheritance' => :'inheritance' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'inheritance' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetUserFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetUserFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'inheritance') - self.inheritance = attributes[:'inheritance'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - inheritance == o.inheritance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, inheritance].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceGetUserFeaturesRequest. + class BetaFeatureServiceGetUserFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + inheritance: 'inheritance' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + inheritance: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :inheritance, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_get_user_features_response.rb b/lib/zitadel/client/models/beta_feature_service_get_user_features_response.rb index d1baea54..9ea0f4db 100644 --- a/lib/zitadel/client/models/beta_feature_service_get_user_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_get_user_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceGetUserFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceGetUserFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceGetUserFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceGetUserFeaturesResponse. + class BetaFeatureServiceGetUserFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_improved_performance.rb b/lib/zitadel/client/models/beta_feature_service_improved_performance.rb index cb46ad37..b4e75e83 100644 --- a/lib/zitadel/client/models/beta_feature_service_improved_performance.rb +++ b/lib/zitadel/client/models/beta_feature_service_improved_performance.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaFeatureServiceImprovedPerformance - IMPROVED_PERFORMANCE_UNSPECIFIED = "IMPROVED_PERFORMANCE_UNSPECIFIED".freeze - IMPROVED_PERFORMANCE_PROJECT_GRANT = "IMPROVED_PERFORMANCE_PROJECT_GRANT".freeze - IMPROVED_PERFORMANCE_PROJECT = "IMPROVED_PERFORMANCE_PROJECT".freeze - IMPROVED_PERFORMANCE_USER_GRANT = "IMPROVED_PERFORMANCE_USER_GRANT".freeze - IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED = "IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaFeatureServiceImprovedPerformance. + class BetaFeatureServiceImprovedPerformance + IMPROVED_PERFORMANCE_UNSPECIFIED = 'IMPROVED_PERFORMANCE_UNSPECIFIED' + IMPROVED_PERFORMANCE_PROJECT_GRANT = 'IMPROVED_PERFORMANCE_PROJECT_GRANT' + IMPROVED_PERFORMANCE_PROJECT = 'IMPROVED_PERFORMANCE_PROJECT' + IMPROVED_PERFORMANCE_USER_GRANT = 'IMPROVED_PERFORMANCE_USER_GRANT' + IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED = 'IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED' - def self.all_vars - @all_vars ||= [IMPROVED_PERFORMANCE_UNSPECIFIED, IMPROVED_PERFORMANCE_PROJECT_GRANT, IMPROVED_PERFORMANCE_PROJECT, IMPROVED_PERFORMANCE_USER_GRANT, IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [IMPROVED_PERFORMANCE_UNSPECIFIED, IMPROVED_PERFORMANCE_PROJECT_GRANT, IMPROVED_PERFORMANCE_PROJECT, IMPROVED_PERFORMANCE_USER_GRANT, IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaFeatureServiceImprovedPerformance.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaFeatureServiceImprovedPerformance" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaFeatureServiceImprovedPerformance: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rb b/lib/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rb index bcbc7843..f9020b05 100644 --- a/lib/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rb +++ b/lib/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rb @@ -1,248 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceImprovedPerformanceFeatureFlag - attr_accessor :execution_paths - - attr_accessor :source - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'execution_paths' => :'executionPaths', - :'source' => :'source' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'execution_paths' => :'Array', - :'source' => :'BetaFeatureServiceSource' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceImprovedPerformanceFeatureFlag` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceImprovedPerformanceFeatureFlag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'execution_paths') - if (value = attributes[:'execution_paths']).is_a?(Array) - self.execution_paths = value - end - end - - if attributes.key?(:'source') - self.source = attributes[:'source'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - execution_paths == o.execution_paths && - source == o.source - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [execution_paths, source].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceImprovedPerformanceFeatureFlag. + class BetaFeatureServiceImprovedPerformanceFeatureFlag < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + execution_paths: 'executionPaths', + source: 'source' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + execution_paths: 'Array', + source: 'BetaFeatureServiceSource' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :execution_paths, Types::Any.optional.meta(omittable: true) + # @example null + attribute :source, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_instance_features_response.rb b/lib/zitadel/client/models/beta_feature_service_reset_instance_features_response.rb index 58edc85c..e4a6e01c 100644 --- a/lib/zitadel/client/models/beta_feature_service_reset_instance_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_reset_instance_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceResetInstanceFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetInstanceFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetInstanceFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceResetInstanceFeaturesResponse. + class BetaFeatureServiceResetInstanceFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_organization_features_request.rb b/lib/zitadel/client/models/beta_feature_service_reset_organization_features_request.rb index 4ffea50d..fb6f697a 100644 --- a/lib/zitadel/client/models/beta_feature_service_reset_organization_features_request.rb +++ b/lib/zitadel/client/models/beta_feature_service_reset_organization_features_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceResetOrganizationFeaturesRequest - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetOrganizationFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceResetOrganizationFeaturesRequest. + class BetaFeatureServiceResetOrganizationFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_organization_features_response.rb b/lib/zitadel/client/models/beta_feature_service_reset_organization_features_response.rb index 3020b123..b76cbfd1 100644 --- a/lib/zitadel/client/models/beta_feature_service_reset_organization_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_reset_organization_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceResetOrganizationFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetOrganizationFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetOrganizationFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceResetOrganizationFeaturesResponse. + class BetaFeatureServiceResetOrganizationFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_system_features_response.rb b/lib/zitadel/client/models/beta_feature_service_reset_system_features_response.rb index 191a1f5a..6c8f11f5 100644 --- a/lib/zitadel/client/models/beta_feature_service_reset_system_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_reset_system_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceResetSystemFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetSystemFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetSystemFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceResetSystemFeaturesResponse. + class BetaFeatureServiceResetSystemFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_user_features_request.rb b/lib/zitadel/client/models/beta_feature_service_reset_user_features_request.rb index 0eb3387f..5b50a64b 100644 --- a/lib/zitadel/client/models/beta_feature_service_reset_user_features_request.rb +++ b/lib/zitadel/client/models/beta_feature_service_reset_user_features_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceResetUserFeaturesRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetUserFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetUserFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceResetUserFeaturesRequest. + class BetaFeatureServiceResetUserFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_reset_user_features_response.rb b/lib/zitadel/client/models/beta_feature_service_reset_user_features_response.rb index 424e8a3e..f0267f41 100644 --- a/lib/zitadel/client/models/beta_feature_service_reset_user_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_reset_user_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceResetUserFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceResetUserFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceResetUserFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceResetUserFeaturesResponse. + class BetaFeatureServiceResetUserFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_set_instance_features_request.rb b/lib/zitadel/client/models/beta_feature_service_set_instance_features_request.rb index a930c52f..5f1c2946 100644 --- a/lib/zitadel/client/models/beta_feature_service_set_instance_features_request.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_instance_features_request.rb @@ -1,268 +1,95 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceSetInstanceFeaturesRequest - attr_accessor :login_default_org - - attr_accessor :user_schema - - # Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. - attr_accessor :oidc_token_exchange - - attr_accessor :improved_performance - - attr_accessor :debug_oidc_parent_error - - attr_accessor :oidc_single_v1_session_termination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_default_org' => :'loginDefaultOrg', - :'user_schema' => :'userSchema', - :'oidc_token_exchange' => :'oidcTokenExchange', - :'improved_performance' => :'improvedPerformance', - :'debug_oidc_parent_error' => :'debugOidcParentError', - :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_default_org' => :'Boolean', - :'user_schema' => :'Boolean', - :'oidc_token_exchange' => :'Boolean', - :'improved_performance' => :'Array', - :'debug_oidc_parent_error' => :'Boolean', - :'oidc_single_v1_session_termination' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'login_default_org', - :'user_schema', - :'oidc_token_exchange', - :'debug_oidc_parent_error', - :'oidc_single_v1_session_termination' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetInstanceFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetInstanceFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_default_org') - self.login_default_org = attributes[:'login_default_org'] - end - - if attributes.key?(:'user_schema') - self.user_schema = attributes[:'user_schema'] - end - - if attributes.key?(:'oidc_token_exchange') - self.oidc_token_exchange = attributes[:'oidc_token_exchange'] - end - - if attributes.key?(:'improved_performance') - if (value = attributes[:'improved_performance']).is_a?(Array) - self.improved_performance = value - end - end - - if attributes.key?(:'debug_oidc_parent_error') - self.debug_oidc_parent_error = attributes[:'debug_oidc_parent_error'] - end - - if attributes.key?(:'oidc_single_v1_session_termination') - self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_default_org == o.login_default_org && - user_schema == o.user_schema && - oidc_token_exchange == o.oidc_token_exchange && - improved_performance == o.improved_performance && - debug_oidc_parent_error == o.debug_oidc_parent_error && - oidc_single_v1_session_termination == o.oidc_single_v1_session_termination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_default_org, user_schema, oidc_token_exchange, improved_performance, debug_oidc_parent_error, oidc_single_v1_session_termination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceSetInstanceFeaturesRequest. + class BetaFeatureServiceSetInstanceFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_default_org: 'loginDefaultOrg', + user_schema: 'userSchema', + oidc_token_exchange: 'oidcTokenExchange', + improved_performance: 'improvedPerformance', + debug_oidc_parent_error: 'debugOidcParentError', + oidc_single_v1_session_termination: 'oidcSingleV1SessionTermination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_default_org: 'Boolean', + user_schema: 'Boolean', + oidc_token_exchange: 'Boolean', + improved_performance: 'Array', + debug_oidc_parent_error: 'Boolean', + oidc_single_v1_session_termination: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_default_org, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_schema, Types::Any.optional.meta(omittable: true) + # Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. + # @example null + # @deprecated This property is deprecated. + attribute :oidc_token_exchange, Types::Any.optional.meta(omittable: true) + # @example null + attribute :improved_performance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :debug_oidc_parent_error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_single_v1_session_termination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_set_instance_features_response.rb b/lib/zitadel/client/models/beta_feature_service_set_instance_features_response.rb index ca2c7d40..f1ef9f82 100644 --- a/lib/zitadel/client/models/beta_feature_service_set_instance_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_instance_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceSetInstanceFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetInstanceFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetInstanceFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceSetInstanceFeaturesResponse. + class BetaFeatureServiceSetInstanceFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_set_organization_features_request.rb b/lib/zitadel/client/models/beta_feature_service_set_organization_features_request.rb index 9c30d69c..5f077205 100644 --- a/lib/zitadel/client/models/beta_feature_service_set_organization_features_request.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_organization_features_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceSetOrganizationFeaturesRequest - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetOrganizationFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceSetOrganizationFeaturesRequest. + class BetaFeatureServiceSetOrganizationFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_set_organization_features_response.rb b/lib/zitadel/client/models/beta_feature_service_set_organization_features_response.rb index 13f90ffe..f1885924 100644 --- a/lib/zitadel/client/models/beta_feature_service_set_organization_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_organization_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceSetOrganizationFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetOrganizationFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetOrganizationFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceSetOrganizationFeaturesResponse. + class BetaFeatureServiceSetOrganizationFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_set_system_features_request.rb b/lib/zitadel/client/models/beta_feature_service_set_system_features_request.rb index 23967852..01d7448c 100644 --- a/lib/zitadel/client/models/beta_feature_service_set_system_features_request.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_system_features_request.rb @@ -1,258 +1,91 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceSetSystemFeaturesRequest - attr_accessor :login_default_org - - attr_accessor :user_schema - - # Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. - attr_accessor :oidc_token_exchange - - attr_accessor :improved_performance - - attr_accessor :oidc_single_v1_session_termination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_default_org' => :'loginDefaultOrg', - :'user_schema' => :'userSchema', - :'oidc_token_exchange' => :'oidcTokenExchange', - :'improved_performance' => :'improvedPerformance', - :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_default_org' => :'Boolean', - :'user_schema' => :'Boolean', - :'oidc_token_exchange' => :'Boolean', - :'improved_performance' => :'Array', - :'oidc_single_v1_session_termination' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'login_default_org', - :'user_schema', - :'oidc_token_exchange', - :'oidc_single_v1_session_termination' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetSystemFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetSystemFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_default_org') - self.login_default_org = attributes[:'login_default_org'] - end - - if attributes.key?(:'user_schema') - self.user_schema = attributes[:'user_schema'] - end - - if attributes.key?(:'oidc_token_exchange') - self.oidc_token_exchange = attributes[:'oidc_token_exchange'] - end - - if attributes.key?(:'improved_performance') - if (value = attributes[:'improved_performance']).is_a?(Array) - self.improved_performance = value - end - end - - if attributes.key?(:'oidc_single_v1_session_termination') - self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_default_org == o.login_default_org && - user_schema == o.user_schema && - oidc_token_exchange == o.oidc_token_exchange && - improved_performance == o.improved_performance && - oidc_single_v1_session_termination == o.oidc_single_v1_session_termination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_default_org, user_schema, oidc_token_exchange, improved_performance, oidc_single_v1_session_termination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceSetSystemFeaturesRequest. + class BetaFeatureServiceSetSystemFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_default_org: 'loginDefaultOrg', + user_schema: 'userSchema', + oidc_token_exchange: 'oidcTokenExchange', + improved_performance: 'improvedPerformance', + oidc_single_v1_session_termination: 'oidcSingleV1SessionTermination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_default_org: 'Boolean', + user_schema: 'Boolean', + oidc_token_exchange: 'Boolean', + improved_performance: 'Array', + oidc_single_v1_session_termination: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_default_org, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_schema, Types::Any.optional.meta(omittable: true) + # Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. + # @example null + # @deprecated This property is deprecated. + attribute :oidc_token_exchange, Types::Any.optional.meta(omittable: true) + # @example null + attribute :improved_performance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_single_v1_session_termination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_set_system_features_response.rb b/lib/zitadel/client/models/beta_feature_service_set_system_features_response.rb index c7c1448e..7296556f 100644 --- a/lib/zitadel/client/models/beta_feature_service_set_system_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_system_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceSetSystemFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetSystemFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetSystemFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceSetSystemFeaturesResponse. + class BetaFeatureServiceSetSystemFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_set_user_feature_request.rb b/lib/zitadel/client/models/beta_feature_service_set_user_feature_request.rb index 366463d3..5e141bbc 100644 --- a/lib/zitadel/client/models/beta_feature_service_set_user_feature_request.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_user_feature_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceSetUserFeatureRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetUserFeatureRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetUserFeatureRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceSetUserFeatureRequest. + class BetaFeatureServiceSetUserFeatureRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_set_user_features_response.rb b/lib/zitadel/client/models/beta_feature_service_set_user_features_response.rb index afe844f9..05b52295 100644 --- a/lib/zitadel/client/models/beta_feature_service_set_user_features_response.rb +++ b/lib/zitadel/client/models/beta_feature_service_set_user_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaFeatureServiceSetUserFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaFeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaFeatureServiceSetUserFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaFeatureServiceSetUserFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaFeatureServiceSetUserFeaturesResponse. + class BetaFeatureServiceSetUserFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaFeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_feature_service_source.rb b/lib/zitadel/client/models/beta_feature_service_source.rb index 08121128..01fc83c8 100644 --- a/lib/zitadel/client/models/beta_feature_service_source.rb +++ b/lib/zitadel/client/models/beta_feature_service_source.rb @@ -1,46 +1,66 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaFeatureServiceSource - SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED".freeze - SOURCE_SYSTEM = "SOURCE_SYSTEM".freeze - SOURCE_INSTANCE = "SOURCE_INSTANCE".freeze - SOURCE_ORGANIZATION = "SOURCE_ORGANIZATION".freeze - SOURCE_PROJECT = "SOURCE_PROJECT".freeze - SOURCE_APP = "SOURCE_APP".freeze - SOURCE_USER = "SOURCE_USER".freeze - - def self.all_vars - @all_vars ||= [SOURCE_UNSPECIFIED, SOURCE_SYSTEM, SOURCE_INSTANCE, SOURCE_ORGANIZATION, SOURCE_PROJECT, SOURCE_APP, SOURCE_USER].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaFeatureServiceSource. + class BetaFeatureServiceSource + SOURCE_UNSPECIFIED = 'SOURCE_UNSPECIFIED' + SOURCE_SYSTEM = 'SOURCE_SYSTEM' + SOURCE_INSTANCE = 'SOURCE_INSTANCE' + SOURCE_ORGANIZATION = 'SOURCE_ORGANIZATION' + SOURCE_PROJECT = 'SOURCE_PROJECT' + SOURCE_APP = 'SOURCE_APP' + SOURCE_USER = 'SOURCE_USER' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [SOURCE_UNSPECIFIED, SOURCE_SYSTEM, SOURCE_INSTANCE, SOURCE_ORGANIZATION, SOURCE_PROJECT, SOURCE_APP, SOURCE_USER].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaFeatureServiceSource.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaFeatureServiceSource" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaFeatureServiceSource: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_instance_service_add_custom_domain_request.rb b/lib/zitadel/client/models/beta_instance_service_add_custom_domain_request.rb index 80cdc1ac..bf84aaf6 100644 --- a/lib/zitadel/client/models/beta_instance_service_add_custom_domain_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_add_custom_domain_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceAddCustomDomainRequest - attr_accessor :instance_id - - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceAddCustomDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceAddCustomDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceAddCustomDomainRequest. + class BetaInstanceServiceAddCustomDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_add_custom_domain_response.rb b/lib/zitadel/client/models/beta_instance_service_add_custom_domain_response.rb index 33b58225..c908dc1f 100644 --- a/lib/zitadel/client/models/beta_instance_service_add_custom_domain_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_add_custom_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceAddCustomDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceAddCustomDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceAddCustomDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceAddCustomDomainResponse. + class BetaInstanceServiceAddCustomDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_add_trusted_domain_request.rb b/lib/zitadel/client/models/beta_instance_service_add_trusted_domain_request.rb index 999eb91e..6a896b10 100644 --- a/lib/zitadel/client/models/beta_instance_service_add_trusted_domain_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_add_trusted_domain_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceAddTrustedDomainRequest - attr_accessor :instance_id - - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceAddTrustedDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceAddTrustedDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceAddTrustedDomainRequest. + class BetaInstanceServiceAddTrustedDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_add_trusted_domain_response.rb b/lib/zitadel/client/models/beta_instance_service_add_trusted_domain_response.rb index 622f3c45..30e30355 100644 --- a/lib/zitadel/client/models/beta_instance_service_add_trusted_domain_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_add_trusted_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceAddTrustedDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceAddTrustedDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceAddTrustedDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceAddTrustedDomainResponse. + class BetaInstanceServiceAddTrustedDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_any.rb b/lib/zitadel/client/models/beta_instance_service_any.rb index 34125599..7b6d1c2e 100644 --- a/lib/zitadel/client/models/beta_instance_service_any.rb +++ b/lib/zitadel/client/models/beta_instance_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaInstanceServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaInstanceServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_connect_error.rb b/lib/zitadel/client/models/beta_instance_service_connect_error.rb index 75af93d5..90093c19 100644 --- a/lib/zitadel/client/models/beta_instance_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_instance_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaInstanceServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaInstanceServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_delete_instance_request.rb b/lib/zitadel/client/models/beta_instance_service_delete_instance_request.rb index 6abba219..0554f0d9 100644 --- a/lib/zitadel/client/models/beta_instance_service_delete_instance_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_delete_instance_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceDeleteInstanceRequest - attr_accessor :instance_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceDeleteInstanceRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceDeleteInstanceRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceDeleteInstanceRequest. + class BetaInstanceServiceDeleteInstanceRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_delete_instance_response.rb b/lib/zitadel/client/models/beta_instance_service_delete_instance_response.rb index ee4a974c..d825e463 100644 --- a/lib/zitadel/client/models/beta_instance_service_delete_instance_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_delete_instance_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceDeleteInstanceResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceDeleteInstanceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceDeleteInstanceResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceDeleteInstanceResponse. + class BetaInstanceServiceDeleteInstanceResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_domain.rb b/lib/zitadel/client/models/beta_instance_service_domain.rb index f772bea6..2dd85e62 100644 --- a/lib/zitadel/client/models/beta_instance_service_domain.rb +++ b/lib/zitadel/client/models/beta_instance_service_domain.rb @@ -1,252 +1,90 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceDomain - attr_accessor :instance_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :domain - - attr_accessor :primary - - attr_accessor :generated - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'creation_date' => :'creationDate', - :'domain' => :'domain', - :'primary' => :'primary', - :'generated' => :'generated' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'creation_date' => :'Time', - :'domain' => :'String', - :'primary' => :'Boolean', - :'generated' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceDomain` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceDomain`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'primary') - self.primary = attributes[:'primary'] - end - - if attributes.key?(:'generated') - self.generated = attributes[:'generated'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - creation_date == o.creation_date && - domain == o.domain && - primary == o.primary && - generated == o.generated - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, creation_date, domain, primary, generated].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceDomain. + class BetaInstanceServiceDomain < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + creation_date: 'creationDate', + domain: 'domain', + primary: 'primary', + generated: 'generated' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + creation_date: 'Time', + domain: 'String', + primary: 'Boolean', + generated: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :primary, Types::Any.optional.meta(omittable: true) + # @example null + attribute :generated, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_domain_field_name.rb b/lib/zitadel/client/models/beta_instance_service_domain_field_name.rb index df4207c7..fee06085 100644 --- a/lib/zitadel/client/models/beta_instance_service_domain_field_name.rb +++ b/lib/zitadel/client/models/beta_instance_service_domain_field_name.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaInstanceServiceDomainFieldName - DOMAIN_FIELD_NAME_UNSPECIFIED = "DOMAIN_FIELD_NAME_UNSPECIFIED".freeze - DOMAIN_FIELD_NAME_DOMAIN = "DOMAIN_FIELD_NAME_DOMAIN".freeze - DOMAIN_FIELD_NAME_PRIMARY = "DOMAIN_FIELD_NAME_PRIMARY".freeze - DOMAIN_FIELD_NAME_GENERATED = "DOMAIN_FIELD_NAME_GENERATED".freeze - DOMAIN_FIELD_NAME_CREATION_DATE = "DOMAIN_FIELD_NAME_CREATION_DATE".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaInstanceServiceDomainFieldName. + class BetaInstanceServiceDomainFieldName + DOMAIN_FIELD_NAME_UNSPECIFIED = 'DOMAIN_FIELD_NAME_UNSPECIFIED' + DOMAIN_FIELD_NAME_DOMAIN = 'DOMAIN_FIELD_NAME_DOMAIN' + DOMAIN_FIELD_NAME_PRIMARY = 'DOMAIN_FIELD_NAME_PRIMARY' + DOMAIN_FIELD_NAME_GENERATED = 'DOMAIN_FIELD_NAME_GENERATED' + DOMAIN_FIELD_NAME_CREATION_DATE = 'DOMAIN_FIELD_NAME_CREATION_DATE' - def self.all_vars - @all_vars ||= [DOMAIN_FIELD_NAME_UNSPECIFIED, DOMAIN_FIELD_NAME_DOMAIN, DOMAIN_FIELD_NAME_PRIMARY, DOMAIN_FIELD_NAME_GENERATED, DOMAIN_FIELD_NAME_CREATION_DATE].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [DOMAIN_FIELD_NAME_UNSPECIFIED, DOMAIN_FIELD_NAME_DOMAIN, DOMAIN_FIELD_NAME_PRIMARY, DOMAIN_FIELD_NAME_GENERATED, DOMAIN_FIELD_NAME_CREATION_DATE].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaInstanceServiceDomainFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaInstanceServiceDomainFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaInstanceServiceDomainFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_instance_service_domain_generated_query.rb b/lib/zitadel/client/models/beta_instance_service_domain_generated_query.rb index 18e04d2b..665a40de 100644 --- a/lib/zitadel/client/models/beta_instance_service_domain_generated_query.rb +++ b/lib/zitadel/client/models/beta_instance_service_domain_generated_query.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceDomainGeneratedQuery - attr_accessor :generated - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'generated' => :'generated' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'generated' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceDomainGeneratedQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceDomainGeneratedQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'generated') - self.generated = attributes[:'generated'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - generated == o.generated - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [generated].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceDomainGeneratedQuery. + class BetaInstanceServiceDomainGeneratedQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + generated: 'generated' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + generated: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :generated, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_domain_primary_query.rb b/lib/zitadel/client/models/beta_instance_service_domain_primary_query.rb index f762532b..1c4506b7 100644 --- a/lib/zitadel/client/models/beta_instance_service_domain_primary_query.rb +++ b/lib/zitadel/client/models/beta_instance_service_domain_primary_query.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceDomainPrimaryQuery - attr_accessor :primary - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'primary' => :'primary' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'primary' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceDomainPrimaryQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceDomainPrimaryQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'primary') - self.primary = attributes[:'primary'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - primary == o.primary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [primary].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceDomainPrimaryQuery. + class BetaInstanceServiceDomainPrimaryQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + primary: 'primary' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + primary: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :primary, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_domain_query.rb b/lib/zitadel/client/models/beta_instance_service_domain_query.rb index c8fcb32a..76a9051c 100644 --- a/lib/zitadel/client/models/beta_instance_service_domain_query.rb +++ b/lib/zitadel/client/models/beta_instance_service_domain_query.rb @@ -1,246 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceDomainQuery - attr_accessor :domain - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain' => :'domain', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain' => :'String', - :'method' => :'BetaInstanceServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceDomainQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceDomainQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain == o.domain && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceDomainQuery. + class BetaInstanceServiceDomainQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain: 'domain', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain: 'String', + method: 'BetaInstanceServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_domain_search_query.rb b/lib/zitadel/client/models/beta_instance_service_domain_search_query.rb index ab45a61b..8404e7ea 100644 --- a/lib/zitadel/client/models/beta_instance_service_domain_search_query.rb +++ b/lib/zitadel/client/models/beta_instance_service_domain_search_query.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceDomainSearchQuery - attr_accessor :domain_query - - attr_accessor :generated_query - - attr_accessor :primary_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain_query' => :'domainQuery', - :'generated_query' => :'generatedQuery', - :'primary_query' => :'primaryQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain_query' => :'BetaInstanceServiceDomainQuery', - :'generated_query' => :'BetaInstanceServiceDomainGeneratedQuery', - :'primary_query' => :'BetaInstanceServiceDomainPrimaryQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceDomainSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceDomainSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain_query') - self.domain_query = attributes[:'domain_query'] - end - - if attributes.key?(:'generated_query') - self.generated_query = attributes[:'generated_query'] - end - - if attributes.key?(:'primary_query') - self.primary_query = attributes[:'primary_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain_query == o.domain_query && - generated_query == o.generated_query && - primary_query == o.primary_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain_query, generated_query, primary_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceDomainSearchQuery. + class BetaInstanceServiceDomainSearchQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain_query: 'domainQuery', + generated_query: 'generatedQuery', + primary_query: 'primaryQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain_query: 'BetaInstanceServiceDomainQuery', + generated_query: 'BetaInstanceServiceDomainGeneratedQuery', + primary_query: 'BetaInstanceServiceDomainPrimaryQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :generated_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :primary_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_domains_query.rb b/lib/zitadel/client/models/beta_instance_service_domains_query.rb index fce2b22d..56f9f9b7 100644 --- a/lib/zitadel/client/models/beta_instance_service_domains_query.rb +++ b/lib/zitadel/client/models/beta_instance_service_domains_query.rb @@ -1,217 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceDomainsQuery - attr_accessor :domains - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domains' => :'domains' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domains' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceDomainsQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceDomainsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domains') - if (value = attributes[:'domains']).is_a?(Array) - self.domains = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domains == o.domains - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domains].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceDomainsQuery. + class BetaInstanceServiceDomainsQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domains: 'domains' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domains: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domains, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_field_name.rb b/lib/zitadel/client/models/beta_instance_service_field_name.rb index 3dcad855..ddbb877d 100644 --- a/lib/zitadel/client/models/beta_instance_service_field_name.rb +++ b/lib/zitadel/client/models/beta_instance_service_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaInstanceServiceFieldName - FIELD_NAME_UNSPECIFIED = "FIELD_NAME_UNSPECIFIED".freeze - FIELD_NAME_ID = "FIELD_NAME_ID".freeze - FIELD_NAME_NAME = "FIELD_NAME_NAME".freeze - FIELD_NAME_CREATION_DATE = "FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [FIELD_NAME_UNSPECIFIED, FIELD_NAME_ID, FIELD_NAME_NAME, FIELD_NAME_CREATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaInstanceServiceFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaInstanceServiceFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaInstanceServiceFieldName. + class BetaInstanceServiceFieldName + FIELD_NAME_UNSPECIFIED = 'FIELD_NAME_UNSPECIFIED' + FIELD_NAME_ID = 'FIELD_NAME_ID' + FIELD_NAME_NAME = 'FIELD_NAME_NAME' + FIELD_NAME_CREATION_DATE = 'FIELD_NAME_CREATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [FIELD_NAME_UNSPECIFIED, FIELD_NAME_ID, FIELD_NAME_NAME, FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaInstanceServiceFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_instance_service_get_instance_request.rb b/lib/zitadel/client/models/beta_instance_service_get_instance_request.rb index 0158c4ba..b9d35861 100644 --- a/lib/zitadel/client/models/beta_instance_service_get_instance_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_get_instance_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceGetInstanceRequest - attr_accessor :instance_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceGetInstanceRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceGetInstanceRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceGetInstanceRequest. + class BetaInstanceServiceGetInstanceRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_get_instance_response.rb b/lib/zitadel/client/models/beta_instance_service_get_instance_response.rb index 0ff42479..2c7adcec 100644 --- a/lib/zitadel/client/models/beta_instance_service_get_instance_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_get_instance_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceGetInstanceResponse - attr_accessor :instance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance' => :'instance' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance' => :'BetaInstanceServiceInstance' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceGetInstanceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceGetInstanceResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance == o.instance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceGetInstanceResponse. + class BetaInstanceServiceGetInstanceResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance: 'instance' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance: 'BetaInstanceServiceInstance' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_ids_query.rb b/lib/zitadel/client/models/beta_instance_service_ids_query.rb index 14e79f29..6b773247 100644 --- a/lib/zitadel/client/models/beta_instance_service_ids_query.rb +++ b/lib/zitadel/client/models/beta_instance_service_ids_query.rb @@ -1,217 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceIdsQuery - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceIdsQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceIdsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceIdsQuery. + class BetaInstanceServiceIdsQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_instance.rb b/lib/zitadel/client/models/beta_instance_service_instance.rb index 8dd43436..1d690823 100644 --- a/lib/zitadel/client/models/beta_instance_service_instance.rb +++ b/lib/zitadel/client/models/beta_instance_service_instance.rb @@ -1,295 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceInstance - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :state - - attr_accessor :name - - attr_accessor :version - - attr_accessor :domains - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'change_date' => :'changeDate', - :'creation_date' => :'creationDate', - :'state' => :'state', - :'name' => :'name', - :'version' => :'version', - :'domains' => :'domains' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'change_date' => :'Time', - :'creation_date' => :'Time', - :'state' => :'BetaInstanceServiceState', - :'name' => :'String', - :'version' => :'String', - :'domains' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceInstance` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceInstance`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'domains') - if (value = attributes[:'domains']).is_a?(Array) - self.domains = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - change_date == o.change_date && - creation_date == o.creation_date && - state == o.state && - name == o.name && - version == o.version && - domains == o.domains - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, change_date, creation_date, state, name, version, domains].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceInstance. + class BetaInstanceServiceInstance < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + change_date: 'changeDate', + creation_date: 'creationDate', + state: 'state', + name: 'name', + version: 'version', + domains: 'domains' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + change_date: 'Time', + creation_date: 'Time', + state: 'BetaInstanceServiceState', + name: 'String', + version: 'String', + domains: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :version, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domains, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_list_custom_domains_request.rb b/lib/zitadel/client/models/beta_instance_service_list_custom_domains_request.rb index 7ecb2b7c..fec3a691 100644 --- a/lib/zitadel/client/models/beta_instance_service_list_custom_domains_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_list_custom_domains_request.rb @@ -1,267 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceListCustomDomainsRequest - attr_accessor :instance_id - - attr_accessor :pagination - - attr_accessor :sorting_column - - # Criterias the client is looking for. - attr_accessor :queries - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'pagination' => :'BetaInstanceServicePaginationRequest', - :'sorting_column' => :'BetaInstanceServiceDomainFieldName', - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceListCustomDomainsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceListCustomDomainsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - pagination == o.pagination && - sorting_column == o.sorting_column && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, pagination, sorting_column, queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceListCustomDomainsRequest. + class BetaInstanceServiceListCustomDomainsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + pagination: 'pagination', + sorting_column: 'sortingColumn', + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + pagination: 'BetaInstanceServicePaginationRequest', + sorting_column: 'BetaInstanceServiceDomainFieldName', + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Criterias the client is looking for. + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_list_custom_domains_response.rb b/lib/zitadel/client/models/beta_instance_service_list_custom_domains_response.rb index f4f0eeec..b7ff6ae0 100644 --- a/lib/zitadel/client/models/beta_instance_service_list_custom_domains_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_list_custom_domains_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceListCustomDomainsResponse - attr_accessor :domains - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domains' => :'domains', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domains' => :'Array', - :'pagination' => :'BetaInstanceServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceListCustomDomainsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceListCustomDomainsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domains') - if (value = attributes[:'domains']).is_a?(Array) - self.domains = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domains == o.domains && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domains, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceListCustomDomainsResponse. + class BetaInstanceServiceListCustomDomainsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domains: 'domains', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domains: 'Array', + pagination: 'BetaInstanceServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domains, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_list_instances_request.rb b/lib/zitadel/client/models/beta_instance_service_list_instances_request.rb index fc059a4d..016da6bc 100644 --- a/lib/zitadel/client/models/beta_instance_service_list_instances_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_list_instances_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceListInstancesRequest - # Criterias the client is looking for. - attr_accessor :queries - - attr_accessor :pagination - - attr_accessor :sorting_column - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queries' => :'queries', - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queries' => :'Array', - :'pagination' => :'BetaInstanceServicePaginationRequest', - :'sorting_column' => :'BetaInstanceServiceFieldName' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceListInstancesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceListInstancesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queries == o.queries && - pagination == o.pagination && - sorting_column == o.sorting_column - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queries, pagination, sorting_column].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceListInstancesRequest. + class BetaInstanceServiceListInstancesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + queries: 'queries', + pagination: 'pagination', + sorting_column: 'sortingColumn' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + queries: 'Array', + pagination: 'BetaInstanceServicePaginationRequest', + sorting_column: 'BetaInstanceServiceFieldName' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Criterias the client is looking for. + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_list_instances_response.rb b/lib/zitadel/client/models/beta_instance_service_list_instances_response.rb index 9599f1bd..72f8533f 100644 --- a/lib/zitadel/client/models/beta_instance_service_list_instances_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_list_instances_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceListInstancesResponse - # The list of instances. - attr_accessor :instances - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instances' => :'instances', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instances' => :'Array', - :'pagination' => :'BetaInstanceServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceListInstancesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceListInstancesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instances') - if (value = attributes[:'instances']).is_a?(Array) - self.instances = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instances == o.instances && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instances, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceListInstancesResponse. + class BetaInstanceServiceListInstancesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instances: 'instances', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instances: 'Array', + pagination: 'BetaInstanceServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The list of instances. + # @example null + attribute :instances, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_list_trusted_domains_request.rb b/lib/zitadel/client/models/beta_instance_service_list_trusted_domains_request.rb index 75929fd9..798eeafb 100644 --- a/lib/zitadel/client/models/beta_instance_service_list_trusted_domains_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_list_trusted_domains_request.rb @@ -1,267 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceListTrustedDomainsRequest - attr_accessor :instance_id - - attr_accessor :pagination - - attr_accessor :sorting_column - - # Criterias the client is looking for. - attr_accessor :queries - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'pagination' => :'BetaInstanceServicePaginationRequest', - :'sorting_column' => :'BetaInstanceServiceTrustedDomainFieldName', - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceListTrustedDomainsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceListTrustedDomainsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - pagination == o.pagination && - sorting_column == o.sorting_column && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, pagination, sorting_column, queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceListTrustedDomainsRequest. + class BetaInstanceServiceListTrustedDomainsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + pagination: 'pagination', + sorting_column: 'sortingColumn', + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + pagination: 'BetaInstanceServicePaginationRequest', + sorting_column: 'BetaInstanceServiceTrustedDomainFieldName', + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Criterias the client is looking for. + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_list_trusted_domains_response.rb b/lib/zitadel/client/models/beta_instance_service_list_trusted_domains_response.rb index c1d44ffb..0e238b6a 100644 --- a/lib/zitadel/client/models/beta_instance_service_list_trusted_domains_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_list_trusted_domains_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceListTrustedDomainsResponse - attr_accessor :trusted_domain - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'trusted_domain' => :'trustedDomain', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'trusted_domain' => :'Array', - :'pagination' => :'BetaInstanceServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceListTrustedDomainsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceListTrustedDomainsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'trusted_domain') - if (value = attributes[:'trusted_domain']).is_a?(Array) - self.trusted_domain = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - trusted_domain == o.trusted_domain && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [trusted_domain, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceListTrustedDomainsResponse. + class BetaInstanceServiceListTrustedDomainsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + trusted_domain: 'trustedDomain', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + trusted_domain: 'Array', + pagination: 'BetaInstanceServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :trusted_domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_pagination_request.rb b/lib/zitadel/client/models/beta_instance_service_pagination_request.rb index 834a323b..e600bb75 100644 --- a/lib/zitadel/client/models/beta_instance_service_pagination_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServicePaginationRequest. + class BetaInstanceServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_pagination_response.rb b/lib/zitadel/client/models/beta_instance_service_pagination_response.rb index 63998f8c..9e1e739d 100644 --- a/lib/zitadel/client/models/beta_instance_service_pagination_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServicePaginationResponse. + class BetaInstanceServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_query.rb b/lib/zitadel/client/models/beta_instance_service_query.rb index b233ff2a..f4d35f2c 100644 --- a/lib/zitadel/client/models/beta_instance_service_query.rb +++ b/lib/zitadel/client/models/beta_instance_service_query.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceQuery - attr_accessor :domain_query - - attr_accessor :id_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain_query' => :'domainQuery', - :'id_query' => :'idQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain_query' => :'BetaInstanceServiceDomainsQuery', - :'id_query' => :'BetaInstanceServiceIdsQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain_query') - self.domain_query = attributes[:'domain_query'] - end - - if attributes.key?(:'id_query') - self.id_query = attributes[:'id_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain_query == o.domain_query && - id_query == o.id_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain_query, id_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceQuery. + class BetaInstanceServiceQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain_query: 'domainQuery', + id_query: 'idQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain_query: 'BetaInstanceServiceDomainsQuery', + id_query: 'BetaInstanceServiceIdsQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_remove_custom_domain_request.rb b/lib/zitadel/client/models/beta_instance_service_remove_custom_domain_request.rb index 7195e5e9..98afdcc5 100644 --- a/lib/zitadel/client/models/beta_instance_service_remove_custom_domain_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_remove_custom_domain_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceRemoveCustomDomainRequest - attr_accessor :instance_id - - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceRemoveCustomDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceRemoveCustomDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceRemoveCustomDomainRequest. + class BetaInstanceServiceRemoveCustomDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_remove_custom_domain_response.rb b/lib/zitadel/client/models/beta_instance_service_remove_custom_domain_response.rb index 7bd83e48..77946e70 100644 --- a/lib/zitadel/client/models/beta_instance_service_remove_custom_domain_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_remove_custom_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceRemoveCustomDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceRemoveCustomDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceRemoveCustomDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceRemoveCustomDomainResponse. + class BetaInstanceServiceRemoveCustomDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_request.rb b/lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_request.rb index 64832bca..72453932 100644 --- a/lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceRemoveTrustedDomainRequest - attr_accessor :instance_id - - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceRemoveTrustedDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceRemoveTrustedDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceRemoveTrustedDomainRequest. + class BetaInstanceServiceRemoveTrustedDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_response.rb b/lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_response.rb index 69df8bb7..189d7acf 100644 --- a/lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_remove_trusted_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceRemoveTrustedDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceRemoveTrustedDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceRemoveTrustedDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceRemoveTrustedDomainResponse. + class BetaInstanceServiceRemoveTrustedDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_state.rb b/lib/zitadel/client/models/beta_instance_service_state.rb index d0b5e2bb..55dcb20c 100644 --- a/lib/zitadel/client/models/beta_instance_service_state.rb +++ b/lib/zitadel/client/models/beta_instance_service_state.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaInstanceServiceState - STATE_UNSPECIFIED = "STATE_UNSPECIFIED".freeze - STATE_CREATING = "STATE_CREATING".freeze - STATE_RUNNING = "STATE_RUNNING".freeze - STATE_STOPPING = "STATE_STOPPING".freeze - STATE_STOPPED = "STATE_STOPPED".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaInstanceServiceState. + class BetaInstanceServiceState + STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' + STATE_CREATING = 'STATE_CREATING' + STATE_RUNNING = 'STATE_RUNNING' + STATE_STOPPING = 'STATE_STOPPING' + STATE_STOPPED = 'STATE_STOPPED' - def self.all_vars - @all_vars ||= [STATE_UNSPECIFIED, STATE_CREATING, STATE_RUNNING, STATE_STOPPING, STATE_STOPPED].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [STATE_UNSPECIFIED, STATE_CREATING, STATE_RUNNING, STATE_STOPPING, STATE_STOPPED].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaInstanceServiceState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaInstanceServiceState" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaInstanceServiceState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_instance_service_text_query_method.rb b/lib/zitadel/client/models/beta_instance_service_text_query_method.rb index dd27cabe..5230ff51 100644 --- a/lib/zitadel/client/models/beta_instance_service_text_query_method.rb +++ b/lib/zitadel/client/models/beta_instance_service_text_query_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaInstanceServiceTextQueryMethod - TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS".freeze - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH".freeze - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS".freeze - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH".freeze - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaInstanceServiceTextQueryMethod. + class BetaInstanceServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' + TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' + TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaInstanceServiceTextQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaInstanceServiceTextQueryMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaInstanceServiceTextQueryMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_instance_service_trusted_domain.rb b/lib/zitadel/client/models/beta_instance_service_trusted_domain.rb index 07c3fef2..88ee5553 100644 --- a/lib/zitadel/client/models/beta_instance_service_trusted_domain.rb +++ b/lib/zitadel/client/models/beta_instance_service_trusted_domain.rb @@ -1,234 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceTrustedDomain - attr_accessor :instance_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'creation_date' => :'creationDate', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'creation_date' => :'Time', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceTrustedDomain` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceTrustedDomain`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - creation_date == o.creation_date && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, creation_date, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceTrustedDomain. + class BetaInstanceServiceTrustedDomain < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + creation_date: 'creationDate', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + creation_date: 'Time', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_trusted_domain_field_name.rb b/lib/zitadel/client/models/beta_instance_service_trusted_domain_field_name.rb index 4f5e1639..ae365c25 100644 --- a/lib/zitadel/client/models/beta_instance_service_trusted_domain_field_name.rb +++ b/lib/zitadel/client/models/beta_instance_service_trusted_domain_field_name.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaInstanceServiceTrustedDomainFieldName - TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED = "TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED".freeze - TRUSTED_DOMAIN_FIELD_NAME_DOMAIN = "TRUSTED_DOMAIN_FIELD_NAME_DOMAIN".freeze - TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE = "TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED, TRUSTED_DOMAIN_FIELD_NAME_DOMAIN, TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaInstanceServiceTrustedDomainFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaInstanceServiceTrustedDomainFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaInstanceServiceTrustedDomainFieldName. + class BetaInstanceServiceTrustedDomainFieldName + TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED = 'TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED' + TRUSTED_DOMAIN_FIELD_NAME_DOMAIN = 'TRUSTED_DOMAIN_FIELD_NAME_DOMAIN' + TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE = 'TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED, TRUSTED_DOMAIN_FIELD_NAME_DOMAIN, TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaInstanceServiceTrustedDomainFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_instance_service_trusted_domain_search_query.rb b/lib/zitadel/client/models/beta_instance_service_trusted_domain_search_query.rb index 0bef62b3..6744d2f8 100644 --- a/lib/zitadel/client/models/beta_instance_service_trusted_domain_search_query.rb +++ b/lib/zitadel/client/models/beta_instance_service_trusted_domain_search_query.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceTrustedDomainSearchQuery - attr_accessor :domain_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain_query' => :'domainQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain_query' => :'BetaInstanceServiceDomainQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceTrustedDomainSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceTrustedDomainSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain_query') - self.domain_query = attributes[:'domain_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain_query == o.domain_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceTrustedDomainSearchQuery. + class BetaInstanceServiceTrustedDomainSearchQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain_query: 'domainQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain_query: 'BetaInstanceServiceDomainQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_update_instance_request.rb b/lib/zitadel/client/models/beta_instance_service_update_instance_request.rb index 6d6710a6..aa4423ff 100644 --- a/lib/zitadel/client/models/beta_instance_service_update_instance_request.rb +++ b/lib/zitadel/client/models/beta_instance_service_update_instance_request.rb @@ -1,225 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceUpdateInstanceRequest - # used only to identify the instance to change. - attr_accessor :instance_id - - attr_accessor :instance_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'instance_name' => :'instanceName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'instance_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceUpdateInstanceRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceUpdateInstanceRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'instance_name') - self.instance_name = attributes[:'instance_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - instance_name == o.instance_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, instance_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceUpdateInstanceRequest. + class BetaInstanceServiceUpdateInstanceRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + instance_name: 'instanceName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + instance_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # used only to identify the instance to change. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :instance_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_instance_service_update_instance_response.rb b/lib/zitadel/client/models/beta_instance_service_update_instance_response.rb index 27991f11..31a66a7a 100644 --- a/lib/zitadel/client/models/beta_instance_service_update_instance_response.rb +++ b/lib/zitadel/client/models/beta_instance_service_update_instance_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInstanceServiceUpdateInstanceResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInstanceServiceUpdateInstanceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInstanceServiceUpdateInstanceResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInstanceServiceUpdateInstanceResponse. + class BetaInstanceServiceUpdateInstanceResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_administrator.rb b/lib/zitadel/client/models/beta_internal_permission_service_administrator.rb index b79826ea..1dd5c7cd 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_administrator.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_administrator.rb @@ -1,284 +1,105 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceAdministrator - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :user - - # Roles are the roles that were granted to the user for the specified resource. - attr_accessor :roles - - # Instance is returned if the administrator roles were granted on the instance level. - attr_accessor :instance - - attr_accessor :organization - - attr_accessor :project - - attr_accessor :project_grant - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'user' => :'user', - :'roles' => :'roles', - :'instance' => :'instance', - :'organization' => :'organization', - :'project' => :'project', - :'project_grant' => :'projectGrant' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'user' => :'BetaInternalPermissionServiceUser', - :'roles' => :'Array', - :'instance' => :'Boolean', - :'organization' => :'BetaInternalPermissionServiceOrganization', - :'project' => :'BetaInternalPermissionServiceProject', - :'project_grant' => :'BetaInternalPermissionServiceProjectGrant' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceAdministrator` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceAdministrator`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'organization') - self.organization = attributes[:'organization'] - end - - if attributes.key?(:'project') - self.project = attributes[:'project'] - end - - if attributes.key?(:'project_grant') - self.project_grant = attributes[:'project_grant'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - change_date == o.change_date && - user == o.user && - roles == o.roles && - instance == o.instance && - organization == o.organization && - project == o.project && - project_grant == o.project_grant - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, change_date, user, roles, instance, organization, project, project_grant].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceAdministrator. + class BetaInternalPermissionServiceAdministrator < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + change_date: 'changeDate', + user: 'user', + roles: 'roles', + instance: 'instance', + organization: 'organization', + project: 'project', + project_grant: 'projectGrant' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + change_date: 'Time', + user: 'BetaInternalPermissionServiceUser', + roles: 'Array', + instance: 'Boolean', + organization: 'BetaInternalPermissionServiceOrganization', + project: 'BetaInternalPermissionServiceProject', + project_grant: 'BetaInternalPermissionServiceProjectGrant' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + # Roles are the roles that were granted to the user for the specified resource. + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) + # Instance is returned if the administrator roles were granted on the instance level. + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grant, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_administrator_field_name.rb b/lib/zitadel/client/models/beta_internal_permission_service_administrator_field_name.rb index b93a9991..6d368ab6 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_administrator_field_name.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_administrator_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaInternalPermissionServiceAdministratorFieldName - ADMINISTRATOR_FIELD_NAME_UNSPECIFIED = "ADMINISTRATOR_FIELD_NAME_UNSPECIFIED".freeze - ADMINISTRATOR_FIELD_NAME_USER_ID = "ADMINISTRATOR_FIELD_NAME_USER_ID".freeze - ADMINISTRATOR_FIELD_NAME_CREATION_DATE = "ADMINISTRATOR_FIELD_NAME_CREATION_DATE".freeze - ADMINISTRATOR_FIELD_NAME_CHANGE_DATE = "ADMINISTRATOR_FIELD_NAME_CHANGE_DATE".freeze - - def self.all_vars - @all_vars ||= [ADMINISTRATOR_FIELD_NAME_UNSPECIFIED, ADMINISTRATOR_FIELD_NAME_USER_ID, ADMINISTRATOR_FIELD_NAME_CREATION_DATE, ADMINISTRATOR_FIELD_NAME_CHANGE_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaInternalPermissionServiceAdministratorFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaInternalPermissionServiceAdministratorFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaInternalPermissionServiceAdministratorFieldName. + class BetaInternalPermissionServiceAdministratorFieldName + ADMINISTRATOR_FIELD_NAME_UNSPECIFIED = 'ADMINISTRATOR_FIELD_NAME_UNSPECIFIED' + ADMINISTRATOR_FIELD_NAME_USER_ID = 'ADMINISTRATOR_FIELD_NAME_USER_ID' + ADMINISTRATOR_FIELD_NAME_CREATION_DATE = 'ADMINISTRATOR_FIELD_NAME_CREATION_DATE' + ADMINISTRATOR_FIELD_NAME_CHANGE_DATE = 'ADMINISTRATOR_FIELD_NAME_CHANGE_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [ADMINISTRATOR_FIELD_NAME_UNSPECIFIED, ADMINISTRATOR_FIELD_NAME_USER_ID, ADMINISTRATOR_FIELD_NAME_CREATION_DATE, ADMINISTRATOR_FIELD_NAME_CHANGE_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaInternalPermissionServiceAdministratorFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_administrator_search_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_administrator_search_filter.rb index d81bd971..e7e33dfc 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_administrator_search_filter.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_administrator_search_filter.rb @@ -1,305 +1,113 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceAdministratorSearchFilter - attr_accessor :_and - - attr_accessor :change_date - - attr_accessor :creation_date - - attr_accessor :in_user_ids_filter - - attr_accessor :_not - - attr_accessor :_or - - attr_accessor :resource - - attr_accessor :role - - attr_accessor :user_display_name - - attr_accessor :user_organization_id - - attr_accessor :user_preferred_login_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_and' => :'and', - :'change_date' => :'changeDate', - :'creation_date' => :'creationDate', - :'in_user_ids_filter' => :'inUserIdsFilter', - :'_not' => :'not', - :'_or' => :'or', - :'resource' => :'resource', - :'role' => :'role', - :'user_display_name' => :'userDisplayName', - :'user_organization_id' => :'userOrganizationId', - :'user_preferred_login_name' => :'userPreferredLoginName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'_and' => :'BetaInternalPermissionServiceAndFilter', - :'change_date' => :'BetaInternalPermissionServiceTimestampFilter', - :'creation_date' => :'BetaInternalPermissionServiceTimestampFilter', - :'in_user_ids_filter' => :'BetaInternalPermissionServiceInIDsFilter', - :'_not' => :'BetaInternalPermissionServiceNotFilter', - :'_or' => :'BetaInternalPermissionServiceOrFilter', - :'resource' => :'BetaInternalPermissionServiceResourceFilter', - :'role' => :'BetaInternalPermissionServiceRoleFilter', - :'user_display_name' => :'BetaInternalPermissionServiceUserDisplayNameFilter', - :'user_organization_id' => :'BetaInternalPermissionServiceIDFilter', - :'user_preferred_login_name' => :'BetaInternalPermissionServiceUserPreferredLoginNameFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceAdministratorSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceAdministratorSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_and') - self._and = attributes[:'_and'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'in_user_ids_filter') - self.in_user_ids_filter = attributes[:'in_user_ids_filter'] - end - - if attributes.key?(:'_not') - self._not = attributes[:'_not'] - end - - if attributes.key?(:'_or') - self._or = attributes[:'_or'] - end - - if attributes.key?(:'resource') - self.resource = attributes[:'resource'] - end - - if attributes.key?(:'role') - self.role = attributes[:'role'] - end - - if attributes.key?(:'user_display_name') - self.user_display_name = attributes[:'user_display_name'] - end - - if attributes.key?(:'user_organization_id') - self.user_organization_id = attributes[:'user_organization_id'] - end - - if attributes.key?(:'user_preferred_login_name') - self.user_preferred_login_name = attributes[:'user_preferred_login_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _and == o._and && - change_date == o.change_date && - creation_date == o.creation_date && - in_user_ids_filter == o.in_user_ids_filter && - _not == o._not && - _or == o._or && - resource == o.resource && - role == o.role && - user_display_name == o.user_display_name && - user_organization_id == o.user_organization_id && - user_preferred_login_name == o.user_preferred_login_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_and, change_date, creation_date, in_user_ids_filter, _not, _or, resource, role, user_display_name, user_organization_id, user_preferred_login_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceAdministratorSearchFilter. + class BetaInternalPermissionServiceAdministratorSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + _and: 'and', + change_date: 'changeDate', + creation_date: 'creationDate', + in_user_ids_filter: 'inUserIdsFilter', + _not: 'not', + _or: 'or', + resource: 'resource', + role: 'role', + user_display_name: 'userDisplayName', + user_organization_id: 'userOrganizationId', + user_preferred_login_name: 'userPreferredLoginName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + _and: 'BetaInternalPermissionServiceAndFilter', + change_date: 'BetaInternalPermissionServiceTimestampFilter', + creation_date: 'BetaInternalPermissionServiceTimestampFilter', + in_user_ids_filter: 'BetaInternalPermissionServiceInIDsFilter', + _not: 'BetaInternalPermissionServiceNotFilter', + _or: 'BetaInternalPermissionServiceOrFilter', + resource: 'BetaInternalPermissionServiceResourceFilter', + role: 'BetaInternalPermissionServiceRoleFilter', + user_display_name: 'BetaInternalPermissionServiceUserDisplayNameFilter', + user_organization_id: 'BetaInternalPermissionServiceIDFilter', + user_preferred_login_name: 'BetaInternalPermissionServiceUserPreferredLoginNameFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :_and, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_user_ids_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :_not, Types::Any.optional.meta(omittable: true) + # @example null + attribute :_or, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource, Types::Any.optional.meta(omittable: true) + # @example null + attribute :role, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_preferred_login_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_and_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_and_filter.rb index ac294e35..d82a22ec 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_and_filter.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_and_filter.rb @@ -1,217 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceAndFilter - attr_accessor :queries - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceAndFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceAndFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceAndFilter. + class BetaInternalPermissionServiceAndFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_any.rb b/lib/zitadel/client/models/beta_internal_permission_service_any.rb index 5a700cd5..6d99f5a5 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_any.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaInternalPermissionServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaInternalPermissionServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_connect_error.rb b/lib/zitadel/client/models/beta_internal_permission_service_connect_error.rb index b42e47d5..cd9491bf 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaInternalPermissionServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaInternalPermissionServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_create_administrator_request.rb b/lib/zitadel/client/models/beta_internal_permission_service_create_administrator_request.rb index 7459feca..192bd439 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_create_administrator_request.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_create_administrator_request.rb @@ -1,237 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceCreateAdministratorRequest - # UserID is the ID of the user who should be granted the administrator role. - attr_accessor :user_id - - attr_accessor :resource - - # Roles are the roles that should be granted to the user for the specified resource. Note that roles are currently specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. - attr_accessor :roles - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'resource' => :'resource', - :'roles' => :'roles' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'resource' => :'BetaInternalPermissionServiceResourceType', - :'roles' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceCreateAdministratorRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceCreateAdministratorRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'resource') - self.resource = attributes[:'resource'] - end - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - resource == o.resource && - roles == o.roles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, resource, roles].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceCreateAdministratorRequest. + class BetaInternalPermissionServiceCreateAdministratorRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + resource: 'resource', + roles: 'roles' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + resource: 'BetaInternalPermissionServiceResourceType', + roles: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # UserID is the ID of the user who should be granted the administrator role. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource, Types::Any.optional.meta(omittable: true) + # Roles are the roles that should be granted to the user for the specified resource. Note that roles are currently specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_create_administrator_response.rb b/lib/zitadel/client/models/beta_internal_permission_service_create_administrator_response.rb index a65c2758..4666f828 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_create_administrator_response.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_create_administrator_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceCreateAdministratorResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceCreateAdministratorResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceCreateAdministratorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceCreateAdministratorResponse. + class BetaInternalPermissionServiceCreateAdministratorResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_request.rb b/lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_request.rb index 81316954..5920641b 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_request.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_request.rb @@ -1,225 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceDeleteAdministratorRequest - # UserID is the ID of the user who should have his administrator roles removed. - attr_accessor :user_id - - attr_accessor :resource - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'resource' => :'resource' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'resource' => :'BetaInternalPermissionServiceResourceType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceDeleteAdministratorRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceDeleteAdministratorRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'resource') - self.resource = attributes[:'resource'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - resource == o.resource - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, resource].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceDeleteAdministratorRequest. + class BetaInternalPermissionServiceDeleteAdministratorRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + resource: 'resource' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + resource: 'BetaInternalPermissionServiceResourceType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # UserID is the ID of the user who should have his administrator roles removed. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_response.rb b/lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_response.rb index e66b9d97..a697fb31 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_response.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_delete_administrator_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceDeleteAdministratorResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceDeleteAdministratorResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceDeleteAdministratorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceDeleteAdministratorResponse. + class BetaInternalPermissionServiceDeleteAdministratorResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_i_d_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_i_d_filter.rb deleted file mode 100644 index 826fa485..00000000 --- a/lib/zitadel/client/models/beta_internal_permission_service_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceIDFilter - # Only return resources that belong to this id. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_id_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_id_filter.rb new file mode 100644 index 00000000..e909e6f2 --- /dev/null +++ b/lib/zitadel/client/models/beta_internal_permission_service_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceIDFilter. + class BetaInternalPermissionServiceIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Only return resources that belong to this id. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_in_i_ds_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_in_i_ds_filter.rb deleted file mode 100644 index 3f250f86..00000000 --- a/lib/zitadel/client/models/beta_internal_permission_service_in_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceInIDsFilter - # Defines the ids to query for. - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceInIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceInIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_in_ids_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_in_ids_filter.rb new file mode 100644 index 00000000..2e6b464a --- /dev/null +++ b/lib/zitadel/client/models/beta_internal_permission_service_in_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceInIDsFilter. + class BetaInternalPermissionServiceInIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_list_administrators_request.rb b/lib/zitadel/client/models/beta_internal_permission_service_list_administrators_request.rb index 10ef1c28..4dec8ca8 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_list_administrators_request.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_list_administrators_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceListAdministratorsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Filter the administrator roles to be returned. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaInternalPermissionServicePaginationRequest', - :'sorting_column' => :'BetaInternalPermissionServiceAdministratorFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceListAdministratorsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceListAdministratorsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceListAdministratorsRequest. + class BetaInternalPermissionServiceListAdministratorsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaInternalPermissionServicePaginationRequest', + sorting_column: 'BetaInternalPermissionServiceAdministratorFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Filter the administrator roles to be returned. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_list_administrators_response.rb b/lib/zitadel/client/models/beta_internal_permission_service_list_administrators_response.rb index 983c839c..2393f559 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_list_administrators_response.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_list_administrators_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceListAdministratorsResponse - attr_accessor :pagination - - attr_accessor :administrators - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'administrators' => :'administrators' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaInternalPermissionServicePaginationResponse', - :'administrators' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceListAdministratorsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceListAdministratorsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'administrators') - if (value = attributes[:'administrators']).is_a?(Array) - self.administrators = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - administrators == o.administrators - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, administrators].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceListAdministratorsResponse. + class BetaInternalPermissionServiceListAdministratorsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + administrators: 'administrators' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaInternalPermissionServicePaginationResponse', + administrators: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :administrators, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_not_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_not_filter.rb index 33c630d4..84b13c7b 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_not_filter.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_not_filter.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceNotFilter - attr_accessor :query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'query' => :'query' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'query' => :'BetaInternalPermissionServiceAdministratorSearchFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceNotFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceNotFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - query == o.query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceNotFilter. + class BetaInternalPermissionServiceNotFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + query: 'query' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + query: 'BetaInternalPermissionServiceAdministratorSearchFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_or_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_or_filter.rb index b085ae25..de834a47 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_or_filter.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_or_filter.rb @@ -1,217 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceOrFilter - attr_accessor :queries - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceOrFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceOrFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceOrFilter. + class BetaInternalPermissionServiceOrFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_organization.rb b/lib/zitadel/client/models/beta_internal_permission_service_organization.rb index d9f26571..ab9df05f 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_organization.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_organization.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceOrganization - # ID is the unique identifier of the organization the user was granted the administrator role for. - attr_accessor :id - - # Name is the name of the organization the user was granted the administrator role for. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceOrganization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceOrganization. + class BetaInternalPermissionServiceOrganization < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the organization the user was granted the administrator role for. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Name is the name of the organization the user was granted the administrator role for. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_pagination_request.rb b/lib/zitadel/client/models/beta_internal_permission_service_pagination_request.rb index b278ae0a..c664f654 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_pagination_request.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServicePaginationRequest. + class BetaInternalPermissionServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_pagination_response.rb b/lib/zitadel/client/models/beta_internal_permission_service_pagination_response.rb index 82981a29..62501ca7 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_pagination_response.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServicePaginationResponse. + class BetaInternalPermissionServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_project.rb b/lib/zitadel/client/models/beta_internal_permission_service_project.rb index c9a4c3de..95df7024 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_project.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_project.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceProject - # ID is the unique identifier of the project the user was granted the administrator role for. - attr_accessor :id - - # Name is the name of the project the user was granted the administrator role for. - attr_accessor :name - - # OrganizationID is the ID of the organization the project belongs to. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceProject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceProject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceProject. + class BetaInternalPermissionServiceProject < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the project the user was granted the administrator role for. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Name is the name of the project the user was granted the administrator role for. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # OrganizationID is the ID of the organization the project belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_project_grant.rb b/lib/zitadel/client/models/beta_internal_permission_service_project_grant.rb index ad40ba2f..fd372f83 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_project_grant.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_project_grant.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceProjectGrant - # ProjectID is required to grant administrator privileges for a specific project. - attr_accessor :project_id - - # OrganizationID is required to grant administrator privileges for a specific project grant. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceProjectGrant` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceProjectGrant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceProjectGrant. + class BetaInternalPermissionServiceProjectGrant < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is required to grant administrator privileges for a specific project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # OrganizationID is required to grant administrator privileges for a specific project grant. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_resource_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_resource_filter.rb index 43894288..7889eff0 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_resource_filter.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_resource_filter.rb @@ -1,246 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceResourceFilter - # Search for administrators granted on the instance level. - attr_accessor :instance - - # Search for administrators granted on a specific organization. - attr_accessor :organization_id - - # Search for administrators granted on a specific project grant. - attr_accessor :project_grant_id - - # Search for administrators granted on a specific project. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance' => :'instance', - :'organization_id' => :'organizationId', - :'project_grant_id' => :'projectGrantId', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance' => :'Boolean', - :'organization_id' => :'String', - :'project_grant_id' => :'String', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceResourceFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceResourceFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'project_grant_id') - self.project_grant_id = attributes[:'project_grant_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance == o.instance && - organization_id == o.organization_id && - project_grant_id == o.project_grant_id && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance, organization_id, project_grant_id, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceResourceFilter. + class BetaInternalPermissionServiceResourceFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance: 'instance', + organization_id: 'organizationId', + project_grant_id: 'projectGrantId', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance: 'Boolean', + organization_id: 'String', + project_grant_id: 'String', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Search for administrators granted on the instance level. + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # Search for administrators granted on a specific organization. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Search for administrators granted on a specific project grant. + # @example null + attribute :project_grant_id, Types::Any.optional.meta(omittable: true) + # Search for administrators granted on a specific project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_resource_type.rb b/lib/zitadel/client/models/beta_internal_permission_service_resource_type.rb index 69081086..917b2e53 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_resource_type.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_resource_type.rb @@ -1,245 +1,88 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceResourceType - # Instance is the resource type for granting administrator privileges on the instance level. - attr_accessor :instance - - # OrganizationID is required to grant administrator privileges for a specific organization. - attr_accessor :organization_id - - attr_accessor :project_grant - - # ProjectID is required to grant administrator privileges for a specific project. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance' => :'instance', - :'organization_id' => :'organizationId', - :'project_grant' => :'projectGrant', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance' => :'Boolean', - :'organization_id' => :'String', - :'project_grant' => :'BetaInternalPermissionServiceProjectGrant', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceResourceType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceResourceType`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'project_grant') - self.project_grant = attributes[:'project_grant'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance == o.instance && - organization_id == o.organization_id && - project_grant == o.project_grant && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance, organization_id, project_grant, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceResourceType. + class BetaInternalPermissionServiceResourceType < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance: 'instance', + organization_id: 'organizationId', + project_grant: 'projectGrant', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance: 'Boolean', + organization_id: 'String', + project_grant: 'BetaInternalPermissionServiceProjectGrant', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Instance is the resource type for granting administrator privileges on the instance level. + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # OrganizationID is required to grant administrator privileges for a specific organization. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grant, Types::Any.optional.meta(omittable: true) + # ProjectID is required to grant administrator privileges for a specific project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_role_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_role_filter.rb index ea4d5850..d01fb452 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_role_filter.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_role_filter.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceRoleFilter - # Search for administrators by the granted role. - attr_accessor :role_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'role_key' => :'roleKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'role_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceRoleFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceRoleFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - role_key == o.role_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [role_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceRoleFilter. + class BetaInternalPermissionServiceRoleFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + role_key: 'roleKey' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + role_key: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Search for administrators by the granted role. + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_text_filter_method.rb b/lib/zitadel/client/models/beta_internal_permission_service_text_filter_method.rb index 5484c29f..638420c2 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_text_filter_method.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaInternalPermissionServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaInternalPermissionServiceTextFilterMethod. + class BetaInternalPermissionServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaInternalPermissionServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaInternalPermissionServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaInternalPermissionServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter.rb index 506fc66f..5ace80c4 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceTimestampFilter - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'timestamp' => :'timestamp', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'timestamp' => :'Time', - :'method' => :'BetaInternalPermissionServiceTimestampFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceTimestampFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceTimestampFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - timestamp == o.timestamp && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [timestamp, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceTimestampFilter. + class BetaInternalPermissionServiceTimestampFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + timestamp: 'timestamp', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + timestamp: 'Time', + method: 'BetaInternalPermissionServiceTimestampFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter_method.rb b/lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter_method.rb index 122c295b..3d5d9480 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter_method.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_timestamp_filter_method.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaInternalPermissionServiceTimestampFilterMethod - TIMESTAMP_FILTER_METHOD_EQUALS = "TIMESTAMP_FILTER_METHOD_EQUALS".freeze - TIMESTAMP_FILTER_METHOD_GREATER = "TIMESTAMP_FILTER_METHOD_GREATER".freeze - TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS".freeze - TIMESTAMP_FILTER_METHOD_LESS = "TIMESTAMP_FILTER_METHOD_LESS".freeze - TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaInternalPermissionServiceTimestampFilterMethod. + class BetaInternalPermissionServiceTimestampFilterMethod + TIMESTAMP_FILTER_METHOD_EQUALS = 'TIMESTAMP_FILTER_METHOD_EQUALS' + TIMESTAMP_FILTER_METHOD_GREATER = 'TIMESTAMP_FILTER_METHOD_GREATER' + TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS' + TIMESTAMP_FILTER_METHOD_LESS = 'TIMESTAMP_FILTER_METHOD_LESS' + TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS' - def self.all_vars - @all_vars ||= [TIMESTAMP_FILTER_METHOD_EQUALS, TIMESTAMP_FILTER_METHOD_GREATER, TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS, TIMESTAMP_FILTER_METHOD_LESS, TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [TIMESTAMP_FILTER_METHOD_EQUALS, TIMESTAMP_FILTER_METHOD_GREATER, TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS, TIMESTAMP_FILTER_METHOD_LESS, TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaInternalPermissionServiceTimestampFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaInternalPermissionServiceTimestampFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaInternalPermissionServiceTimestampFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_update_administrator_request.rb b/lib/zitadel/client/models/beta_internal_permission_service_update_administrator_request.rb index 2d1e3b02..638301bf 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_update_administrator_request.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_update_administrator_request.rb @@ -1,237 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceUpdateAdministratorRequest - # UserID is the ID of the user who should have his administrator roles update. - attr_accessor :user_id - - attr_accessor :resource - - # Roles are the roles that the user should be granted. Note that any role previously granted to the user and not present in the list will be revoked. - attr_accessor :roles - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'resource' => :'resource', - :'roles' => :'roles' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'resource' => :'BetaInternalPermissionServiceResourceType', - :'roles' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceUpdateAdministratorRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceUpdateAdministratorRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'resource') - self.resource = attributes[:'resource'] - end - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - resource == o.resource && - roles == o.roles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, resource, roles].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceUpdateAdministratorRequest. + class BetaInternalPermissionServiceUpdateAdministratorRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + resource: 'resource', + roles: 'roles' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + resource: 'BetaInternalPermissionServiceResourceType', + roles: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # UserID is the ID of the user who should have his administrator roles update. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource, Types::Any.optional.meta(omittable: true) + # Roles are the roles that the user should be granted. Note that any role previously granted to the user and not present in the list will be revoked. + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_update_administrator_response.rb b/lib/zitadel/client/models/beta_internal_permission_service_update_administrator_response.rb index fb89859e..93450d91 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_update_administrator_response.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_update_administrator_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceUpdateAdministratorResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceUpdateAdministratorResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceUpdateAdministratorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceUpdateAdministratorResponse. + class BetaInternalPermissionServiceUpdateAdministratorResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_user.rb b/lib/zitadel/client/models/beta_internal_permission_service_user.rb index c35f6d1e..8b54402b 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_user.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_user.rb @@ -1,246 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceUser - # ID is the unique identifier of the user. - attr_accessor :id - - # PreferredLoginName is the preferred login name of the user. This value is unique across the whole instance. - attr_accessor :preferred_login_name - - # DisplayName is the public display name of the user. By default it's the user's given name and family name, their username or their email address. - attr_accessor :display_name - - # The organization the user belong to. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'preferred_login_name' => :'preferredLoginName', - :'display_name' => :'displayName', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'preferred_login_name' => :'String', - :'display_name' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - preferred_login_name == o.preferred_login_name && - display_name == o.display_name && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, preferred_login_name, display_name, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceUser. + class BetaInternalPermissionServiceUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + preferred_login_name: 'preferredLoginName', + display_name: 'displayName', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + preferred_login_name: 'String', + display_name: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the user. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # PreferredLoginName is the preferred login name of the user. This value is unique across the whole instance. + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # DisplayName is the public display name of the user. By default it's the user's given name and family name, their username or their email address. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # The organization the user belong to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_user_display_name_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_user_display_name_filter.rb index f651b11f..590485d9 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_user_display_name_filter.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_user_display_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceUserDisplayNameFilter - # Search for administrators by the display name of the user. - attr_accessor :display_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name' => :'displayName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name' => :'String', - :'method' => :'BetaInternalPermissionServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceUserDisplayNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceUserDisplayNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name == o.display_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceUserDisplayNameFilter. + class BetaInternalPermissionServiceUserDisplayNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name: 'displayName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name: 'String', + method: 'BetaInternalPermissionServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Search for administrators by the display name of the user. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_internal_permission_service_user_preferred_login_name_filter.rb b/lib/zitadel/client/models/beta_internal_permission_service_user_preferred_login_name_filter.rb index bd03c5d2..f74081bf 100644 --- a/lib/zitadel/client/models/beta_internal_permission_service_user_preferred_login_name_filter.rb +++ b/lib/zitadel/client/models/beta_internal_permission_service_user_preferred_login_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaInternalPermissionServiceUserPreferredLoginNameFilter - # Search for administrators by the preferred login name of the user. - attr_accessor :preferred_login_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'preferred_login_name' => :'preferredLoginName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'preferred_login_name' => :'String', - :'method' => :'BetaInternalPermissionServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaInternalPermissionServiceUserPreferredLoginNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaInternalPermissionServiceUserPreferredLoginNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - preferred_login_name == o.preferred_login_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [preferred_login_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaInternalPermissionServiceUserPreferredLoginNameFilter. + class BetaInternalPermissionServiceUserPreferredLoginNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + preferred_login_name: 'preferredLoginName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + preferred_login_name: 'String', + method: 'BetaInternalPermissionServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Search for administrators by the preferred login name of the user. + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_any.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_any.rb deleted file mode 100644 index 7cf5fd5e..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_any.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaOIDCServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_auth_request.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_auth_request.rb deleted file mode 100644 index 44f70b7e..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_auth_request.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServiceAuthRequest - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :client_id - - attr_accessor :scope - - attr_accessor :redirect_uri - - attr_accessor :prompt - - attr_accessor :ui_locales - - attr_accessor :login_hint - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :max_age - - attr_accessor :hint_user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'client_id' => :'clientId', - :'scope' => :'scope', - :'redirect_uri' => :'redirectUri', - :'prompt' => :'prompt', - :'ui_locales' => :'uiLocales', - :'login_hint' => :'loginHint', - :'max_age' => :'maxAge', - :'hint_user_id' => :'hintUserId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'client_id' => :'String', - :'scope' => :'Array', - :'redirect_uri' => :'String', - :'prompt' => :'Array', - :'ui_locales' => :'Array', - :'login_hint' => :'String', - :'max_age' => :'String', - :'hint_user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'login_hint', - :'hint_user_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceAuthRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceAuthRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'scope') - if (value = attributes[:'scope']).is_a?(Array) - self.scope = value - end - end - - if attributes.key?(:'redirect_uri') - self.redirect_uri = attributes[:'redirect_uri'] - end - - if attributes.key?(:'prompt') - if (value = attributes[:'prompt']).is_a?(Array) - self.prompt = value - end - end - - if attributes.key?(:'ui_locales') - if (value = attributes[:'ui_locales']).is_a?(Array) - self.ui_locales = value - end - end - - if attributes.key?(:'login_hint') - self.login_hint = attributes[:'login_hint'] - end - - if attributes.key?(:'max_age') - self.max_age = attributes[:'max_age'] - end - - if attributes.key?(:'hint_user_id') - self.hint_user_id = attributes[:'hint_user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - client_id == o.client_id && - scope == o.scope && - redirect_uri == o.redirect_uri && - prompt == o.prompt && - ui_locales == o.ui_locales && - login_hint == o.login_hint && - max_age == o.max_age && - hint_user_id == o.hint_user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, client_id, scope, redirect_uri, prompt, ui_locales, login_hint, max_age, hint_user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_authorization_error.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_authorization_error.rb deleted file mode 100644 index 8e64d13f..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_authorization_error.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServiceAuthorizationError - attr_accessor :error - - attr_accessor :error_description - - attr_accessor :error_uri - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error' => :'error', - :'error_description' => :'errorDescription', - :'error_uri' => :'errorUri' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error' => :'BetaOIDCServiceErrorReason', - :'error_description' => :'String', - :'error_uri' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error_description', - :'error_uri' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceAuthorizationError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceAuthorizationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'error_description') - self.error_description = attributes[:'error_description'] - end - - if attributes.key?(:'error_uri') - self.error_uri = attributes[:'error_uri'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error == o.error && - error_description == o.error_description && - error_uri == o.error_uri - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error, error_description, error_uri].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_connect_error.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_connect_error.rb deleted file mode 100644 index ae0d32d6..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_connect_error.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaOIDCServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_create_callback_request.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_create_callback_request.rb deleted file mode 100644 index bc3ab3c7..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_create_callback_request.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServiceCreateCallbackRequest - attr_accessor :auth_request_id - - attr_accessor :error - - attr_accessor :session - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_request_id' => :'authRequestId', - :'error' => :'error', - :'session' => :'session' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_request_id' => :'String', - :'error' => :'BetaOIDCServiceAuthorizationError', - :'session' => :'BetaOIDCServiceSession' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceCreateCallbackRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceCreateCallbackRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_request_id') - self.auth_request_id = attributes[:'auth_request_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'session') - self.session = attributes[:'session'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_request_id == o.auth_request_id && - error == o.error && - session == o.session - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_request_id, error, session].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_create_callback_response.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_create_callback_response.rb deleted file mode 100644 index 39f549b7..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_create_callback_response.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServiceCreateCallbackResponse - attr_accessor :details - - attr_accessor :callback_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'callback_url' => :'callbackUrl' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaOIDCServiceDetails', - :'callback_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceCreateCallbackResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceCreateCallbackResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'callback_url') - self.callback_url = attributes[:'callback_url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - callback_url == o.callback_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, callback_url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_details.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_details.rb deleted file mode 100644 index d797ea2e..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_details.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_error_reason.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_error_reason.rb deleted file mode 100644 index ec691027..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_error_reason.rb +++ /dev/null @@ -1,56 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServiceErrorReason - ERROR_REASON_UNSPECIFIED = "ERROR_REASON_UNSPECIFIED".freeze - ERROR_REASON_INVALID_REQUEST = "ERROR_REASON_INVALID_REQUEST".freeze - ERROR_REASON_UNAUTHORIZED_CLIENT = "ERROR_REASON_UNAUTHORIZED_CLIENT".freeze - ERROR_REASON_ACCESS_DENIED = "ERROR_REASON_ACCESS_DENIED".freeze - ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE = "ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE".freeze - ERROR_REASON_INVALID_SCOPE = "ERROR_REASON_INVALID_SCOPE".freeze - ERROR_REASON_SERVER_ERROR = "ERROR_REASON_SERVER_ERROR".freeze - ERROR_REASON_TEMPORARY_UNAVAILABLE = "ERROR_REASON_TEMPORARY_UNAVAILABLE".freeze - ERROR_REASON_INTERACTION_REQUIRED = "ERROR_REASON_INTERACTION_REQUIRED".freeze - ERROR_REASON_LOGIN_REQUIRED = "ERROR_REASON_LOGIN_REQUIRED".freeze - ERROR_REASON_ACCOUNT_SELECTION_REQUIRED = "ERROR_REASON_ACCOUNT_SELECTION_REQUIRED".freeze - ERROR_REASON_CONSENT_REQUIRED = "ERROR_REASON_CONSENT_REQUIRED".freeze - ERROR_REASON_INVALID_REQUEST_URI = "ERROR_REASON_INVALID_REQUEST_URI".freeze - ERROR_REASON_INVALID_REQUEST_OBJECT = "ERROR_REASON_INVALID_REQUEST_OBJECT".freeze - ERROR_REASON_REQUEST_NOT_SUPPORTED = "ERROR_REASON_REQUEST_NOT_SUPPORTED".freeze - ERROR_REASON_REQUEST_URI_NOT_SUPPORTED = "ERROR_REASON_REQUEST_URI_NOT_SUPPORTED".freeze - ERROR_REASON_REGISTRATION_NOT_SUPPORTED = "ERROR_REASON_REGISTRATION_NOT_SUPPORTED".freeze - - def self.all_vars - @all_vars ||= [ERROR_REASON_UNSPECIFIED, ERROR_REASON_INVALID_REQUEST, ERROR_REASON_UNAUTHORIZED_CLIENT, ERROR_REASON_ACCESS_DENIED, ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE, ERROR_REASON_INVALID_SCOPE, ERROR_REASON_SERVER_ERROR, ERROR_REASON_TEMPORARY_UNAVAILABLE, ERROR_REASON_INTERACTION_REQUIRED, ERROR_REASON_LOGIN_REQUIRED, ERROR_REASON_ACCOUNT_SELECTION_REQUIRED, ERROR_REASON_CONSENT_REQUIRED, ERROR_REASON_INVALID_REQUEST_URI, ERROR_REASON_INVALID_REQUEST_OBJECT, ERROR_REASON_REQUEST_NOT_SUPPORTED, ERROR_REASON_REQUEST_URI_NOT_SUPPORTED, ERROR_REASON_REGISTRATION_NOT_SUPPORTED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaOIDCServiceErrorReason.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaOIDCServiceErrorReason" - end - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_request.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_request.rb deleted file mode 100644 index 5c41efef..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServiceGetAuthRequestRequest - attr_accessor :auth_request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_request_id' => :'authRequestId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceGetAuthRequestRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceGetAuthRequestRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_request_id') - self.auth_request_id = attributes[:'auth_request_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_request_id == o.auth_request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_request_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_response.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_response.rb deleted file mode 100644 index 5c93ed42..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_get_auth_request_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServiceGetAuthRequestResponse - attr_accessor :auth_request - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_request' => :'authRequest' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_request' => :'BetaOIDCServiceAuthRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceGetAuthRequestResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceGetAuthRequestResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_request') - self.auth_request = attributes[:'auth_request'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_request == o.auth_request - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_request].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_prompt.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_prompt.rb deleted file mode 100644 index 6f80a109..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_prompt.rb +++ /dev/null @@ -1,45 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServicePrompt - PROMPT_UNSPECIFIED = "PROMPT_UNSPECIFIED".freeze - PROMPT_NONE = "PROMPT_NONE".freeze - PROMPT_LOGIN = "PROMPT_LOGIN".freeze - PROMPT_CONSENT = "PROMPT_CONSENT".freeze - PROMPT_SELECT_ACCOUNT = "PROMPT_SELECT_ACCOUNT".freeze - PROMPT_CREATE = "PROMPT_CREATE".freeze - - def self.all_vars - @all_vars ||= [PROMPT_UNSPECIFIED, PROMPT_NONE, PROMPT_LOGIN, PROMPT_CONSENT, PROMPT_SELECT_ACCOUNT, PROMPT_CREATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaOIDCServicePrompt.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaOIDCServicePrompt" - end - end - -end diff --git a/lib/zitadel/client/models/beta_o_i_d_c_service_session.rb b/lib/zitadel/client/models/beta_o_i_d_c_service_session.rb deleted file mode 100644 index defc3823..00000000 --- a/lib/zitadel/client/models/beta_o_i_d_c_service_session.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOIDCServiceSession - attr_accessor :session_id - - attr_accessor :session_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'session_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOIDCServiceSession` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOIDCServiceSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - session_token == o.session_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, session_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_oidc_service_any.rb b/lib/zitadel/client/models/beta_oidc_service_any.rb new file mode 100644 index 00000000..27ebe570 --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_any.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaOIDCServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_auth_request.rb b/lib/zitadel/client/models/beta_oidc_service_auth_request.rb new file mode 100644 index 00000000..fdfb26b9 --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_auth_request.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOIDCServiceAuthRequest. + class BetaOIDCServiceAuthRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + client_id: 'clientId', + scope: 'scope', + redirect_uri: 'redirectUri', + prompt: 'prompt', + ui_locales: 'uiLocales', + login_hint: 'loginHint', + max_age: 'maxAge', + hint_user_id: 'hintUserId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + client_id: 'String', + scope: 'Array', + redirect_uri: 'String', + prompt: 'Array', + ui_locales: 'Array', + login_hint: 'String', + max_age: 'ISO8601::Duration', + hint_user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :scope, Types::Any.optional.meta(omittable: true) + # @example null + attribute :redirect_uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :prompt, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ui_locales, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_hint, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :max_age, Types::Any.optional.meta(omittable: true) + # @example null + attribute :hint_user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_authorization_error.rb b/lib/zitadel/client/models/beta_oidc_service_authorization_error.rb new file mode 100644 index 00000000..1df92f3e --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_authorization_error.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOIDCServiceAuthorizationError. + class BetaOIDCServiceAuthorizationError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + error: 'error', + error_description: 'errorDescription', + error_uri: 'errorUri' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + error: 'BetaOIDCServiceErrorReason', + error_description: 'String', + error_uri: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :error_description, Types::Any.optional.meta(omittable: true) + # @example null + attribute :error_uri, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_connect_error.rb b/lib/zitadel/client/models/beta_oidc_service_connect_error.rb new file mode 100644 index 00000000..de2b120b --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_connect_error.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaOIDCServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_create_callback_request.rb b/lib/zitadel/client/models/beta_oidc_service_create_callback_request.rb new file mode 100644 index 00000000..0b97dabc --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_create_callback_request.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOIDCServiceCreateCallbackRequest. + class BetaOIDCServiceCreateCallbackRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_request_id: 'authRequestId', + error: 'error', + session: 'session' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_request_id: 'String', + error: 'BetaOIDCServiceAuthorizationError', + session: 'BetaOIDCServiceSession' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :auth_request_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_create_callback_response.rb b/lib/zitadel/client/models/beta_oidc_service_create_callback_response.rb new file mode 100644 index 00000000..ec0970bf --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_create_callback_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOIDCServiceCreateCallbackResponse. + class BetaOIDCServiceCreateCallbackResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + callback_url: 'callbackUrl' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaOIDCServiceDetails', + callback_url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :callback_url, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_details.rb b/lib/zitadel/client/models/beta_oidc_service_details.rb new file mode 100644 index 00000000..114943c4 --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_details.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOIDCServiceDetails. + class BetaOIDCServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_error_reason.rb b/lib/zitadel/client/models/beta_oidc_service_error_reason.rb new file mode 100644 index 00000000..1b5b3982 --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_error_reason.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaOIDCServiceErrorReason. + class BetaOIDCServiceErrorReason + ERROR_REASON_UNSPECIFIED = 'ERROR_REASON_UNSPECIFIED' + ERROR_REASON_INVALID_REQUEST = 'ERROR_REASON_INVALID_REQUEST' + ERROR_REASON_UNAUTHORIZED_CLIENT = 'ERROR_REASON_UNAUTHORIZED_CLIENT' + ERROR_REASON_ACCESS_DENIED = 'ERROR_REASON_ACCESS_DENIED' + ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE = 'ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE' + ERROR_REASON_INVALID_SCOPE = 'ERROR_REASON_INVALID_SCOPE' + ERROR_REASON_SERVER_ERROR = 'ERROR_REASON_SERVER_ERROR' + ERROR_REASON_TEMPORARY_UNAVAILABLE = 'ERROR_REASON_TEMPORARY_UNAVAILABLE' + ERROR_REASON_INTERACTION_REQUIRED = 'ERROR_REASON_INTERACTION_REQUIRED' + ERROR_REASON_LOGIN_REQUIRED = 'ERROR_REASON_LOGIN_REQUIRED' + ERROR_REASON_ACCOUNT_SELECTION_REQUIRED = 'ERROR_REASON_ACCOUNT_SELECTION_REQUIRED' + ERROR_REASON_CONSENT_REQUIRED = 'ERROR_REASON_CONSENT_REQUIRED' + ERROR_REASON_INVALID_REQUEST_URI = 'ERROR_REASON_INVALID_REQUEST_URI' + ERROR_REASON_INVALID_REQUEST_OBJECT = 'ERROR_REASON_INVALID_REQUEST_OBJECT' + ERROR_REASON_REQUEST_NOT_SUPPORTED = 'ERROR_REASON_REQUEST_NOT_SUPPORTED' + ERROR_REASON_REQUEST_URI_NOT_SUPPORTED = 'ERROR_REASON_REQUEST_URI_NOT_SUPPORTED' + ERROR_REASON_REGISTRATION_NOT_SUPPORTED = 'ERROR_REASON_REGISTRATION_NOT_SUPPORTED' + + # Frozen set of all allowed values, used for validation. + VALUES = [ERROR_REASON_UNSPECIFIED, ERROR_REASON_INVALID_REQUEST, ERROR_REASON_UNAUTHORIZED_CLIENT, ERROR_REASON_ACCESS_DENIED, ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE, ERROR_REASON_INVALID_SCOPE, ERROR_REASON_SERVER_ERROR, ERROR_REASON_TEMPORARY_UNAVAILABLE, ERROR_REASON_INTERACTION_REQUIRED, ERROR_REASON_LOGIN_REQUIRED, ERROR_REASON_ACCOUNT_SELECTION_REQUIRED, ERROR_REASON_CONSENT_REQUIRED, ERROR_REASON_INVALID_REQUEST_URI, ERROR_REASON_INVALID_REQUEST_OBJECT, ERROR_REASON_REQUEST_NOT_SUPPORTED, ERROR_REASON_REQUEST_URI_NOT_SUPPORTED, ERROR_REASON_REGISTRATION_NOT_SUPPORTED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaOIDCServiceErrorReason: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_get_auth_request_request.rb b/lib/zitadel/client/models/beta_oidc_service_get_auth_request_request.rb new file mode 100644 index 00000000..a1d99bcc --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_get_auth_request_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOIDCServiceGetAuthRequestRequest. + class BetaOIDCServiceGetAuthRequestRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_request_id: 'authRequestId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_request_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :auth_request_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_get_auth_request_response.rb b/lib/zitadel/client/models/beta_oidc_service_get_auth_request_response.rb new file mode 100644 index 00000000..d8f1cee3 --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_get_auth_request_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOIDCServiceGetAuthRequestResponse. + class BetaOIDCServiceGetAuthRequestResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_request: 'authRequest' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_request: 'BetaOIDCServiceAuthRequest' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :auth_request, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_prompt.rb b/lib/zitadel/client/models/beta_oidc_service_prompt.rb new file mode 100644 index 00000000..5d7731b1 --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_prompt.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaOIDCServicePrompt. + class BetaOIDCServicePrompt + PROMPT_UNSPECIFIED = 'PROMPT_UNSPECIFIED' + PROMPT_NONE = 'PROMPT_NONE' + PROMPT_LOGIN = 'PROMPT_LOGIN' + PROMPT_CONSENT = 'PROMPT_CONSENT' + PROMPT_SELECT_ACCOUNT = 'PROMPT_SELECT_ACCOUNT' + PROMPT_CREATE = 'PROMPT_CREATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROMPT_UNSPECIFIED, PROMPT_NONE, PROMPT_LOGIN, PROMPT_CONSENT, PROMPT_SELECT_ACCOUNT, PROMPT_CREATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaOIDCServicePrompt: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_oidc_service_session.rb b/lib/zitadel/client/models/beta_oidc_service_session.rb new file mode 100644 index 00000000..ba396b3e --- /dev/null +++ b/lib/zitadel/client/models/beta_oidc_service_session.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOIDCServiceSession. + class BetaOIDCServiceSession < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session_id: 'sessionId', + session_token: 'sessionToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session_id: 'String', + session_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_organization_service_activate_organization_request.rb b/lib/zitadel/client/models/beta_organization_service_activate_organization_request.rb index dc903c83..23bc83ea 100644 --- a/lib/zitadel/client/models/beta_organization_service_activate_organization_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_activate_organization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceActivateOrganizationRequest - # Organization Id for the Organization to be activated - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceActivateOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceActivateOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceActivateOrganizationRequest. + class BetaOrganizationServiceActivateOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization to be activated + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_activate_organization_response.rb b/lib/zitadel/client/models/beta_organization_service_activate_organization_response.rb index 9e1213c6..c0117f0c 100644 --- a/lib/zitadel/client/models/beta_organization_service_activate_organization_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_activate_organization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceActivateOrganizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceActivateOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceActivateOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceActivateOrganizationResponse. + class BetaOrganizationServiceActivateOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_add_human_user_request.rb b/lib/zitadel/client/models/beta_organization_service_add_human_user_request.rb index 6666adaa..6ac54a77 100644 --- a/lib/zitadel/client/models/beta_organization_service_add_human_user_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_add_human_user_request.rb @@ -1,315 +1,116 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceAddHumanUserRequest - # optionally set your own id unique for the user. - attr_accessor :user_id - - # optionally set a unique username, if none is provided the email will be used. - attr_accessor :username - - attr_accessor :organization - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - attr_accessor :metadata - - attr_accessor :idp_links - - # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. - attr_accessor :totp_secret - - attr_accessor :hashed_password - - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'username' => :'username', - :'organization' => :'organization', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'metadata' => :'metadata', - :'idp_links' => :'idpLinks', - :'totp_secret' => :'totpSecret', - :'hashed_password' => :'hashedPassword', - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'username' => :'String', - :'organization' => :'BetaOrganizationServiceOrganization', - :'profile' => :'BetaOrganizationServiceSetHumanProfile', - :'email' => :'BetaOrganizationServiceSetHumanEmail', - :'phone' => :'BetaOrganizationServiceSetHumanPhone', - :'metadata' => :'Array', - :'idp_links' => :'Array', - :'totp_secret' => :'String', - :'hashed_password' => :'BetaOrganizationServiceHashedPassword', - :'password' => :'BetaOrganizationServicePassword' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user_id', - :'username', - :'totp_secret', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceAddHumanUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceAddHumanUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'organization') - self.organization = attributes[:'organization'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - - if attributes.key?(:'idp_links') - if (value = attributes[:'idp_links']).is_a?(Array) - self.idp_links = value - end - end - - if attributes.key?(:'totp_secret') - self.totp_secret = attributes[:'totp_secret'] - end - - if attributes.key?(:'hashed_password') - self.hashed_password = attributes[:'hashed_password'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - username == o.username && - organization == o.organization && - profile == o.profile && - email == o.email && - phone == o.phone && - metadata == o.metadata && - idp_links == o.idp_links && - totp_secret == o.totp_secret && - hashed_password == o.hashed_password && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, username, organization, profile, email, phone, metadata, idp_links, totp_secret, hashed_password, password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceAddHumanUserRequest. + class BetaOrganizationServiceAddHumanUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + username: 'username', + organization: 'organization', + profile: 'profile', + email: 'email', + phone: 'phone', + metadata: 'metadata', + idp_links: 'idpLinks', + totp_secret: 'totpSecret', + hashed_password: 'hashedPassword', + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + username: 'String', + organization: 'BetaOrganizationServiceOrganization', + profile: 'BetaOrganizationServiceSetHumanProfile', + email: 'BetaOrganizationServiceSetHumanEmail', + phone: 'BetaOrganizationServiceSetHumanPhone', + metadata: 'Array', + idp_links: 'Array', + totp_secret: 'String', + hashed_password: 'BetaOrganizationServiceHashedPassword', + password: 'BetaOrganizationServicePassword' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # optionally set your own id unique for the user. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # optionally set a unique username, if none is provided the email will be used. + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization, Types::Any.optional.meta(omittable: true) + # @example null + attribute :profile, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_links, Types::Any.optional.meta(omittable: true) + # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. + # @example null + attribute :totp_secret, Types::Any.optional.meta(omittable: true) + # @example null + attribute :hashed_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_add_organization_domain_request.rb b/lib/zitadel/client/models/beta_organization_service_add_organization_domain_request.rb index 702e0624..950ff273 100644 --- a/lib/zitadel/client/models/beta_organization_service_add_organization_domain_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_add_organization_domain_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceAddOrganizationDomainRequest - # Organization Id for the Organization for which the domain is to be added to. - attr_accessor :organization_id - - # The domain you want to add to the organization. - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceAddOrganizationDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceAddOrganizationDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceAddOrganizationDomainRequest. + class BetaOrganizationServiceAddOrganizationDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization for which the domain is to be added to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # The domain you want to add to the organization. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_add_organization_domain_response.rb b/lib/zitadel/client/models/beta_organization_service_add_organization_domain_response.rb index 1cfc07a9..b59c945b 100644 --- a/lib/zitadel/client/models/beta_organization_service_add_organization_domain_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_add_organization_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceAddOrganizationDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceAddOrganizationDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceAddOrganizationDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceAddOrganizationDomainResponse. + class BetaOrganizationServiceAddOrganizationDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_admin.rb b/lib/zitadel/client/models/beta_organization_service_admin.rb index 37cf7944..61ee231e 100644 --- a/lib/zitadel/client/models/beta_organization_service_admin.rb +++ b/lib/zitadel/client/models/beta_organization_service_admin.rb @@ -1,237 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # The Admin for the newly created Organization. - class BetaOrganizationServiceAdmin - # specify Organization Member Roles for the provided user (default is ORG_OWNER if roles are empty) - attr_accessor :roles - - attr_accessor :human - - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'roles' => :'roles', - :'human' => :'human', - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'roles' => :'Array', - :'human' => :'BetaOrganizationServiceAddHumanUserRequest', - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceAdmin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - - if attributes.key?(:'human') - self.human = attributes[:'human'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - roles == o.roles && - human == o.human && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [roles, human, user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # The Admin for the newly created Organization. + class BetaOrganizationServiceAdmin < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + roles: 'roles', + human: 'human', + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + roles: 'Array', + human: 'BetaOrganizationServiceAddHumanUserRequest', + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # specify Organization Member Roles for the provided user (default is ORG_OWNER if roles are empty) + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) + # @example null + attribute :human, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_any.rb b/lib/zitadel/client/models/beta_organization_service_any.rb index f5903dd3..9df9ad52 100644 --- a/lib/zitadel/client/models/beta_organization_service_any.rb +++ b/lib/zitadel/client/models/beta_organization_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaOrganizationServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaOrganizationServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_assigned_admin.rb b/lib/zitadel/client/models/beta_organization_service_assigned_admin.rb index 90485499..a0d83df1 100644 --- a/lib/zitadel/client/models/beta_organization_service_assigned_admin.rb +++ b/lib/zitadel/client/models/beta_organization_service_assigned_admin.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceAssignedAdmin - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceAssignedAdmin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceAssignedAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceAssignedAdmin. + class BetaOrganizationServiceAssignedAdmin < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_connect_error.rb b/lib/zitadel/client/models/beta_organization_service_connect_error.rb index 3fdd38ef..8ba54ac0 100644 --- a/lib/zitadel/client/models/beta_organization_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_organization_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaOrganizationServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaOrganizationServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_create_organization_request.rb b/lib/zitadel/client/models/beta_organization_service_create_organization_request.rb index 6e4aa0a1..e03961e2 100644 --- a/lib/zitadel/client/models/beta_organization_service_create_organization_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_create_organization_request.rb @@ -1,239 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceCreateOrganizationRequest - # name of the Organization to be created. - attr_accessor :name - - # Optionally set your own id unique for the organization. - attr_accessor :id - - # Additional Admins for the Organization. - attr_accessor :admins - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'id' => :'id', - :'admins' => :'admins' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'id' => :'String', - :'admins' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceCreateOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceCreateOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'admins') - if (value = attributes[:'admins']).is_a?(Array) - self.admins = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - id == o.id && - admins == o.admins - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, id, admins].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceCreateOrganizationRequest. + class BetaOrganizationServiceCreateOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + id: 'id', + admins: 'admins' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + id: 'String', + admins: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # name of the Organization to be created. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # Optionally set your own id unique for the organization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Additional Admins for the Organization. + # @example null + attribute :admins, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_create_organization_response.rb b/lib/zitadel/client/models/beta_organization_service_create_organization_response.rb index 317955c8..32fb0641 100644 --- a/lib/zitadel/client/models/beta_organization_service_create_organization_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_create_organization_response.rb @@ -1,238 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceCreateOrganizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Organization ID of the newly created organization. - attr_accessor :id - - # The admins created/assigned for the Organization - attr_accessor :organization_admins - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'id' => :'id', - :'organization_admins' => :'organizationAdmins' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'id' => :'String', - :'organization_admins' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceCreateOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceCreateOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'organization_admins') - if (value = attributes[:'organization_admins']).is_a?(Array) - self.organization_admins = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - id == o.id && - organization_admins == o.organization_admins - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, id, organization_admins].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceCreateOrganizationResponse. + class BetaOrganizationServiceCreateOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + id: 'id', + organization_admins: 'organizationAdmins' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + id: 'String', + organization_admins: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # Organization ID of the newly created organization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # The admins created/assigned for the Organization + # @example null + attribute :organization_admins, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_created_admin.rb b/lib/zitadel/client/models/beta_organization_service_created_admin.rb index 728403e6..379cc874 100644 --- a/lib/zitadel/client/models/beta_organization_service_created_admin.rb +++ b/lib/zitadel/client/models/beta_organization_service_created_admin.rb @@ -1,235 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceCreatedAdmin - attr_accessor :user_id - - attr_accessor :email_code - - attr_accessor :phone_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'email_code' => :'emailCode', - :'phone_code' => :'phoneCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'email_code' => :'String', - :'phone_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_code', - :'phone_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceCreatedAdmin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceCreatedAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'email_code') - self.email_code = attributes[:'email_code'] - end - - if attributes.key?(:'phone_code') - self.phone_code = attributes[:'phone_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - email_code == o.email_code && - phone_code == o.phone_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, email_code, phone_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceCreatedAdmin. + class BetaOrganizationServiceCreatedAdmin < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + email_code: 'emailCode', + phone_code: 'phoneCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + email_code: 'String', + phone_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_deactivate_organization_request.rb b/lib/zitadel/client/models/beta_organization_service_deactivate_organization_request.rb index f683e180..ecf4e593 100644 --- a/lib/zitadel/client/models/beta_organization_service_deactivate_organization_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_deactivate_organization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceDeactivateOrganizationRequest - # Organization Id for the Organization to be deactivated - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDeactivateOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDeactivateOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceDeactivateOrganizationRequest. + class BetaOrganizationServiceDeactivateOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization to be deactivated + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_deactivate_organization_response.rb b/lib/zitadel/client/models/beta_organization_service_deactivate_organization_response.rb index 35caac02..b6314f6f 100644 --- a/lib/zitadel/client/models/beta_organization_service_deactivate_organization_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_deactivate_organization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceDeactivateOrganizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDeactivateOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDeactivateOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceDeactivateOrganizationResponse. + class BetaOrganizationServiceDeactivateOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_delete_organization_domain_request.rb b/lib/zitadel/client/models/beta_organization_service_delete_organization_domain_request.rb index d6a8816e..9d86efc0 100644 --- a/lib/zitadel/client/models/beta_organization_service_delete_organization_domain_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_delete_organization_domain_request.rb @@ -1,225 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceDeleteOrganizationDomainRequest - # Organization Id for the Organization which domain is to be deleted. - attr_accessor :organization_id - - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceDeleteOrganizationDomainRequest. + class BetaOrganizationServiceDeleteOrganizationDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization which domain is to be deleted. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_delete_organization_domain_response.rb b/lib/zitadel/client/models/beta_organization_service_delete_organization_domain_response.rb index f49d3617..2ccd4776 100644 --- a/lib/zitadel/client/models/beta_organization_service_delete_organization_domain_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_delete_organization_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceDeleteOrganizationDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceDeleteOrganizationDomainResponse. + class BetaOrganizationServiceDeleteOrganizationDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_request.rb b/lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_request.rb index bfed5102..8294c6be 100644 --- a/lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_request.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceDeleteOrganizationMetadataRequest - # Organization ID of Orgalization which metadata is to be deleted is stored on. - attr_accessor :organization_id - - # The keys for the Organization metadata to be deleted. - attr_accessor :keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'keys' => :'keys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationMetadataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'keys') - if (value = attributes[:'keys']).is_a?(Array) - self.keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - keys == o.keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceDeleteOrganizationMetadataRequest. + class BetaOrganizationServiceDeleteOrganizationMetadataRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + keys: 'keys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization ID of Orgalization which metadata is to be deleted is stored on. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # The keys for the Organization metadata to be deleted. + # @example null + attribute :keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_response.rb b/lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_response.rb index 60949aff..a4721e30 100644 --- a/lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_delete_organization_metadata_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceDeleteOrganizationMetadataResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceDeleteOrganizationMetadataResponse. + class BetaOrganizationServiceDeleteOrganizationMetadataResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_delete_organization_request.rb b/lib/zitadel/client/models/beta_organization_service_delete_organization_request.rb index afbd1e70..588b6a79 100644 --- a/lib/zitadel/client/models/beta_organization_service_delete_organization_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_delete_organization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceDeleteOrganizationRequest - # Organization Id for the Organization to be deleted - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceDeleteOrganizationRequest. + class BetaOrganizationServiceDeleteOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization to be deleted + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_delete_organization_response.rb b/lib/zitadel/client/models/beta_organization_service_delete_organization_response.rb index d208f0f7..73a1878a 100644 --- a/lib/zitadel/client/models/beta_organization_service_delete_organization_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_delete_organization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceDeleteOrganizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDeleteOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceDeleteOrganizationResponse. + class BetaOrganizationServiceDeleteOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_domain.rb b/lib/zitadel/client/models/beta_organization_service_domain.rb index c4507e41..cae4cce6 100644 --- a/lib/zitadel/client/models/beta_organization_service_domain.rb +++ b/lib/zitadel/client/models/beta_organization_service_domain.rb @@ -1,278 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # from proto/zitadel/org.proto - class BetaOrganizationServiceDomain - # The Organization id. - attr_accessor :organization_id - - # The domain name. - attr_accessor :domain_name - - # Defines if the domain is verified. - attr_accessor :is_verified - - # Defines if the domain is the primary domain. - attr_accessor :is_primary - - attr_accessor :validation_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain_name' => :'domainName', - :'is_verified' => :'isVerified', - :'is_primary' => :'isPrimary', - :'validation_type' => :'validationType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain_name' => :'String', - :'is_verified' => :'Boolean', - :'is_primary' => :'Boolean', - :'validation_type' => :'BetaOrganizationServiceDomainValidationType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDomain` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDomain`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain_name') - self.domain_name = attributes[:'domain_name'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'is_primary') - self.is_primary = attributes[:'is_primary'] - end - - if attributes.key?(:'validation_type') - self.validation_type = attributes[:'validation_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain_name == o.domain_name && - is_verified == o.is_verified && - is_primary == o.is_primary && - validation_type == o.validation_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain_name, is_verified, is_primary, validation_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # from proto/zitadel/org.proto + class BetaOrganizationServiceDomain < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain_name: 'domainName', + is_verified: 'isVerified', + is_primary: 'isPrimary', + validation_type: 'validationType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain_name: 'String', + is_verified: 'Boolean', + is_primary: 'Boolean', + validation_type: 'BetaOrganizationServiceDomainValidationType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The Organization id. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # The domain name. + # @example null + attribute :domain_name, Types::Any.optional.meta(omittable: true) + # Defines if the domain is verified. + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # Defines if the domain is the primary domain. + # @example null + attribute :is_primary, Types::Any.optional.meta(omittable: true) + # @example null + attribute :validation_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_domain_name_filter.rb b/lib/zitadel/client/models/beta_organization_service_domain_name_filter.rb index 82650400..4cade481 100644 --- a/lib/zitadel/client/models/beta_organization_service_domain_name_filter.rb +++ b/lib/zitadel/client/models/beta_organization_service_domain_name_filter.rb @@ -1,248 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # from proto/zitadel/org.proto - class BetaOrganizationServiceDomainNameFilter - # The domain. - attr_accessor :name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'method' => :'BetaOrganizationServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDomainNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDomainNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # from proto/zitadel/org.proto + class BetaOrganizationServiceDomainNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + method: 'BetaOrganizationServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The domain. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_domain_search_filter.rb b/lib/zitadel/client/models/beta_organization_service_domain_search_filter.rb index ee130756..f04501af 100644 --- a/lib/zitadel/client/models/beta_organization_service_domain_search_filter.rb +++ b/lib/zitadel/client/models/beta_organization_service_domain_search_filter.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # from proto/zitadel/org.proto - class BetaOrganizationServiceDomainSearchFilter - attr_accessor :domain_name_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain_name_filter' => :'domainNameFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain_name_filter' => :'BetaOrganizationServiceDomainNameFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceDomainSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceDomainSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain_name_filter') - self.domain_name_filter = attributes[:'domain_name_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain_name_filter == o.domain_name_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain_name_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # from proto/zitadel/org.proto + class BetaOrganizationServiceDomainSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain_name_filter: 'domainNameFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain_name_filter: 'BetaOrganizationServiceDomainNameFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain_name_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_domain_validation_type.rb b/lib/zitadel/client/models/beta_organization_service_domain_validation_type.rb index 1b8404a8..58c89db0 100644 --- a/lib/zitadel/client/models/beta_organization_service_domain_validation_type.rb +++ b/lib/zitadel/client/models/beta_organization_service_domain_validation_type.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaOrganizationServiceDomainValidationType - DOMAIN_VALIDATION_TYPE_UNSPECIFIED = "DOMAIN_VALIDATION_TYPE_UNSPECIFIED".freeze - DOMAIN_VALIDATION_TYPE_HTTP = "DOMAIN_VALIDATION_TYPE_HTTP".freeze - DOMAIN_VALIDATION_TYPE_DNS = "DOMAIN_VALIDATION_TYPE_DNS".freeze - - def self.all_vars - @all_vars ||= [DOMAIN_VALIDATION_TYPE_UNSPECIFIED, DOMAIN_VALIDATION_TYPE_HTTP, DOMAIN_VALIDATION_TYPE_DNS].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaOrganizationServiceDomainValidationType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaOrganizationServiceDomainValidationType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaOrganizationServiceDomainValidationType. + class BetaOrganizationServiceDomainValidationType + DOMAIN_VALIDATION_TYPE_UNSPECIFIED = 'DOMAIN_VALIDATION_TYPE_UNSPECIFIED' + DOMAIN_VALIDATION_TYPE_HTTP = 'DOMAIN_VALIDATION_TYPE_HTTP' + DOMAIN_VALIDATION_TYPE_DNS = 'DOMAIN_VALIDATION_TYPE_DNS' + + # Frozen set of all allowed values, used for validation. + VALUES = [DOMAIN_VALIDATION_TYPE_UNSPECIFIED, DOMAIN_VALIDATION_TYPE_HTTP, DOMAIN_VALIDATION_TYPE_DNS].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaOrganizationServiceDomainValidationType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_organization_service_gender.rb b/lib/zitadel/client/models/beta_organization_service_gender.rb index 151371f5..95c45cf5 100644 --- a/lib/zitadel/client/models/beta_organization_service_gender.rb +++ b/lib/zitadel/client/models/beta_organization_service_gender.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaOrganizationServiceGender - GENDER_UNSPECIFIED = "GENDER_UNSPECIFIED".freeze - GENDER_FEMALE = "GENDER_FEMALE".freeze - GENDER_MALE = "GENDER_MALE".freeze - GENDER_DIVERSE = "GENDER_DIVERSE".freeze - - def self.all_vars - @all_vars ||= [GENDER_UNSPECIFIED, GENDER_FEMALE, GENDER_MALE, GENDER_DIVERSE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaOrganizationServiceGender.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaOrganizationServiceGender" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaOrganizationServiceGender. + class BetaOrganizationServiceGender + GENDER_UNSPECIFIED = 'GENDER_UNSPECIFIED' + GENDER_FEMALE = 'GENDER_FEMALE' + GENDER_MALE = 'GENDER_MALE' + GENDER_DIVERSE = 'GENDER_DIVERSE' + + # Frozen set of all allowed values, used for validation. + VALUES = [GENDER_UNSPECIFIED, GENDER_FEMALE, GENDER_MALE, GENDER_DIVERSE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaOrganizationServiceGender: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_request.rb b/lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_request.rb index 1d082815..0de4e6cd 100644 --- a/lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_request.rb @@ -1,257 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceGenerateOrganizationDomainValidationRequest - # Organization Id for the Organization which doman to be validated. - attr_accessor :organization_id - - # The domain which to be deleted. - attr_accessor :domain - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain' => :'domain', - :'type' => :'type' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain' => :'String', - :'type' => :'BetaOrganizationServiceDomainValidationType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceGenerateOrganizationDomainValidationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceGenerateOrganizationDomainValidationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain == o.domain && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain, type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceGenerateOrganizationDomainValidationRequest. + class BetaOrganizationServiceGenerateOrganizationDomainValidationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain: 'domain', + type: 'type' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain: 'String', + type: 'BetaOrganizationServiceDomainValidationType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization which doman to be validated. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # The domain which to be deleted. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_response.rb b/lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_response.rb index 62d86e90..327da665 100644 --- a/lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceGenerateOrganizationDomainValidationResponse - # The token verify domain. - attr_accessor :token - - # URL used to verify the domain. - attr_accessor :url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'token' => :'token', - :'url' => :'url' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'token' => :'String', - :'url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceGenerateOrganizationDomainValidationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceGenerateOrganizationDomainValidationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'token') - self.token = attributes[:'token'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - token == o.token && - url == o.url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [token, url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceGenerateOrganizationDomainValidationResponse. + class BetaOrganizationServiceGenerateOrganizationDomainValidationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + token: 'token', + url: 'url' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + token: 'String', + url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The token verify domain. + # @example null + attribute :token, Types::Any.optional.meta(omittable: true) + # URL used to verify the domain. + # @example null + attribute :url, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_hashed_password.rb b/lib/zitadel/client/models/beta_organization_service_hashed_password.rb index bb98e219..c0f82dfe 100644 --- a/lib/zitadel/client/models/beta_organization_service_hashed_password.rb +++ b/lib/zitadel/client/models/beta_organization_service_hashed_password.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceHashedPassword - attr_accessor :hash - - attr_accessor :change_required - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'hash' => :'hash', - :'change_required' => :'changeRequired' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'hash' => :'String', - :'change_required' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceHashedPassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceHashedPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'hash') - self.hash = attributes[:'hash'] - end - - if attributes.key?(:'change_required') - self.change_required = attributes[:'change_required'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - hash == o.hash && - change_required == o.change_required - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [hash, change_required].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceHashedPassword. + class BetaOrganizationServiceHashedPassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + hash: 'hash', + change_required: 'changeRequired' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + hash: 'String', + change_required: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :hash, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_required, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_i_d_p_link.rb b/lib/zitadel/client/models/beta_organization_service_i_d_p_link.rb deleted file mode 100644 index 2244aba4..00000000 --- a/lib/zitadel/client/models/beta_organization_service_i_d_p_link.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceIDPLink - attr_accessor :idp_id - - attr_accessor :user_id - - attr_accessor :user_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_id' => :'idpId', - :'user_id' => :'userId', - :'user_name' => :'userName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_id' => :'String', - :'user_id' => :'String', - :'user_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceIDPLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceIDPLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_id == o.idp_id && - user_id == o.user_id && - user_name == o.user_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_id, user_id, user_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_organization_service_idp_link.rb b/lib/zitadel/client/models/beta_organization_service_idp_link.rb new file mode 100644 index 00000000..de54f7e1 --- /dev/null +++ b/lib/zitadel/client/models/beta_organization_service_idp_link.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceIDPLink. + class BetaOrganizationServiceIDPLink < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_id: 'idpId', + user_id: 'userId', + user_name: 'userName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_id: 'String', + user_id: 'String', + user_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_name, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_organization_service_list_organization_domains_request.rb b/lib/zitadel/client/models/beta_organization_service_list_organization_domains_request.rb index 02804598..71754d54 100644 --- a/lib/zitadel/client/models/beta_organization_service_list_organization_domains_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_list_organization_domains_request.rb @@ -1,237 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceListOrganizationDomainsRequest - # Organization Id for the Organization which domains are to be listed. - attr_accessor :organization_id - - attr_accessor :pagination - - # Define the criteria to query for. - attr_accessor :filters - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'pagination' => :'pagination', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'pagination' => :'BetaOrganizationServicePaginationRequest', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationDomainsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationDomainsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - pagination == o.pagination && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, pagination, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceListOrganizationDomainsRequest. + class BetaOrganizationServiceListOrganizationDomainsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + pagination: 'pagination', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + pagination: 'BetaOrganizationServicePaginationRequest', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization which domains are to be listed. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_list_organization_domains_response.rb b/lib/zitadel/client/models/beta_organization_service_list_organization_domains_response.rb index 9519bed9..30cd20fd 100644 --- a/lib/zitadel/client/models/beta_organization_service_list_organization_domains_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_list_organization_domains_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceListOrganizationDomainsResponse - attr_accessor :pagination - - # The domains requested. - attr_accessor :domains - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'domains' => :'domains' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaOrganizationServicePaginationResponse', - :'domains' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationDomainsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationDomainsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'domains') - if (value = attributes[:'domains']).is_a?(Array) - self.domains = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - domains == o.domains - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, domains].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceListOrganizationDomainsResponse. + class BetaOrganizationServiceListOrganizationDomainsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + domains: 'domains' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaOrganizationServicePaginationResponse', + domains: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # The domains requested. + # @example null + attribute :domains, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_list_organization_metadata_request.rb b/lib/zitadel/client/models/beta_organization_service_list_organization_metadata_request.rb index 222efa0d..fcc3c53b 100644 --- a/lib/zitadel/client/models/beta_organization_service_list_organization_metadata_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_list_organization_metadata_request.rb @@ -1,237 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceListOrganizationMetadataRequest - # Organization ID of Orgalization which metadata is to be listed. - attr_accessor :organization_id - - attr_accessor :pagination - - # Define the criteria to query for. - attr_accessor :filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'pagination' => :'pagination', - :'filter' => :'filter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'pagination' => :'BetaOrganizationServicePaginationRequest', - :'filter' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationMetadataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'filter') - if (value = attributes[:'filter']).is_a?(Array) - self.filter = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - pagination == o.pagination && - filter == o.filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, pagination, filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceListOrganizationMetadataRequest. + class BetaOrganizationServiceListOrganizationMetadataRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + pagination: 'pagination', + filter: 'filter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + pagination: 'BetaOrganizationServicePaginationRequest', + filter: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization ID of Orgalization which metadata is to be listed. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_list_organization_metadata_response.rb b/lib/zitadel/client/models/beta_organization_service_list_organization_metadata_response.rb index 03a5ec07..60fd7f7f 100644 --- a/lib/zitadel/client/models/beta_organization_service_list_organization_metadata_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_list_organization_metadata_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceListOrganizationMetadataResponse - attr_accessor :pagination - - # The Organization metadata requested. - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'metadata' => :'metadata' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaOrganizationServicePaginationResponse', - :'metadata' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, metadata].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceListOrganizationMetadataResponse. + class BetaOrganizationServiceListOrganizationMetadataResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + metadata: 'metadata' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaOrganizationServicePaginationResponse', + metadata: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # The Organization metadata requested. + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_list_organizations_request.rb b/lib/zitadel/client/models/beta_organization_service_list_organizations_request.rb index 75599f06..3b023c65 100644 --- a/lib/zitadel/client/models/beta_organization_service_list_organizations_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_list_organizations_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceListOrganizationsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. repeated ProjectRoleQuery filters = 4; - attr_accessor :filter - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filter' => :'filter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaOrganizationServicePaginationRequest', - :'sorting_column' => :'BetaOrganizationServiceOrgFieldName', - :'filter' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filter') - if (value = attributes[:'filter']).is_a?(Array) - self.filter = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filter == o.filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceListOrganizationsRequest. + class BetaOrganizationServiceListOrganizationsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filter: 'filter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaOrganizationServicePaginationRequest', + sorting_column: 'BetaOrganizationServiceOrgFieldName', + filter: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. repeated ProjectRoleQuery filters = 4; + # @example null + attribute :filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_list_organizations_response.rb b/lib/zitadel/client/models/beta_organization_service_list_organizations_response.rb index 4b36095b..59b08991 100644 --- a/lib/zitadel/client/models/beta_organization_service_list_organizations_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_list_organizations_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceListOrganizationsResponse - attr_accessor :pagination - - # The Organizations requested - attr_accessor :organizations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'organizations' => :'organizations' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaOrganizationServicePaginationResponse', - :'organizations' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceListOrganizationsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'organizations') - if (value = attributes[:'organizations']).is_a?(Array) - self.organizations = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - organizations == o.organizations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, organizations].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceListOrganizationsResponse. + class BetaOrganizationServiceListOrganizationsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + organizations: 'organizations' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaOrganizationServicePaginationResponse', + organizations: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # The Organizations requested + # @example null + attribute :organizations, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_metadata.rb b/lib/zitadel/client/models/beta_organization_service_metadata.rb index 176b2219..3d3183a8 100644 --- a/lib/zitadel/client/models/beta_organization_service_metadata.rb +++ b/lib/zitadel/client/models/beta_organization_service_metadata.rb @@ -1,226 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceMetadata - # Key in the metadata key/value pair. - attr_accessor :key - - # Value in the metadata key/value pair. - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'value' => :'value' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, value].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceMetadata. + class BetaOrganizationServiceMetadata < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + value: 'value' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + value: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + value: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Key in the metadata key/value pair. + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # Value in the metadata key/value pair. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_metadata_key_query.rb b/lib/zitadel/client/models/beta_organization_service_metadata_key_query.rb index bcd5852d..136761fc 100644 --- a/lib/zitadel/client/models/beta_organization_service_metadata_key_query.rb +++ b/lib/zitadel/client/models/beta_organization_service_metadata_key_query.rb @@ -1,246 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceMetadataKeyQuery - attr_accessor :key - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'method' => :'BetaOrganizationServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceMetadataKeyQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceMetadataKeyQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceMetadataKeyQuery. + class BetaOrganizationServiceMetadataKeyQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + method: 'BetaOrganizationServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_metadata_query.rb b/lib/zitadel/client/models/beta_organization_service_metadata_query.rb index ed48ccc0..894a4c82 100644 --- a/lib/zitadel/client/models/beta_organization_service_metadata_query.rb +++ b/lib/zitadel/client/models/beta_organization_service_metadata_query.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceMetadataQuery - attr_accessor :key_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_query' => :'keyQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_query' => :'BetaOrganizationServiceMetadataKeyQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceMetadataQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceMetadataQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_query') - self.key_query = attributes[:'key_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_query == o.key_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceMetadataQuery. + class BetaOrganizationServiceMetadataQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_query: 'keyQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_query: 'BetaOrganizationServiceMetadataKeyQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_org_domain_filter.rb b/lib/zitadel/client/models/beta_organization_service_org_domain_filter.rb index 0a43ef67..1c204947 100644 --- a/lib/zitadel/client/models/beta_organization_service_org_domain_filter.rb +++ b/lib/zitadel/client/models/beta_organization_service_org_domain_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceOrgDomainFilter - # The domain. - attr_accessor :domain - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain' => :'domain', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain' => :'String', - :'method' => :'BetaOrganizationServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceOrgDomainFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceOrgDomainFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain == o.domain && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceOrgDomainFilter. + class BetaOrganizationServiceOrgDomainFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain: 'domain', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain: 'String', + method: 'BetaOrganizationServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The domain. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_org_field_name.rb b/lib/zitadel/client/models/beta_organization_service_org_field_name.rb index 5f0997b9..39068068 100644 --- a/lib/zitadel/client/models/beta_organization_service_org_field_name.rb +++ b/lib/zitadel/client/models/beta_organization_service_org_field_name.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaOrganizationServiceOrgFieldName - ORG_FIELD_NAME_UNSPECIFIED = "ORG_FIELD_NAME_UNSPECIFIED".freeze - ORG_FIELD_NAME_NAME = "ORG_FIELD_NAME_NAME".freeze - ORG_FIELD_NAME_CREATION_DATE = "ORG_FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [ORG_FIELD_NAME_UNSPECIFIED, ORG_FIELD_NAME_NAME, ORG_FIELD_NAME_CREATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaOrganizationServiceOrgFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaOrganizationServiceOrgFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaOrganizationServiceOrgFieldName. + class BetaOrganizationServiceOrgFieldName + ORG_FIELD_NAME_UNSPECIFIED = 'ORG_FIELD_NAME_UNSPECIFIED' + ORG_FIELD_NAME_NAME = 'ORG_FIELD_NAME_NAME' + ORG_FIELD_NAME_CREATION_DATE = 'ORG_FIELD_NAME_CREATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [ORG_FIELD_NAME_UNSPECIFIED, ORG_FIELD_NAME_NAME, ORG_FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaOrganizationServiceOrgFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_organization_service_org_i_d_filter.rb b/lib/zitadel/client/models/beta_organization_service_org_i_d_filter.rb deleted file mode 100644 index 89896d1a..00000000 --- a/lib/zitadel/client/models/beta_organization_service_org_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceOrgIDFilter - # The Organization id. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceOrgIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceOrgIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_organization_service_org_id_filter.rb b/lib/zitadel/client/models/beta_organization_service_org_id_filter.rb new file mode 100644 index 00000000..5be73ca3 --- /dev/null +++ b/lib/zitadel/client/models/beta_organization_service_org_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceOrgIDFilter. + class BetaOrganizationServiceOrgIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The Organization id. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_organization_service_org_name_filter.rb b/lib/zitadel/client/models/beta_organization_service_org_name_filter.rb index b53c0094..14a83a13 100644 --- a/lib/zitadel/client/models/beta_organization_service_org_name_filter.rb +++ b/lib/zitadel/client/models/beta_organization_service_org_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceOrgNameFilter - # Organization name. - attr_accessor :name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'method' => :'BetaOrganizationServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceOrgNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceOrgNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceOrgNameFilter. + class BetaOrganizationServiceOrgNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + method: 'BetaOrganizationServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization name. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_org_state.rb b/lib/zitadel/client/models/beta_organization_service_org_state.rb index 74344994..d61353fb 100644 --- a/lib/zitadel/client/models/beta_organization_service_org_state.rb +++ b/lib/zitadel/client/models/beta_organization_service_org_state.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaOrganizationServiceOrgState - ORG_STATE_UNSPECIFIED = "ORG_STATE_UNSPECIFIED".freeze - ORG_STATE_ACTIVE = "ORG_STATE_ACTIVE".freeze - ORG_STATE_INACTIVE = "ORG_STATE_INACTIVE".freeze - ORG_STATE_REMOVED = "ORG_STATE_REMOVED".freeze - - def self.all_vars - @all_vars ||= [ORG_STATE_UNSPECIFIED, ORG_STATE_ACTIVE, ORG_STATE_INACTIVE, ORG_STATE_REMOVED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaOrganizationServiceOrgState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaOrganizationServiceOrgState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaOrganizationServiceOrgState. + class BetaOrganizationServiceOrgState + ORG_STATE_UNSPECIFIED = 'ORG_STATE_UNSPECIFIED' + ORG_STATE_ACTIVE = 'ORG_STATE_ACTIVE' + ORG_STATE_INACTIVE = 'ORG_STATE_INACTIVE' + ORG_STATE_REMOVED = 'ORG_STATE_REMOVED' + + # Frozen set of all allowed values, used for validation. + VALUES = [ORG_STATE_UNSPECIFIED, ORG_STATE_ACTIVE, ORG_STATE_INACTIVE, ORG_STATE_REMOVED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaOrganizationServiceOrgState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_organization_service_org_state_filter.rb b/lib/zitadel/client/models/beta_organization_service_org_state_filter.rb index aa6c21f3..0aea72dc 100644 --- a/lib/zitadel/client/models/beta_organization_service_org_state_filter.rb +++ b/lib/zitadel/client/models/beta_organization_service_org_state_filter.rb @@ -1,237 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceOrgStateFilter - attr_accessor :state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'state' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'BetaOrganizationServiceOrgState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceOrgStateFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceOrgStateFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceOrgStateFilter. + class BetaOrganizationServiceOrgStateFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + state: 'state' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + state: 'BetaOrganizationServiceOrgState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_organization.rb b/lib/zitadel/client/models/beta_organization_service_organization.rb index 9e29a809..e7fa0e8c 100644 --- a/lib/zitadel/client/models/beta_organization_service_organization.rb +++ b/lib/zitadel/client/models/beta_organization_service_organization.rb @@ -1,287 +1,98 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceOrganization - # Unique identifier of the organization. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :changed_date - - attr_accessor :state - - # Name of the organization. - attr_accessor :name - - # Primary domain used in the organization. - attr_accessor :primary_domain - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'changed_date' => :'changedDate', - :'state' => :'state', - :'name' => :'name', - :'primary_domain' => :'primaryDomain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'changed_date' => :'Time', - :'state' => :'BetaOrganizationServiceOrgState', - :'name' => :'String', - :'primary_domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceOrganization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'changed_date') - self.changed_date = attributes[:'changed_date'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'primary_domain') - self.primary_domain = attributes[:'primary_domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - changed_date == o.changed_date && - state == o.state && - name == o.name && - primary_domain == o.primary_domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, changed_date, state, name, primary_domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceOrganization. + class BetaOrganizationServiceOrganization < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + changed_date: 'changedDate', + state: 'state', + name: 'name', + primary_domain: 'primaryDomain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + changed_date: 'Time', + state: 'BetaOrganizationServiceOrgState', + name: 'String', + primary_domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Unique identifier of the organization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :changed_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # Name of the organization. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # Primary domain used in the organization. + # @example null + attribute :primary_domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_organization_admin.rb b/lib/zitadel/client/models/beta_organization_service_organization_admin.rb index 8a01c7da..c6c7f264 100644 --- a/lib/zitadel/client/models/beta_organization_service_organization_admin.rb +++ b/lib/zitadel/client/models/beta_organization_service_organization_admin.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceOrganizationAdmin - attr_accessor :assigned_admin - - attr_accessor :created_admin - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'assigned_admin' => :'assignedAdmin', - :'created_admin' => :'createdAdmin' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'assigned_admin' => :'BetaOrganizationServiceAssignedAdmin', - :'created_admin' => :'BetaOrganizationServiceCreatedAdmin' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceOrganizationAdmin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceOrganizationAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'assigned_admin') - self.assigned_admin = attributes[:'assigned_admin'] - end - - if attributes.key?(:'created_admin') - self.created_admin = attributes[:'created_admin'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - assigned_admin == o.assigned_admin && - created_admin == o.created_admin - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [assigned_admin, created_admin].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceOrganizationAdmin. + class BetaOrganizationServiceOrganizationAdmin < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + assigned_admin: 'assignedAdmin', + created_admin: 'createdAdmin' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + assigned_admin: 'BetaOrganizationServiceAssignedAdmin', + created_admin: 'BetaOrganizationServiceCreatedAdmin' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :assigned_admin, Types::Any.optional.meta(omittable: true) + # @example null + attribute :created_admin, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_organization_search_filter.rb b/lib/zitadel/client/models/beta_organization_service_organization_search_filter.rb index 0ee59e1e..3ba64677 100644 --- a/lib/zitadel/client/models/beta_organization_service_organization_search_filter.rb +++ b/lib/zitadel/client/models/beta_organization_service_organization_search_filter.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceOrganizationSearchFilter - attr_accessor :domain_filter - - attr_accessor :id_filter - - attr_accessor :name_filter - - attr_accessor :state_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain_filter' => :'domainFilter', - :'id_filter' => :'idFilter', - :'name_filter' => :'nameFilter', - :'state_filter' => :'stateFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain_filter' => :'BetaOrganizationServiceOrgDomainFilter', - :'id_filter' => :'BetaOrganizationServiceOrgIDFilter', - :'name_filter' => :'BetaOrganizationServiceOrgNameFilter', - :'state_filter' => :'BetaOrganizationServiceOrgStateFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceOrganizationSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceOrganizationSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain_filter') - self.domain_filter = attributes[:'domain_filter'] - end - - if attributes.key?(:'id_filter') - self.id_filter = attributes[:'id_filter'] - end - - if attributes.key?(:'name_filter') - self.name_filter = attributes[:'name_filter'] - end - - if attributes.key?(:'state_filter') - self.state_filter = attributes[:'state_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain_filter == o.domain_filter && - id_filter == o.id_filter && - name_filter == o.name_filter && - state_filter == o.state_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain_filter, id_filter, name_filter, state_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceOrganizationSearchFilter. + class BetaOrganizationServiceOrganizationSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain_filter: 'domainFilter', + id_filter: 'idFilter', + name_filter: 'nameFilter', + state_filter: 'stateFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain_filter: 'BetaOrganizationServiceOrgDomainFilter', + id_filter: 'BetaOrganizationServiceOrgIDFilter', + name_filter: 'BetaOrganizationServiceOrgNameFilter', + state_filter: 'BetaOrganizationServiceOrgStateFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_pagination_request.rb b/lib/zitadel/client/models/beta_organization_service_pagination_request.rb index e7418c14..3ce6a02b 100644 --- a/lib/zitadel/client/models/beta_organization_service_pagination_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServicePaginationRequest. + class BetaOrganizationServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_pagination_response.rb b/lib/zitadel/client/models/beta_organization_service_pagination_response.rb index b66b901b..17f9616d 100644 --- a/lib/zitadel/client/models/beta_organization_service_pagination_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServicePaginationResponse. + class BetaOrganizationServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_password.rb b/lib/zitadel/client/models/beta_organization_service_password.rb index 89980b70..6ef2ff65 100644 --- a/lib/zitadel/client/models/beta_organization_service_password.rb +++ b/lib/zitadel/client/models/beta_organization_service_password.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServicePassword - attr_accessor :password - - attr_accessor :change_required - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'password' => :'password', - :'change_required' => :'changeRequired' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'password' => :'String', - :'change_required' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServicePassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServicePassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'change_required') - self.change_required = attributes[:'change_required'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - password == o.password && - change_required == o.change_required - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [password, change_required].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServicePassword. + class BetaOrganizationServicePassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + password: 'password', + change_required: 'changeRequired' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + password: 'String', + change_required: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_required, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_send_email_verification_code.rb b/lib/zitadel/client/models/beta_organization_service_send_email_verification_code.rb index 8eab8960..838e3907 100644 --- a/lib/zitadel/client/models/beta_organization_service_send_email_verification_code.rb +++ b/lib/zitadel/client/models/beta_organization_service_send_email_verification_code.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceSendEmailVerificationCode - attr_accessor :url_template - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceSendEmailVerificationCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceSendEmailVerificationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceSendEmailVerificationCode. + class BetaOrganizationServiceSendEmailVerificationCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_set_human_email.rb b/lib/zitadel/client/models/beta_organization_service_set_human_email.rb index 2563afb2..d29f4c16 100644 --- a/lib/zitadel/client/models/beta_organization_service_set_human_email.rb +++ b/lib/zitadel/client/models/beta_organization_service_set_human_email.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceSetHumanEmail - attr_accessor :email - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'BetaOrganizationServiceSendEmailVerificationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceSetHumanEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceSetHumanEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceSetHumanEmail. + class BetaOrganizationServiceSetHumanEmail < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + email: 'email', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + email: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'BetaOrganizationServiceSendEmailVerificationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_set_human_phone.rb b/lib/zitadel/client/models/beta_organization_service_set_human_phone.rb index 79c5fe19..18691086 100644 --- a/lib/zitadel/client/models/beta_organization_service_set_human_phone.rb +++ b/lib/zitadel/client/models/beta_organization_service_set_human_phone.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceSetHumanPhone - attr_accessor :phone - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone' => :'phone', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceSetHumanPhone` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceSetHumanPhone`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone == o.phone && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceSetHumanPhone. + class BetaOrganizationServiceSetHumanPhone < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + phone: 'phone', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + phone: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_set_human_profile.rb b/lib/zitadel/client/models/beta_organization_service_set_human_profile.rb index 7d279fac..92210b1b 100644 --- a/lib/zitadel/client/models/beta_organization_service_set_human_profile.rb +++ b/lib/zitadel/client/models/beta_organization_service_set_human_profile.rb @@ -1,285 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceSetHumanProfile - attr_accessor :given_name - - attr_accessor :family_name - - attr_accessor :nick_name - - attr_accessor :display_name - - attr_accessor :preferred_language - - attr_accessor :gender - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'givenName', - :'family_name' => :'familyName', - :'nick_name' => :'nickName', - :'display_name' => :'displayName', - :'preferred_language' => :'preferredLanguage', - :'gender' => :'gender' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'nick_name' => :'String', - :'display_name' => :'String', - :'preferred_language' => :'String', - :'gender' => :'BetaOrganizationServiceGender' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'nick_name', - :'display_name', - :'preferred_language', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceSetHumanProfile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceSetHumanProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'preferred_language') - self.preferred_language = attributes[:'preferred_language'] - end - - if attributes.key?(:'gender') - self.gender = attributes[:'gender'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - nick_name == o.nick_name && - display_name == o.display_name && - preferred_language == o.preferred_language && - gender == o.gender - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, nick_name, display_name, preferred_language, gender].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceSetHumanProfile. + class BetaOrganizationServiceSetHumanProfile < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + given_name: 'givenName', + family_name: 'familyName', + nick_name: 'nickName', + display_name: 'displayName', + preferred_language: 'preferredLanguage', + gender: 'gender' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + given_name: 'String', + family_name: 'String', + nick_name: 'String', + display_name: 'String', + preferred_language: 'String', + gender: 'BetaOrganizationServiceGender' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :given_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :family_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :nick_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_language, Types::Any.optional.meta(omittable: true) + # @example null + attribute :gender, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_set_metadata_entry.rb b/lib/zitadel/client/models/beta_organization_service_set_metadata_entry.rb index 7c6731e1..b8a3d2bb 100644 --- a/lib/zitadel/client/models/beta_organization_service_set_metadata_entry.rb +++ b/lib/zitadel/client/models/beta_organization_service_set_metadata_entry.rb @@ -1,224 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceSetMetadataEntry - attr_accessor :key - - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'value' => :'value' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceSetMetadataEntry` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceSetMetadataEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, value].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceSetMetadataEntry. + class BetaOrganizationServiceSetMetadataEntry < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + value: 'value' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + value: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + value: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_set_organization_metadata_request.rb b/lib/zitadel/client/models/beta_organization_service_set_organization_metadata_request.rb index 8bab5caa..5ea238b6 100644 --- a/lib/zitadel/client/models/beta_organization_service_set_organization_metadata_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_set_organization_metadata_request.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceSetOrganizationMetadataRequest - # Organization Id for the Organization doman to be verified. - attr_accessor :organization_id - - # Metadata to set. - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'metadata' => :'metadata' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'metadata' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceSetOrganizationMetadataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceSetOrganizationMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, metadata].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceSetOrganizationMetadataRequest. + class BetaOrganizationServiceSetOrganizationMetadataRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + metadata: 'metadata' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + metadata: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization doman to be verified. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Metadata to set. + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_set_organization_metadata_response.rb b/lib/zitadel/client/models/beta_organization_service_set_organization_metadata_response.rb index 2ba03f60..b7d02001 100644 --- a/lib/zitadel/client/models/beta_organization_service_set_organization_metadata_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_set_organization_metadata_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceSetOrganizationMetadataResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :set_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'set_date' => :'setDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'set_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceSetOrganizationMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceSetOrganizationMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'set_date') - self.set_date = attributes[:'set_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - set_date == o.set_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [set_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceSetOrganizationMetadataResponse. + class BetaOrganizationServiceSetOrganizationMetadataResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + set_date: 'setDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + set_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :set_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_text_query_method.rb b/lib/zitadel/client/models/beta_organization_service_text_query_method.rb index ee8e4fb1..cf6458e3 100644 --- a/lib/zitadel/client/models/beta_organization_service_text_query_method.rb +++ b/lib/zitadel/client/models/beta_organization_service_text_query_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaOrganizationServiceTextQueryMethod - TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS".freeze - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH".freeze - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS".freeze - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH".freeze - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaOrganizationServiceTextQueryMethod. + class BetaOrganizationServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' + TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' + TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaOrganizationServiceTextQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaOrganizationServiceTextQueryMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaOrganizationServiceTextQueryMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_organization_service_update_organization_request.rb b/lib/zitadel/client/models/beta_organization_service_update_organization_request.rb index 9ae851f3..fcada4a2 100644 --- a/lib/zitadel/client/models/beta_organization_service_update_organization_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_update_organization_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceUpdateOrganizationRequest - # Organization Id for the Organization to be updated - attr_accessor :id - - # New Name for the Organization to be updated - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceUpdateOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceUpdateOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceUpdateOrganizationRequest. + class BetaOrganizationServiceUpdateOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization to be updated + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # New Name for the Organization to be updated + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_update_organization_response.rb b/lib/zitadel/client/models/beta_organization_service_update_organization_response.rb index aae4f4dc..d4867ee6 100644 --- a/lib/zitadel/client/models/beta_organization_service_update_organization_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_update_organization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceUpdateOrganizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceUpdateOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceUpdateOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceUpdateOrganizationResponse. + class BetaOrganizationServiceUpdateOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_verify_organization_domain_request.rb b/lib/zitadel/client/models/beta_organization_service_verify_organization_domain_request.rb index a5dbfd3b..fd87c898 100644 --- a/lib/zitadel/client/models/beta_organization_service_verify_organization_domain_request.rb +++ b/lib/zitadel/client/models/beta_organization_service_verify_organization_domain_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceVerifyOrganizationDomainRequest - # Organization Id for the Organization doman to be verified. - attr_accessor :organization_id - - # Organization Id for the Organization doman to be verified. - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceVerifyOrganizationDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceVerifyOrganizationDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceVerifyOrganizationDomainRequest. + class BetaOrganizationServiceVerifyOrganizationDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization Id for the Organization doman to be verified. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Organization Id for the Organization doman to be verified. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_organization_service_verify_organization_domain_response.rb b/lib/zitadel/client/models/beta_organization_service_verify_organization_domain_response.rb index a9af7379..36c4df83 100644 --- a/lib/zitadel/client/models/beta_organization_service_verify_organization_domain_response.rb +++ b/lib/zitadel/client/models/beta_organization_service_verify_organization_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaOrganizationServiceVerifyOrganizationDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaOrganizationServiceVerifyOrganizationDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaOrganizationServiceVerifyOrganizationDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaOrganizationServiceVerifyOrganizationDomainResponse. + class BetaOrganizationServiceVerifyOrganizationDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_activate_project_grant_request.rb b/lib/zitadel/client/models/beta_project_service_activate_project_grant_request.rb index 2d7c918a..c53e9100 100644 --- a/lib/zitadel/client/models/beta_project_service_activate_project_grant_request.rb +++ b/lib/zitadel/client/models/beta_project_service_activate_project_grant_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceActivateProjectGrantRequest - # ID of the project. - attr_accessor :project_id - - # Organization the project is granted to. - attr_accessor :granted_organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceActivateProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceActivateProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceActivateProjectGrantRequest. + class BetaProjectServiceActivateProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Organization the project is granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_activate_project_grant_response.rb b/lib/zitadel/client/models/beta_project_service_activate_project_grant_response.rb index c932d82c..8abb1d70 100644 --- a/lib/zitadel/client/models/beta_project_service_activate_project_grant_response.rb +++ b/lib/zitadel/client/models/beta_project_service_activate_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceActivateProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceActivateProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceActivateProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceActivateProjectGrantResponse. + class BetaProjectServiceActivateProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_activate_project_request.rb b/lib/zitadel/client/models/beta_project_service_activate_project_request.rb index 62db88d5..550ac356 100644 --- a/lib/zitadel/client/models/beta_project_service_activate_project_request.rb +++ b/lib/zitadel/client/models/beta_project_service_activate_project_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceActivateProjectRequest - # The unique identifier of the project. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceActivateProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceActivateProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceActivateProjectRequest. + class BetaProjectServiceActivateProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the project. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_activate_project_response.rb b/lib/zitadel/client/models/beta_project_service_activate_project_response.rb index 133b49aa..9ab5b626 100644 --- a/lib/zitadel/client/models/beta_project_service_activate_project_response.rb +++ b/lib/zitadel/client/models/beta_project_service_activate_project_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceActivateProjectResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceActivateProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceActivateProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceActivateProjectResponse. + class BetaProjectServiceActivateProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_add_project_role_request.rb b/lib/zitadel/client/models/beta_project_service_add_project_role_request.rb index 1d724781..e8d17a8e 100644 --- a/lib/zitadel/client/models/beta_project_service_add_project_role_request.rb +++ b/lib/zitadel/client/models/beta_project_service_add_project_role_request.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceAddProjectRoleRequest - # ID of the project. - attr_accessor :project_id - - # The key is the only relevant attribute for ZITADEL regarding the authorization checks. - attr_accessor :role_key - - # Name displayed for the role. - attr_accessor :display_name - - # The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user. - attr_accessor :group - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'role_key' => :'roleKey', - :'display_name' => :'displayName', - :'group' => :'group' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'role_key' => :'String', - :'display_name' => :'String', - :'group' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'group' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceAddProjectRoleRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceAddProjectRoleRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - role_key == o.role_key && - display_name == o.display_name && - group == o.group - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, role_key, display_name, group].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceAddProjectRoleRequest. + class BetaProjectServiceAddProjectRoleRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + role_key: 'roleKey', + display_name: 'displayName', + group: 'group' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + role_key: 'String', + display_name: 'String', + group: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # The key is the only relevant attribute for ZITADEL regarding the authorization checks. + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) + # Name displayed for the role. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user. + # @example null + attribute :group, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_add_project_role_response.rb b/lib/zitadel/client/models/beta_project_service_add_project_role_response.rb index a9b01402..9fccf7db 100644 --- a/lib/zitadel/client/models/beta_project_service_add_project_role_response.rb +++ b/lib/zitadel/client/models/beta_project_service_add_project_role_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceAddProjectRoleResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceAddProjectRoleResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceAddProjectRoleResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceAddProjectRoleResponse. + class BetaProjectServiceAddProjectRoleResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_admin.rb b/lib/zitadel/client/models/beta_project_service_admin.rb index f5c73d29..33629366 100644 --- a/lib/zitadel/client/models/beta_project_service_admin.rb +++ b/lib/zitadel/client/models/beta_project_service_admin.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceAdmin - attr_accessor :user_id - - # specify the Project Member Roles for the provided user (default is PROJECT_OWNER if roles are empty - attr_accessor :roles - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'roles' => :'roles' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'roles' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceAdmin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - roles == o.roles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, roles].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceAdmin. + class BetaProjectServiceAdmin < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + roles: 'roles' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + roles: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # specify the Project Member Roles for the provided user (default is PROJECT_OWNER if roles are empty + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_any.rb b/lib/zitadel/client/models/beta_project_service_any.rb index 325059b0..0f459784 100644 --- a/lib/zitadel/client/models/beta_project_service_any.rb +++ b/lib/zitadel/client/models/beta_project_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaProjectServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaProjectServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_connect_error.rb b/lib/zitadel/client/models/beta_project_service_connect_error.rb index cf9ae4a1..b4056445 100644 --- a/lib/zitadel/client/models/beta_project_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_project_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaProjectServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaProjectServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_create_project_grant_request.rb b/lib/zitadel/client/models/beta_project_service_create_project_grant_request.rb index fa4a72af..c8a7e3e9 100644 --- a/lib/zitadel/client/models/beta_project_service_create_project_grant_request.rb +++ b/lib/zitadel/client/models/beta_project_service_create_project_grant_request.rb @@ -1,238 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceCreateProjectGrantRequest - # ID of the project. - attr_accessor :project_id - - # Organization the project is granted to. - attr_accessor :granted_organization_id - - # Keys of the role available for the project grant. - attr_accessor :role_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId', - :'role_keys' => :'roleKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String', - :'role_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceCreateProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceCreateProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - - if attributes.key?(:'role_keys') - if (value = attributes[:'role_keys']).is_a?(Array) - self.role_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id && - role_keys == o.role_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id, role_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceCreateProjectGrantRequest. + class BetaProjectServiceCreateProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId', + role_keys: 'roleKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String', + role_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Organization the project is granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) + # Keys of the role available for the project grant. + # @example null + attribute :role_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_create_project_grant_response.rb b/lib/zitadel/client/models/beta_project_service_create_project_grant_response.rb index c41bc315..37181271 100644 --- a/lib/zitadel/client/models/beta_project_service_create_project_grant_response.rb +++ b/lib/zitadel/client/models/beta_project_service_create_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceCreateProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceCreateProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceCreateProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceCreateProjectGrantResponse. + class BetaProjectServiceCreateProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_create_project_request.rb b/lib/zitadel/client/models/beta_project_service_create_project_request.rb index f411d775..dac4f276 100644 --- a/lib/zitadel/client/models/beta_project_service_create_project_request.rb +++ b/lib/zitadel/client/models/beta_project_service_create_project_request.rb @@ -1,310 +1,108 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceCreateProjectRequest - # The unique identifier of the organization the project belongs to. - attr_accessor :organization_id - - # The unique identifier of the project. - attr_accessor :id - - # Name of the project. - attr_accessor :name - - # Enable this setting to provide role information to your application. For OpenID Connect, the roles can be requested from the UserInfo endpoint or sent in the ID or Access Token, based on your application's configuration. - attr_accessor :project_role_assertion - - # Deny authentication if the user has no authorization assigned to this project. Authorizations to the project without assigned a specific role to the user are allowed. - attr_accessor :authorization_required - - # Before a user can be authenticated, it is verified that their affiliated organization has been granted access to this project. Authentication is not permitted for users from unauthorized organizations. - attr_accessor :project_access_required - - attr_accessor :private_labeling_setting - - # List of users and Project Member roles (PROJECT_OWNER, by default) to be assigned to those users. - attr_accessor :admins - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'id' => :'id', - :'name' => :'name', - :'project_role_assertion' => :'projectRoleAssertion', - :'authorization_required' => :'authorizationRequired', - :'project_access_required' => :'projectAccessRequired', - :'private_labeling_setting' => :'privateLabelingSetting', - :'admins' => :'admins' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'id' => :'String', - :'name' => :'String', - :'project_role_assertion' => :'Boolean', - :'authorization_required' => :'Boolean', - :'project_access_required' => :'Boolean', - :'private_labeling_setting' => :'BetaProjectServicePrivateLabelingSetting', - :'admins' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceCreateProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceCreateProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'project_role_assertion') - self.project_role_assertion = attributes[:'project_role_assertion'] - end - - if attributes.key?(:'authorization_required') - self.authorization_required = attributes[:'authorization_required'] - end - - if attributes.key?(:'project_access_required') - self.project_access_required = attributes[:'project_access_required'] - end - - if attributes.key?(:'private_labeling_setting') - self.private_labeling_setting = attributes[:'private_labeling_setting'] - end - - if attributes.key?(:'admins') - if (value = attributes[:'admins']).is_a?(Array) - self.admins = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - id == o.id && - name == o.name && - project_role_assertion == o.project_role_assertion && - authorization_required == o.authorization_required && - project_access_required == o.project_access_required && - private_labeling_setting == o.private_labeling_setting && - admins == o.admins - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, id, name, project_role_assertion, authorization_required, project_access_required, private_labeling_setting, admins].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceCreateProjectRequest. + class BetaProjectServiceCreateProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + id: 'id', + name: 'name', + project_role_assertion: 'projectRoleAssertion', + authorization_required: 'authorizationRequired', + project_access_required: 'projectAccessRequired', + private_labeling_setting: 'privateLabelingSetting', + admins: 'admins' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + id: 'String', + name: 'String', + project_role_assertion: 'Boolean', + authorization_required: 'Boolean', + project_access_required: 'Boolean', + private_labeling_setting: 'BetaProjectServicePrivateLabelingSetting', + admins: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the organization the project belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # The unique identifier of the project. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Name of the project. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # Enable this setting to provide role information to your application. For OpenID Connect, the roles can be requested from the UserInfo endpoint or sent in the ID or Access Token, based on your application's configuration. + # @example null + attribute :project_role_assertion, Types::Any.optional.meta(omittable: true) + # Deny authentication if the user has no authorization assigned to this project. Authorizations to the project without assigned a specific role to the user are allowed. + # @example null + attribute :authorization_required, Types::Any.optional.meta(omittable: true) + # Before a user can be authenticated, it is verified that their affiliated organization has been granted access to this project. Authentication is not permitted for users from unauthorized organizations. + # @example null + attribute :project_access_required, Types::Any.optional.meta(omittable: true) + # @example null + attribute :private_labeling_setting, Types::Any.optional.meta(omittable: true) + # List of users and Project Member roles (PROJECT_OWNER, by default) to be assigned to those users. + # @example null + attribute :admins, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_create_project_response.rb b/lib/zitadel/client/models/beta_project_service_create_project_response.rb index 98c54ce1..f9c046ef 100644 --- a/lib/zitadel/client/models/beta_project_service_create_project_response.rb +++ b/lib/zitadel/client/models/beta_project_service_create_project_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceCreateProjectResponse - # The unique identifier of the newly created project. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceCreateProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceCreateProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceCreateProjectResponse. + class BetaProjectServiceCreateProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the newly created project. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_deactivate_project_grant_request.rb b/lib/zitadel/client/models/beta_project_service_deactivate_project_grant_request.rb index a5efc630..bf4ba2a8 100644 --- a/lib/zitadel/client/models/beta_project_service_deactivate_project_grant_request.rb +++ b/lib/zitadel/client/models/beta_project_service_deactivate_project_grant_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceDeactivateProjectGrantRequest - # ID of the project. - attr_accessor :project_id - - # Organization the project is granted to. - attr_accessor :granted_organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceDeactivateProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceDeactivateProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceDeactivateProjectGrantRequest. + class BetaProjectServiceDeactivateProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Organization the project is granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_deactivate_project_grant_response.rb b/lib/zitadel/client/models/beta_project_service_deactivate_project_grant_response.rb index fa0c1b8d..7b99bde9 100644 --- a/lib/zitadel/client/models/beta_project_service_deactivate_project_grant_response.rb +++ b/lib/zitadel/client/models/beta_project_service_deactivate_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceDeactivateProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceDeactivateProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceDeactivateProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceDeactivateProjectGrantResponse. + class BetaProjectServiceDeactivateProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_deactivate_project_request.rb b/lib/zitadel/client/models/beta_project_service_deactivate_project_request.rb index 42c5a742..9c3fcc65 100644 --- a/lib/zitadel/client/models/beta_project_service_deactivate_project_request.rb +++ b/lib/zitadel/client/models/beta_project_service_deactivate_project_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceDeactivateProjectRequest - # The unique identifier of the project. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceDeactivateProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceDeactivateProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceDeactivateProjectRequest. + class BetaProjectServiceDeactivateProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the project. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_deactivate_project_response.rb b/lib/zitadel/client/models/beta_project_service_deactivate_project_response.rb index bb453787..2447aa1f 100644 --- a/lib/zitadel/client/models/beta_project_service_deactivate_project_response.rb +++ b/lib/zitadel/client/models/beta_project_service_deactivate_project_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceDeactivateProjectResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceDeactivateProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceDeactivateProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceDeactivateProjectResponse. + class BetaProjectServiceDeactivateProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_delete_project_grant_request.rb b/lib/zitadel/client/models/beta_project_service_delete_project_grant_request.rb index 18142256..91dba4b7 100644 --- a/lib/zitadel/client/models/beta_project_service_delete_project_grant_request.rb +++ b/lib/zitadel/client/models/beta_project_service_delete_project_grant_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceDeleteProjectGrantRequest - # ID of the project. - attr_accessor :project_id - - # Organization the project is granted to. - attr_accessor :granted_organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceDeleteProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceDeleteProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceDeleteProjectGrantRequest. + class BetaProjectServiceDeleteProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Organization the project is granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_delete_project_grant_response.rb b/lib/zitadel/client/models/beta_project_service_delete_project_grant_response.rb index 9f7f5eae..78477200 100644 --- a/lib/zitadel/client/models/beta_project_service_delete_project_grant_response.rb +++ b/lib/zitadel/client/models/beta_project_service_delete_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceDeleteProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceDeleteProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceDeleteProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceDeleteProjectGrantResponse. + class BetaProjectServiceDeleteProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_delete_project_request.rb b/lib/zitadel/client/models/beta_project_service_delete_project_request.rb index 2a4f9c7a..50f4c89e 100644 --- a/lib/zitadel/client/models/beta_project_service_delete_project_request.rb +++ b/lib/zitadel/client/models/beta_project_service_delete_project_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceDeleteProjectRequest - # The unique identifier of the project. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceDeleteProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceDeleteProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceDeleteProjectRequest. + class BetaProjectServiceDeleteProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the project. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_delete_project_response.rb b/lib/zitadel/client/models/beta_project_service_delete_project_response.rb index caf60d0c..4cc16efe 100644 --- a/lib/zitadel/client/models/beta_project_service_delete_project_response.rb +++ b/lib/zitadel/client/models/beta_project_service_delete_project_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceDeleteProjectResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceDeleteProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceDeleteProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceDeleteProjectResponse. + class BetaProjectServiceDeleteProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_get_project_request.rb b/lib/zitadel/client/models/beta_project_service_get_project_request.rb index 5d9fad52..7a816bb0 100644 --- a/lib/zitadel/client/models/beta_project_service_get_project_request.rb +++ b/lib/zitadel/client/models/beta_project_service_get_project_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceGetProjectRequest - # The unique identifier of the project. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceGetProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceGetProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceGetProjectRequest. + class BetaProjectServiceGetProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the project. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_get_project_response.rb b/lib/zitadel/client/models/beta_project_service_get_project_response.rb index cd18414f..817eeac6 100644 --- a/lib/zitadel/client/models/beta_project_service_get_project_response.rb +++ b/lib/zitadel/client/models/beta_project_service_get_project_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceGetProjectResponse - attr_accessor :project - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project' => :'project' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project' => :'BetaProjectServiceProject' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceGetProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceGetProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project') - self.project = attributes[:'project'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project == o.project - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceGetProjectResponse. + class BetaProjectServiceGetProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project: 'project' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project: 'BetaProjectServiceProject' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :project, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_granted_project_state.rb b/lib/zitadel/client/models/beta_project_service_granted_project_state.rb index 0e8469b4..5d1bc41c 100644 --- a/lib/zitadel/client/models/beta_project_service_granted_project_state.rb +++ b/lib/zitadel/client/models/beta_project_service_granted_project_state.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaProjectServiceGrantedProjectState - GRANTED_PROJECT_STATE_UNSPECIFIED = "GRANTED_PROJECT_STATE_UNSPECIFIED".freeze - GRANTED_PROJECT_STATE_ACTIVE = "GRANTED_PROJECT_STATE_ACTIVE".freeze - GRANTED_PROJECT_STATE_INACTIVE = "GRANTED_PROJECT_STATE_INACTIVE".freeze - - def self.all_vars - @all_vars ||= [GRANTED_PROJECT_STATE_UNSPECIFIED, GRANTED_PROJECT_STATE_ACTIVE, GRANTED_PROJECT_STATE_INACTIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaProjectServiceGrantedProjectState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaProjectServiceGrantedProjectState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaProjectServiceGrantedProjectState. + class BetaProjectServiceGrantedProjectState + GRANTED_PROJECT_STATE_UNSPECIFIED = 'GRANTED_PROJECT_STATE_UNSPECIFIED' + GRANTED_PROJECT_STATE_ACTIVE = 'GRANTED_PROJECT_STATE_ACTIVE' + GRANTED_PROJECT_STATE_INACTIVE = 'GRANTED_PROJECT_STATE_INACTIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [GRANTED_PROJECT_STATE_UNSPECIFIED, GRANTED_PROJECT_STATE_ACTIVE, GRANTED_PROJECT_STATE_INACTIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaProjectServiceGrantedProjectState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_project_service_i_d_filter.rb b/lib/zitadel/client/models/beta_project_service_i_d_filter.rb deleted file mode 100644 index d7ba4327..00000000 --- a/lib/zitadel/client/models/beta_project_service_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceIDFilter - # Only return resources that belong to this id. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_project_service_id_filter.rb b/lib/zitadel/client/models/beta_project_service_id_filter.rb new file mode 100644 index 00000000..c311ed71 --- /dev/null +++ b/lib/zitadel/client/models/beta_project_service_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceIDFilter. + class BetaProjectServiceIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Only return resources that belong to this id. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_project_service_in_i_ds_filter.rb b/lib/zitadel/client/models/beta_project_service_in_i_ds_filter.rb deleted file mode 100644 index 26188d13..00000000 --- a/lib/zitadel/client/models/beta_project_service_in_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceInIDsFilter - # Defines the ids to query for. - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceInIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceInIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_project_service_in_ids_filter.rb b/lib/zitadel/client/models/beta_project_service_in_ids_filter.rb new file mode 100644 index 00000000..216a149a --- /dev/null +++ b/lib/zitadel/client/models/beta_project_service_in_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceInIDsFilter. + class BetaProjectServiceInIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_project_service_list_project_grants_request.rb b/lib/zitadel/client/models/beta_project_service_list_project_grants_request.rb index fe62d3dd..9f1e7883 100644 --- a/lib/zitadel/client/models/beta_project_service_list_project_grants_request.rb +++ b/lib/zitadel/client/models/beta_project_service_list_project_grants_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceListProjectGrantsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaProjectServicePaginationRequest', - :'sorting_column' => :'BetaProjectServiceProjectGrantFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceListProjectGrantsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceListProjectGrantsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceListProjectGrantsRequest. + class BetaProjectServiceListProjectGrantsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaProjectServicePaginationRequest', + sorting_column: 'BetaProjectServiceProjectGrantFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_list_project_grants_response.rb b/lib/zitadel/client/models/beta_project_service_list_project_grants_response.rb index c1b8eee2..41fa3d7d 100644 --- a/lib/zitadel/client/models/beta_project_service_list_project_grants_response.rb +++ b/lib/zitadel/client/models/beta_project_service_list_project_grants_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceListProjectGrantsResponse - attr_accessor :pagination - - attr_accessor :project_grants - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'project_grants' => :'projectGrants' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaProjectServicePaginationResponse', - :'project_grants' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceListProjectGrantsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceListProjectGrantsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'project_grants') - if (value = attributes[:'project_grants']).is_a?(Array) - self.project_grants = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - project_grants == o.project_grants - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, project_grants].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceListProjectGrantsResponse. + class BetaProjectServiceListProjectGrantsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + project_grants: 'projectGrants' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaProjectServicePaginationResponse', + project_grants: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grants, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_list_project_roles_request.rb b/lib/zitadel/client/models/beta_project_service_list_project_roles_request.rb index f4d1c5dc..5fcf855d 100644 --- a/lib/zitadel/client/models/beta_project_service_list_project_roles_request.rb +++ b/lib/zitadel/client/models/beta_project_service_list_project_roles_request.rb @@ -1,268 +1,87 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceListProjectRolesRequest - # ID of the project. - attr_accessor :project_id - - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'pagination' => :'BetaProjectServicePaginationRequest', - :'sorting_column' => :'BetaProjectServiceProjectRoleFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceListProjectRolesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceListProjectRolesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceListProjectRolesRequest. + class BetaProjectServiceListProjectRolesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + pagination: 'BetaProjectServicePaginationRequest', + sorting_column: 'BetaProjectServiceProjectRoleFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_list_project_roles_response.rb b/lib/zitadel/client/models/beta_project_service_list_project_roles_response.rb index 8b5a7acb..6a009be2 100644 --- a/lib/zitadel/client/models/beta_project_service_list_project_roles_response.rb +++ b/lib/zitadel/client/models/beta_project_service_list_project_roles_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceListProjectRolesResponse - attr_accessor :pagination - - attr_accessor :project_roles - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'project_roles' => :'projectRoles' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaProjectServicePaginationResponse', - :'project_roles' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceListProjectRolesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceListProjectRolesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'project_roles') - if (value = attributes[:'project_roles']).is_a?(Array) - self.project_roles = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - project_roles == o.project_roles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, project_roles].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceListProjectRolesResponse. + class BetaProjectServiceListProjectRolesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + project_roles: 'projectRoles' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaProjectServicePaginationResponse', + project_roles: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_roles, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_list_projects_request.rb b/lib/zitadel/client/models/beta_project_service_list_projects_request.rb index 763e83cf..79e35cfe 100644 --- a/lib/zitadel/client/models/beta_project_service_list_projects_request.rb +++ b/lib/zitadel/client/models/beta_project_service_list_projects_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceListProjectsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaProjectServicePaginationRequest', - :'sorting_column' => :'BetaProjectServiceProjectFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceListProjectsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceListProjectsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceListProjectsRequest. + class BetaProjectServiceListProjectsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaProjectServicePaginationRequest', + sorting_column: 'BetaProjectServiceProjectFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_list_projects_response.rb b/lib/zitadel/client/models/beta_project_service_list_projects_response.rb index 3e86f778..a4fd19a4 100644 --- a/lib/zitadel/client/models/beta_project_service_list_projects_response.rb +++ b/lib/zitadel/client/models/beta_project_service_list_projects_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceListProjectsResponse - attr_accessor :pagination - - attr_accessor :projects - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'projects' => :'projects' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'BetaProjectServicePaginationResponse', - :'projects' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceListProjectsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceListProjectsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'projects') - if (value = attributes[:'projects']).is_a?(Array) - self.projects = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - projects == o.projects - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, projects].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceListProjectsResponse. + class BetaProjectServiceListProjectsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + projects: 'projects' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'BetaProjectServicePaginationResponse', + projects: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :projects, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_pagination_request.rb b/lib/zitadel/client/models/beta_project_service_pagination_request.rb index 189e11de..4fc001b8 100644 --- a/lib/zitadel/client/models/beta_project_service_pagination_request.rb +++ b/lib/zitadel/client/models/beta_project_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServicePaginationRequest. + class BetaProjectServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_pagination_response.rb b/lib/zitadel/client/models/beta_project_service_pagination_response.rb index 36901de9..5ac7c8c6 100644 --- a/lib/zitadel/client/models/beta_project_service_pagination_response.rb +++ b/lib/zitadel/client/models/beta_project_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServicePaginationResponse. + class BetaProjectServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_private_labeling_setting.rb b/lib/zitadel/client/models/beta_project_service_private_labeling_setting.rb index e5da4443..d4b1320b 100644 --- a/lib/zitadel/client/models/beta_project_service_private_labeling_setting.rb +++ b/lib/zitadel/client/models/beta_project_service_private_labeling_setting.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaProjectServicePrivateLabelingSetting - PRIVATE_LABELING_SETTING_UNSPECIFIED = "PRIVATE_LABELING_SETTING_UNSPECIFIED".freeze - PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY = "PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY".freeze - PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY = "PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY".freeze - - def self.all_vars - @all_vars ||= [PRIVATE_LABELING_SETTING_UNSPECIFIED, PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY, PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaProjectServicePrivateLabelingSetting.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaProjectServicePrivateLabelingSetting" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaProjectServicePrivateLabelingSetting. + class BetaProjectServicePrivateLabelingSetting + PRIVATE_LABELING_SETTING_UNSPECIFIED = 'PRIVATE_LABELING_SETTING_UNSPECIFIED' + PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY = 'PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY' + PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY = 'PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY' + + # Frozen set of all allowed values, used for validation. + VALUES = [PRIVATE_LABELING_SETTING_UNSPECIFIED, PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY, PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaProjectServicePrivateLabelingSetting: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_project_service_project.rb b/lib/zitadel/client/models/beta_project_service_project.rb index 4fd4d036..3356d7de 100644 --- a/lib/zitadel/client/models/beta_project_service_project.rb +++ b/lib/zitadel/client/models/beta_project_service_project.rb @@ -1,357 +1,131 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceProject - # The unique identifier of the project. - attr_accessor :id - - # The unique identifier of the organization the project belongs to. - attr_accessor :organization_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # The name of the project. - attr_accessor :name - - attr_accessor :state - - # Describes if the roles of the user should be added to the token. - attr_accessor :project_role_assertion - - # When enabled ZITADEL will check if a user has an authorization to use this project assigned when login into an application of this project. - attr_accessor :authorization_required - - # When enabled ZITADEL will check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted). - attr_accessor :project_access_required - - attr_accessor :private_labeling_setting - - # The ID of the organization the project is granted to. - attr_accessor :granted_organization_id - - # The name of the organization the project is granted to. - attr_accessor :granted_organization_name - - attr_accessor :granted_state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'organization_id' => :'organizationId', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'name' => :'name', - :'state' => :'state', - :'project_role_assertion' => :'projectRoleAssertion', - :'authorization_required' => :'authorizationRequired', - :'project_access_required' => :'projectAccessRequired', - :'private_labeling_setting' => :'privateLabelingSetting', - :'granted_organization_id' => :'grantedOrganizationId', - :'granted_organization_name' => :'grantedOrganizationName', - :'granted_state' => :'grantedState' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'organization_id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'name' => :'String', - :'state' => :'BetaProjectServiceProjectState', - :'project_role_assertion' => :'Boolean', - :'authorization_required' => :'Boolean', - :'project_access_required' => :'Boolean', - :'private_labeling_setting' => :'BetaProjectServicePrivateLabelingSetting', - :'granted_organization_id' => :'String', - :'granted_organization_name' => :'String', - :'granted_state' => :'BetaProjectServiceGrantedProjectState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'granted_organization_id', - :'granted_organization_name', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceProject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceProject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'project_role_assertion') - self.project_role_assertion = attributes[:'project_role_assertion'] - end - - if attributes.key?(:'authorization_required') - self.authorization_required = attributes[:'authorization_required'] - end - - if attributes.key?(:'project_access_required') - self.project_access_required = attributes[:'project_access_required'] - end - - if attributes.key?(:'private_labeling_setting') - self.private_labeling_setting = attributes[:'private_labeling_setting'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - - if attributes.key?(:'granted_organization_name') - self.granted_organization_name = attributes[:'granted_organization_name'] - end - - if attributes.key?(:'granted_state') - self.granted_state = attributes[:'granted_state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - organization_id == o.organization_id && - creation_date == o.creation_date && - change_date == o.change_date && - name == o.name && - state == o.state && - project_role_assertion == o.project_role_assertion && - authorization_required == o.authorization_required && - project_access_required == o.project_access_required && - private_labeling_setting == o.private_labeling_setting && - granted_organization_id == o.granted_organization_id && - granted_organization_name == o.granted_organization_name && - granted_state == o.granted_state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, organization_id, creation_date, change_date, name, state, project_role_assertion, authorization_required, project_access_required, private_labeling_setting, granted_organization_id, granted_organization_name, granted_state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceProject. + class BetaProjectServiceProject < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + organization_id: 'organizationId', + creation_date: 'creationDate', + change_date: 'changeDate', + name: 'name', + state: 'state', + project_role_assertion: 'projectRoleAssertion', + authorization_required: 'authorizationRequired', + project_access_required: 'projectAccessRequired', + private_labeling_setting: 'privateLabelingSetting', + granted_organization_id: 'grantedOrganizationId', + granted_organization_name: 'grantedOrganizationName', + granted_state: 'grantedState' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + organization_id: 'String', + creation_date: 'Time', + change_date: 'Time', + name: 'String', + state: 'BetaProjectServiceProjectState', + project_role_assertion: 'Boolean', + authorization_required: 'Boolean', + project_access_required: 'Boolean', + private_labeling_setting: 'BetaProjectServicePrivateLabelingSetting', + granted_organization_id: 'String', + granted_organization_name: 'String', + granted_state: 'BetaProjectServiceGrantedProjectState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The unique identifier of the project. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # The unique identifier of the organization the project belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # The name of the project. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # Describes if the roles of the user should be added to the token. + # @example null + attribute :project_role_assertion, Types::Any.optional.meta(omittable: true) + # When enabled ZITADEL will check if a user has an authorization to use this project assigned when login into an application of this project. + # @example null + attribute :authorization_required, Types::Any.optional.meta(omittable: true) + # When enabled ZITADEL will check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted). + # @example null + attribute :project_access_required, Types::Any.optional.meta(omittable: true) + # @example null + attribute :private_labeling_setting, Types::Any.optional.meta(omittable: true) + # The ID of the organization the project is granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) + # The name of the organization the project is granted to. + # @example null + attribute :granted_organization_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :granted_state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_field_name.rb b/lib/zitadel/client/models/beta_project_service_project_field_name.rb index 202d536c..29069443 100644 --- a/lib/zitadel/client/models/beta_project_service_project_field_name.rb +++ b/lib/zitadel/client/models/beta_project_service_project_field_name.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaProjectServiceProjectFieldName - PROJECT_FIELD_NAME_UNSPECIFIED = "PROJECT_FIELD_NAME_UNSPECIFIED".freeze - PROJECT_FIELD_NAME_ID = "PROJECT_FIELD_NAME_ID".freeze - PROJECT_FIELD_NAME_CREATION_DATE = "PROJECT_FIELD_NAME_CREATION_DATE".freeze - PROJECT_FIELD_NAME_CHANGE_DATE = "PROJECT_FIELD_NAME_CHANGE_DATE".freeze - PROJECT_FIELD_NAME_NAME = "PROJECT_FIELD_NAME_NAME".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaProjectServiceProjectFieldName. + class BetaProjectServiceProjectFieldName + PROJECT_FIELD_NAME_UNSPECIFIED = 'PROJECT_FIELD_NAME_UNSPECIFIED' + PROJECT_FIELD_NAME_ID = 'PROJECT_FIELD_NAME_ID' + PROJECT_FIELD_NAME_CREATION_DATE = 'PROJECT_FIELD_NAME_CREATION_DATE' + PROJECT_FIELD_NAME_CHANGE_DATE = 'PROJECT_FIELD_NAME_CHANGE_DATE' + PROJECT_FIELD_NAME_NAME = 'PROJECT_FIELD_NAME_NAME' - def self.all_vars - @all_vars ||= [PROJECT_FIELD_NAME_UNSPECIFIED, PROJECT_FIELD_NAME_ID, PROJECT_FIELD_NAME_CREATION_DATE, PROJECT_FIELD_NAME_CHANGE_DATE, PROJECT_FIELD_NAME_NAME].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_FIELD_NAME_UNSPECIFIED, PROJECT_FIELD_NAME_ID, PROJECT_FIELD_NAME_CREATION_DATE, PROJECT_FIELD_NAME_CHANGE_DATE, PROJECT_FIELD_NAME_NAME].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaProjectServiceProjectFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaProjectServiceProjectFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaProjectServiceProjectFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_grant.rb b/lib/zitadel/client/models/beta_project_service_project_grant.rb index 144148e4..3b07bd6c 100644 --- a/lib/zitadel/client/models/beta_project_service_project_grant.rb +++ b/lib/zitadel/client/models/beta_project_service_project_grant.rb @@ -1,319 +1,113 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceProjectGrant - # The unique identifier of the organization which granted the project to the granted_organization_id. - attr_accessor :organization_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # The ID of the organization the project is granted to. - attr_accessor :granted_organization_id - - # The name of the organization the project is granted to. - attr_accessor :granted_organization_name - - # The roles of the granted project. - attr_accessor :granted_role_keys - - # The ID of the granted project. - attr_accessor :project_id - - # The name of the granted project. - attr_accessor :project_name - - attr_accessor :state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'granted_organization_id' => :'grantedOrganizationId', - :'granted_organization_name' => :'grantedOrganizationName', - :'granted_role_keys' => :'grantedRoleKeys', - :'project_id' => :'projectId', - :'project_name' => :'projectName', - :'state' => :'state' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'granted_organization_id' => :'String', - :'granted_organization_name' => :'String', - :'granted_role_keys' => :'Array', - :'project_id' => :'String', - :'project_name' => :'String', - :'state' => :'BetaProjectServiceProjectGrantState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceProjectGrant` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceProjectGrant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - - if attributes.key?(:'granted_organization_name') - self.granted_organization_name = attributes[:'granted_organization_name'] - end - - if attributes.key?(:'granted_role_keys') - if (value = attributes[:'granted_role_keys']).is_a?(Array) - self.granted_role_keys = value - end - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'project_name') - self.project_name = attributes[:'project_name'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - creation_date == o.creation_date && - change_date == o.change_date && - granted_organization_id == o.granted_organization_id && - granted_organization_name == o.granted_organization_name && - granted_role_keys == o.granted_role_keys && - project_id == o.project_id && - project_name == o.project_name && - state == o.state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, creation_date, change_date, granted_organization_id, granted_organization_name, granted_role_keys, project_id, project_name, state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceProjectGrant. + class BetaProjectServiceProjectGrant < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + creation_date: 'creationDate', + change_date: 'changeDate', + granted_organization_id: 'grantedOrganizationId', + granted_organization_name: 'grantedOrganizationName', + granted_role_keys: 'grantedRoleKeys', + project_id: 'projectId', + project_name: 'projectName', + state: 'state' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + creation_date: 'Time', + change_date: 'Time', + granted_organization_id: 'String', + granted_organization_name: 'String', + granted_role_keys: 'Array', + project_id: 'String', + project_name: 'String', + state: 'BetaProjectServiceProjectGrantState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the organization which granted the project to the granted_organization_id. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # The ID of the organization the project is granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) + # The name of the organization the project is granted to. + # @example null + attribute :granted_organization_name, Types::Any.optional.meta(omittable: true) + # The roles of the granted project. + # @example null + attribute :granted_role_keys, Types::Any.optional.meta(omittable: true) + # The ID of the granted project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # The name of the granted project. + # @example null + attribute :project_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_grant_field_name.rb b/lib/zitadel/client/models/beta_project_service_project_grant_field_name.rb index bb31e314..a09afa99 100644 --- a/lib/zitadel/client/models/beta_project_service_project_grant_field_name.rb +++ b/lib/zitadel/client/models/beta_project_service_project_grant_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaProjectServiceProjectGrantFieldName - PROJECT_GRANT_FIELD_NAME_UNSPECIFIED = "PROJECT_GRANT_FIELD_NAME_UNSPECIFIED".freeze - PROJECT_GRANT_FIELD_NAME_PROJECT_ID = "PROJECT_GRANT_FIELD_NAME_PROJECT_ID".freeze - PROJECT_GRANT_FIELD_NAME_CREATION_DATE = "PROJECT_GRANT_FIELD_NAME_CREATION_DATE".freeze - PROJECT_GRANT_FIELD_NAME_CHANGE_DATE = "PROJECT_GRANT_FIELD_NAME_CHANGE_DATE".freeze - - def self.all_vars - @all_vars ||= [PROJECT_GRANT_FIELD_NAME_UNSPECIFIED, PROJECT_GRANT_FIELD_NAME_PROJECT_ID, PROJECT_GRANT_FIELD_NAME_CREATION_DATE, PROJECT_GRANT_FIELD_NAME_CHANGE_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaProjectServiceProjectGrantFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaProjectServiceProjectGrantFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaProjectServiceProjectGrantFieldName. + class BetaProjectServiceProjectGrantFieldName + PROJECT_GRANT_FIELD_NAME_UNSPECIFIED = 'PROJECT_GRANT_FIELD_NAME_UNSPECIFIED' + PROJECT_GRANT_FIELD_NAME_PROJECT_ID = 'PROJECT_GRANT_FIELD_NAME_PROJECT_ID' + PROJECT_GRANT_FIELD_NAME_CREATION_DATE = 'PROJECT_GRANT_FIELD_NAME_CREATION_DATE' + PROJECT_GRANT_FIELD_NAME_CHANGE_DATE = 'PROJECT_GRANT_FIELD_NAME_CHANGE_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_GRANT_FIELD_NAME_UNSPECIFIED, PROJECT_GRANT_FIELD_NAME_PROJECT_ID, PROJECT_GRANT_FIELD_NAME_CREATION_DATE, PROJECT_GRANT_FIELD_NAME_CHANGE_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaProjectServiceProjectGrantFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_grant_search_filter.rb b/lib/zitadel/client/models/beta_project_service_project_grant_search_filter.rb index cc4aedab..52573f6f 100644 --- a/lib/zitadel/client/models/beta_project_service_project_grant_search_filter.rb +++ b/lib/zitadel/client/models/beta_project_service_project_grant_search_filter.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceProjectGrantSearchFilter - attr_accessor :in_project_ids_filter - - attr_accessor :project_grant_resource_owner_filter - - attr_accessor :project_name_filter - - attr_accessor :project_resource_owner_filter - - attr_accessor :role_key_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'in_project_ids_filter' => :'inProjectIdsFilter', - :'project_grant_resource_owner_filter' => :'projectGrantResourceOwnerFilter', - :'project_name_filter' => :'projectNameFilter', - :'project_resource_owner_filter' => :'projectResourceOwnerFilter', - :'role_key_filter' => :'roleKeyFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'in_project_ids_filter' => :'BetaProjectServiceInIDsFilter', - :'project_grant_resource_owner_filter' => :'BetaProjectServiceIDFilter', - :'project_name_filter' => :'BetaProjectServiceProjectNameFilter', - :'project_resource_owner_filter' => :'BetaProjectServiceIDFilter', - :'role_key_filter' => :'BetaProjectServiceProjectRoleKeyFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceProjectGrantSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceProjectGrantSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'in_project_ids_filter') - self.in_project_ids_filter = attributes[:'in_project_ids_filter'] - end - - if attributes.key?(:'project_grant_resource_owner_filter') - self.project_grant_resource_owner_filter = attributes[:'project_grant_resource_owner_filter'] - end - - if attributes.key?(:'project_name_filter') - self.project_name_filter = attributes[:'project_name_filter'] - end - - if attributes.key?(:'project_resource_owner_filter') - self.project_resource_owner_filter = attributes[:'project_resource_owner_filter'] - end - - if attributes.key?(:'role_key_filter') - self.role_key_filter = attributes[:'role_key_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - in_project_ids_filter == o.in_project_ids_filter && - project_grant_resource_owner_filter == o.project_grant_resource_owner_filter && - project_name_filter == o.project_name_filter && - project_resource_owner_filter == o.project_resource_owner_filter && - role_key_filter == o.role_key_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [in_project_ids_filter, project_grant_resource_owner_filter, project_name_filter, project_resource_owner_filter, role_key_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceProjectGrantSearchFilter. + class BetaProjectServiceProjectGrantSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + in_project_ids_filter: 'inProjectIdsFilter', + project_grant_resource_owner_filter: 'projectGrantResourceOwnerFilter', + project_name_filter: 'projectNameFilter', + project_resource_owner_filter: 'projectResourceOwnerFilter', + role_key_filter: 'roleKeyFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + in_project_ids_filter: 'BetaProjectServiceInIDsFilter', + project_grant_resource_owner_filter: 'BetaProjectServiceIDFilter', + project_name_filter: 'BetaProjectServiceProjectNameFilter', + project_resource_owner_filter: 'BetaProjectServiceIDFilter', + role_key_filter: 'BetaProjectServiceProjectRoleKeyFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :in_project_ids_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grant_resource_owner_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_name_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_resource_owner_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :role_key_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_grant_state.rb b/lib/zitadel/client/models/beta_project_service_project_grant_state.rb index 386c36bb..1caae15d 100644 --- a/lib/zitadel/client/models/beta_project_service_project_grant_state.rb +++ b/lib/zitadel/client/models/beta_project_service_project_grant_state.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaProjectServiceProjectGrantState - PROJECT_GRANT_STATE_UNSPECIFIED = "PROJECT_GRANT_STATE_UNSPECIFIED".freeze - PROJECT_GRANT_STATE_ACTIVE = "PROJECT_GRANT_STATE_ACTIVE".freeze - PROJECT_GRANT_STATE_INACTIVE = "PROJECT_GRANT_STATE_INACTIVE".freeze - - def self.all_vars - @all_vars ||= [PROJECT_GRANT_STATE_UNSPECIFIED, PROJECT_GRANT_STATE_ACTIVE, PROJECT_GRANT_STATE_INACTIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaProjectServiceProjectGrantState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaProjectServiceProjectGrantState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaProjectServiceProjectGrantState. + class BetaProjectServiceProjectGrantState + PROJECT_GRANT_STATE_UNSPECIFIED = 'PROJECT_GRANT_STATE_UNSPECIFIED' + PROJECT_GRANT_STATE_ACTIVE = 'PROJECT_GRANT_STATE_ACTIVE' + PROJECT_GRANT_STATE_INACTIVE = 'PROJECT_GRANT_STATE_INACTIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_GRANT_STATE_UNSPECIFIED, PROJECT_GRANT_STATE_ACTIVE, PROJECT_GRANT_STATE_INACTIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaProjectServiceProjectGrantState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_name_filter.rb b/lib/zitadel/client/models/beta_project_service_project_name_filter.rb index e26a7368..28ed437e 100644 --- a/lib/zitadel/client/models/beta_project_service_project_name_filter.rb +++ b/lib/zitadel/client/models/beta_project_service_project_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceProjectNameFilter - # Defines the name of the project to query for. - attr_accessor :project_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_name' => :'projectName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_name' => :'String', - :'method' => :'BetaProjectServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceProjectNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceProjectNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_name') - self.project_name = attributes[:'project_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_name == o.project_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceProjectNameFilter. + class BetaProjectServiceProjectNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_name: 'projectName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_name: 'String', + method: 'BetaProjectServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Defines the name of the project to query for. + # @example null + attribute :project_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_role.rb b/lib/zitadel/client/models/beta_project_service_project_role.rb index b4b5358f..5425a910 100644 --- a/lib/zitadel/client/models/beta_project_service_project_role.rb +++ b/lib/zitadel/client/models/beta_project_service_project_role.rb @@ -1,266 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceProjectRole - # ID of the project. - attr_accessor :project_id - - # Key of the project role. - attr_accessor :key - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Display name of the project role. - attr_accessor :display_name - - # Group of the project role. - attr_accessor :group - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'key' => :'key', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'display_name' => :'displayName', - :'group' => :'group' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'key' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'display_name' => :'String', - :'group' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceProjectRole` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceProjectRole`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - key == o.key && - creation_date == o.creation_date && - change_date == o.change_date && - display_name == o.display_name && - group == o.group - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, key, creation_date, change_date, display_name, group].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceProjectRole. + class BetaProjectServiceProjectRole < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + key: 'key', + creation_date: 'creationDate', + change_date: 'changeDate', + display_name: 'displayName', + group: 'group' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + key: 'String', + creation_date: 'Time', + change_date: 'Time', + display_name: 'String', + group: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Key of the project role. + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # Display name of the project role. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # Group of the project role. + # @example null + attribute :group, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_role_display_name_filter.rb b/lib/zitadel/client/models/beta_project_service_project_role_display_name_filter.rb index bbf2c2e4..36adc164 100644 --- a/lib/zitadel/client/models/beta_project_service_project_role_display_name_filter.rb +++ b/lib/zitadel/client/models/beta_project_service_project_role_display_name_filter.rb @@ -1,246 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceProjectRoleDisplayNameFilter - attr_accessor :display_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name' => :'displayName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name' => :'String', - :'method' => :'BetaProjectServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceProjectRoleDisplayNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceProjectRoleDisplayNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name == o.display_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceProjectRoleDisplayNameFilter. + class BetaProjectServiceProjectRoleDisplayNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name: 'displayName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name: 'String', + method: 'BetaProjectServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_role_field_name.rb b/lib/zitadel/client/models/beta_project_service_project_role_field_name.rb index 4a7129a0..049b2b1d 100644 --- a/lib/zitadel/client/models/beta_project_service_project_role_field_name.rb +++ b/lib/zitadel/client/models/beta_project_service_project_role_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaProjectServiceProjectRoleFieldName - PROJECT_ROLE_FIELD_NAME_UNSPECIFIED = "PROJECT_ROLE_FIELD_NAME_UNSPECIFIED".freeze - PROJECT_ROLE_FIELD_NAME_KEY = "PROJECT_ROLE_FIELD_NAME_KEY".freeze - PROJECT_ROLE_FIELD_NAME_CREATION_DATE = "PROJECT_ROLE_FIELD_NAME_CREATION_DATE".freeze - PROJECT_ROLE_FIELD_NAME_CHANGE_DATE = "PROJECT_ROLE_FIELD_NAME_CHANGE_DATE".freeze - - def self.all_vars - @all_vars ||= [PROJECT_ROLE_FIELD_NAME_UNSPECIFIED, PROJECT_ROLE_FIELD_NAME_KEY, PROJECT_ROLE_FIELD_NAME_CREATION_DATE, PROJECT_ROLE_FIELD_NAME_CHANGE_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaProjectServiceProjectRoleFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaProjectServiceProjectRoleFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaProjectServiceProjectRoleFieldName. + class BetaProjectServiceProjectRoleFieldName + PROJECT_ROLE_FIELD_NAME_UNSPECIFIED = 'PROJECT_ROLE_FIELD_NAME_UNSPECIFIED' + PROJECT_ROLE_FIELD_NAME_KEY = 'PROJECT_ROLE_FIELD_NAME_KEY' + PROJECT_ROLE_FIELD_NAME_CREATION_DATE = 'PROJECT_ROLE_FIELD_NAME_CREATION_DATE' + PROJECT_ROLE_FIELD_NAME_CHANGE_DATE = 'PROJECT_ROLE_FIELD_NAME_CHANGE_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_ROLE_FIELD_NAME_UNSPECIFIED, PROJECT_ROLE_FIELD_NAME_KEY, PROJECT_ROLE_FIELD_NAME_CREATION_DATE, PROJECT_ROLE_FIELD_NAME_CHANGE_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaProjectServiceProjectRoleFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_role_key_filter.rb b/lib/zitadel/client/models/beta_project_service_project_role_key_filter.rb index a5d03072..4cf59ffa 100644 --- a/lib/zitadel/client/models/beta_project_service_project_role_key_filter.rb +++ b/lib/zitadel/client/models/beta_project_service_project_role_key_filter.rb @@ -1,246 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceProjectRoleKeyFilter - attr_accessor :key - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'method' => :'BetaProjectServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceProjectRoleKeyFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceProjectRoleKeyFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceProjectRoleKeyFilter. + class BetaProjectServiceProjectRoleKeyFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + method: 'BetaProjectServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_role_search_filter.rb b/lib/zitadel/client/models/beta_project_service_project_role_search_filter.rb index 25c4bdb0..36106cd7 100644 --- a/lib/zitadel/client/models/beta_project_service_project_role_search_filter.rb +++ b/lib/zitadel/client/models/beta_project_service_project_role_search_filter.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceProjectRoleSearchFilter - attr_accessor :display_name_filter - - attr_accessor :role_key_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name_filter' => :'displayNameFilter', - :'role_key_filter' => :'roleKeyFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name_filter' => :'BetaProjectServiceProjectRoleDisplayNameFilter', - :'role_key_filter' => :'BetaProjectServiceProjectRoleKeyFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceProjectRoleSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceProjectRoleSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name_filter') - self.display_name_filter = attributes[:'display_name_filter'] - end - - if attributes.key?(:'role_key_filter') - self.role_key_filter = attributes[:'role_key_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name_filter == o.display_name_filter && - role_key_filter == o.role_key_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name_filter, role_key_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceProjectRoleSearchFilter. + class BetaProjectServiceProjectRoleSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name_filter: 'displayNameFilter', + role_key_filter: 'roleKeyFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name_filter: 'BetaProjectServiceProjectRoleDisplayNameFilter', + role_key_filter: 'BetaProjectServiceProjectRoleKeyFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :display_name_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :role_key_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_search_filter.rb b/lib/zitadel/client/models/beta_project_service_project_search_filter.rb index d1857e7f..482a822c 100644 --- a/lib/zitadel/client/models/beta_project_service_project_search_filter.rb +++ b/lib/zitadel/client/models/beta_project_service_project_search_filter.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceProjectSearchFilter - attr_accessor :in_project_ids_filter - - attr_accessor :project_grant_resource_owner_filter - - attr_accessor :project_name_filter - - attr_accessor :project_organization_id_filter - - attr_accessor :project_resource_owner_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'in_project_ids_filter' => :'inProjectIdsFilter', - :'project_grant_resource_owner_filter' => :'projectGrantResourceOwnerFilter', - :'project_name_filter' => :'projectNameFilter', - :'project_organization_id_filter' => :'projectOrganizationIdFilter', - :'project_resource_owner_filter' => :'projectResourceOwnerFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'in_project_ids_filter' => :'BetaProjectServiceInIDsFilter', - :'project_grant_resource_owner_filter' => :'BetaProjectServiceIDFilter', - :'project_name_filter' => :'BetaProjectServiceProjectNameFilter', - :'project_organization_id_filter' => :'BetaProjectServiceIDFilter', - :'project_resource_owner_filter' => :'BetaProjectServiceIDFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceProjectSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceProjectSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'in_project_ids_filter') - self.in_project_ids_filter = attributes[:'in_project_ids_filter'] - end - - if attributes.key?(:'project_grant_resource_owner_filter') - self.project_grant_resource_owner_filter = attributes[:'project_grant_resource_owner_filter'] - end - - if attributes.key?(:'project_name_filter') - self.project_name_filter = attributes[:'project_name_filter'] - end - - if attributes.key?(:'project_organization_id_filter') - self.project_organization_id_filter = attributes[:'project_organization_id_filter'] - end - - if attributes.key?(:'project_resource_owner_filter') - self.project_resource_owner_filter = attributes[:'project_resource_owner_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - in_project_ids_filter == o.in_project_ids_filter && - project_grant_resource_owner_filter == o.project_grant_resource_owner_filter && - project_name_filter == o.project_name_filter && - project_organization_id_filter == o.project_organization_id_filter && - project_resource_owner_filter == o.project_resource_owner_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [in_project_ids_filter, project_grant_resource_owner_filter, project_name_filter, project_organization_id_filter, project_resource_owner_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceProjectSearchFilter. + class BetaProjectServiceProjectSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + in_project_ids_filter: 'inProjectIdsFilter', + project_grant_resource_owner_filter: 'projectGrantResourceOwnerFilter', + project_name_filter: 'projectNameFilter', + project_organization_id_filter: 'projectOrganizationIdFilter', + project_resource_owner_filter: 'projectResourceOwnerFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + in_project_ids_filter: 'BetaProjectServiceInIDsFilter', + project_grant_resource_owner_filter: 'BetaProjectServiceIDFilter', + project_name_filter: 'BetaProjectServiceProjectNameFilter', + project_organization_id_filter: 'BetaProjectServiceIDFilter', + project_resource_owner_filter: 'BetaProjectServiceIDFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :in_project_ids_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grant_resource_owner_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_name_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_organization_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_resource_owner_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_project_state.rb b/lib/zitadel/client/models/beta_project_service_project_state.rb index 04d204ae..13e5ad0f 100644 --- a/lib/zitadel/client/models/beta_project_service_project_state.rb +++ b/lib/zitadel/client/models/beta_project_service_project_state.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaProjectServiceProjectState - PROJECT_STATE_UNSPECIFIED = "PROJECT_STATE_UNSPECIFIED".freeze - PROJECT_STATE_ACTIVE = "PROJECT_STATE_ACTIVE".freeze - PROJECT_STATE_INACTIVE = "PROJECT_STATE_INACTIVE".freeze - - def self.all_vars - @all_vars ||= [PROJECT_STATE_UNSPECIFIED, PROJECT_STATE_ACTIVE, PROJECT_STATE_INACTIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaProjectServiceProjectState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaProjectServiceProjectState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaProjectServiceProjectState. + class BetaProjectServiceProjectState + PROJECT_STATE_UNSPECIFIED = 'PROJECT_STATE_UNSPECIFIED' + PROJECT_STATE_ACTIVE = 'PROJECT_STATE_ACTIVE' + PROJECT_STATE_INACTIVE = 'PROJECT_STATE_INACTIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_STATE_UNSPECIFIED, PROJECT_STATE_ACTIVE, PROJECT_STATE_INACTIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaProjectServiceProjectState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_project_service_remove_project_role_request.rb b/lib/zitadel/client/models/beta_project_service_remove_project_role_request.rb index 03efe4b7..3ed55710 100644 --- a/lib/zitadel/client/models/beta_project_service_remove_project_role_request.rb +++ b/lib/zitadel/client/models/beta_project_service_remove_project_role_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceRemoveProjectRoleRequest - # ID of the project. - attr_accessor :project_id - - # The key is the only relevant attribute for ZITADEL regarding the authorization checks. - attr_accessor :role_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'role_key' => :'roleKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'role_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceRemoveProjectRoleRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceRemoveProjectRoleRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - role_key == o.role_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, role_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceRemoveProjectRoleRequest. + class BetaProjectServiceRemoveProjectRoleRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + role_key: 'roleKey' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + role_key: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # The key is the only relevant attribute for ZITADEL regarding the authorization checks. + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_remove_project_role_response.rb b/lib/zitadel/client/models/beta_project_service_remove_project_role_response.rb index 773fd2e3..702a8914 100644 --- a/lib/zitadel/client/models/beta_project_service_remove_project_role_response.rb +++ b/lib/zitadel/client/models/beta_project_service_remove_project_role_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceRemoveProjectRoleResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :removal_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'removal_date' => :'removalDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'removal_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceRemoveProjectRoleResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceRemoveProjectRoleResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'removal_date') - self.removal_date = attributes[:'removal_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - removal_date == o.removal_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [removal_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceRemoveProjectRoleResponse. + class BetaProjectServiceRemoveProjectRoleResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + removal_date: 'removalDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + removal_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :removal_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_text_filter_method.rb b/lib/zitadel/client/models/beta_project_service_text_filter_method.rb index 23f4441c..c3893c09 100644 --- a/lib/zitadel/client/models/beta_project_service_text_filter_method.rb +++ b/lib/zitadel/client/models/beta_project_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaProjectServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaProjectServiceTextFilterMethod. + class BetaProjectServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaProjectServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaProjectServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaProjectServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_project_service_update_project_grant_request.rb b/lib/zitadel/client/models/beta_project_service_update_project_grant_request.rb index d4aef6ab..e32dc86b 100644 --- a/lib/zitadel/client/models/beta_project_service_update_project_grant_request.rb +++ b/lib/zitadel/client/models/beta_project_service_update_project_grant_request.rb @@ -1,238 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceUpdateProjectGrantRequest - # ID of the project. - attr_accessor :project_id - - # Organization the project is granted to. - attr_accessor :granted_organization_id - - # Keys of the role available for the project grant. - attr_accessor :role_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId', - :'role_keys' => :'roleKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String', - :'role_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - - if attributes.key?(:'role_keys') - if (value = attributes[:'role_keys']).is_a?(Array) - self.role_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id && - role_keys == o.role_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id, role_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceUpdateProjectGrantRequest. + class BetaProjectServiceUpdateProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId', + role_keys: 'roleKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String', + role_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Organization the project is granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) + # Keys of the role available for the project grant. + # @example null + attribute :role_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_update_project_grant_response.rb b/lib/zitadel/client/models/beta_project_service_update_project_grant_response.rb index ff61fced..d0bb5c0b 100644 --- a/lib/zitadel/client/models/beta_project_service_update_project_grant_response.rb +++ b/lib/zitadel/client/models/beta_project_service_update_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceUpdateProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceUpdateProjectGrantResponse. + class BetaProjectServiceUpdateProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_update_project_request.rb b/lib/zitadel/client/models/beta_project_service_update_project_request.rb index 599345d7..95273171 100644 --- a/lib/zitadel/client/models/beta_project_service_update_project_request.rb +++ b/lib/zitadel/client/models/beta_project_service_update_project_request.rb @@ -1,290 +1,97 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceUpdateProjectRequest - attr_accessor :id - - # Name of the project. - attr_accessor :name - - # Enable this setting to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types. - attr_accessor :project_role_assertion - - # When enabled ZITADEL will check if a user has a role of this project assigned when login into an application of this project. - attr_accessor :project_role_check - - # When enabled ZITADEL will check if the organization of the user, that is trying to log in, has a grant to this project. - attr_accessor :has_project_check - - attr_accessor :private_labeling_setting - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'project_role_assertion' => :'projectRoleAssertion', - :'project_role_check' => :'projectRoleCheck', - :'has_project_check' => :'hasProjectCheck', - :'private_labeling_setting' => :'privateLabelingSetting' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'project_role_assertion' => :'Boolean', - :'project_role_check' => :'Boolean', - :'has_project_check' => :'Boolean', - :'private_labeling_setting' => :'BetaProjectServicePrivateLabelingSetting' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'project_role_assertion', - :'project_role_check', - :'has_project_check', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'project_role_assertion') - self.project_role_assertion = attributes[:'project_role_assertion'] - end - - if attributes.key?(:'project_role_check') - self.project_role_check = attributes[:'project_role_check'] - end - - if attributes.key?(:'has_project_check') - self.has_project_check = attributes[:'has_project_check'] - end - - if attributes.key?(:'private_labeling_setting') - self.private_labeling_setting = attributes[:'private_labeling_setting'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - project_role_assertion == o.project_role_assertion && - project_role_check == o.project_role_check && - has_project_check == o.has_project_check && - private_labeling_setting == o.private_labeling_setting - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, project_role_assertion, project_role_check, has_project_check, private_labeling_setting].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceUpdateProjectRequest. + class BetaProjectServiceUpdateProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name', + project_role_assertion: 'projectRoleAssertion', + project_role_check: 'projectRoleCheck', + has_project_check: 'hasProjectCheck', + private_labeling_setting: 'privateLabelingSetting' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String', + project_role_assertion: 'Boolean', + project_role_check: 'Boolean', + has_project_check: 'Boolean', + private_labeling_setting: 'BetaProjectServicePrivateLabelingSetting' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Name of the project. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # Enable this setting to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types. + # @example null + attribute :project_role_assertion, Types::Any.optional.meta(omittable: true) + # When enabled ZITADEL will check if a user has a role of this project assigned when login into an application of this project. + # @example null + attribute :project_role_check, Types::Any.optional.meta(omittable: true) + # When enabled ZITADEL will check if the organization of the user, that is trying to log in, has a grant to this project. + # @example null + attribute :has_project_check, Types::Any.optional.meta(omittable: true) + # @example null + attribute :private_labeling_setting, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_update_project_response.rb b/lib/zitadel/client/models/beta_project_service_update_project_response.rb index d8f9527a..04804167 100644 --- a/lib/zitadel/client/models/beta_project_service_update_project_response.rb +++ b/lib/zitadel/client/models/beta_project_service_update_project_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceUpdateProjectResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceUpdateProjectResponse. + class BetaProjectServiceUpdateProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_project_service_update_project_role_request.rb b/lib/zitadel/client/models/beta_project_service_update_project_role_request.rb index b1da78b3..9e9ab899 100644 --- a/lib/zitadel/client/models/beta_project_service_update_project_role_request.rb +++ b/lib/zitadel/client/models/beta_project_service_update_project_role_request.rb @@ -1,248 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceUpdateProjectRoleRequest - # ID of the project. - attr_accessor :project_id - - # The key is the only relevant attribute for ZITADEL regarding the authorization checks. - attr_accessor :role_key - - # Name displayed for the role. - attr_accessor :display_name - - # The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user. - attr_accessor :group - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'role_key' => :'roleKey', - :'display_name' => :'displayName', - :'group' => :'group' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'role_key' => :'String', - :'display_name' => :'String', - :'group' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'display_name', - :'group' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectRoleRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectRoleRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - role_key == o.role_key && - display_name == o.display_name && - group == o.group - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, role_key, display_name, group].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceUpdateProjectRoleRequest. + class BetaProjectServiceUpdateProjectRoleRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + role_key: 'roleKey', + display_name: 'displayName', + group: 'group' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + role_key: 'String', + display_name: 'String', + group: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # The key is the only relevant attribute for ZITADEL regarding the authorization checks. + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) + # Name displayed for the role. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user. + # @example null + attribute :group, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_project_service_update_project_role_response.rb b/lib/zitadel/client/models/beta_project_service_update_project_role_response.rb index 299ff570..cdab0822 100644 --- a/lib/zitadel/client/models/beta_project_service_update_project_role_response.rb +++ b/lib/zitadel/client/models/beta_project_service_update_project_role_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaProjectServiceUpdateProjectRoleResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectRoleResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaProjectServiceUpdateProjectRoleResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaProjectServiceUpdateProjectRoleResponse. + class BetaProjectServiceUpdateProjectRoleResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_any.rb b/lib/zitadel/client/models/beta_session_service_any.rb index 850f5552..bfe32c6b 100644 --- a/lib/zitadel/client/models/beta_session_service_any.rb +++ b/lib/zitadel/client/models/beta_session_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaSessionServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaSessionServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_challenges.rb b/lib/zitadel/client/models/beta_session_service_challenges.rb index cdd1fcdd..88b7c32c 100644 --- a/lib/zitadel/client/models/beta_session_service_challenges.rb +++ b/lib/zitadel/client/models/beta_session_service_challenges.rb @@ -1,235 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceChallenges - attr_accessor :web_auth_n - - attr_accessor :otp_sms - - attr_accessor :otp_email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'web_auth_n' => :'webAuthN', - :'otp_sms' => :'otpSms', - :'otp_email' => :'otpEmail' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'web_auth_n' => :'BetaSessionServiceWebAuthN', - :'otp_sms' => :'String', - :'otp_email' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'otp_sms', - :'otp_email' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceChallenges` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceChallenges`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'web_auth_n') - self.web_auth_n = attributes[:'web_auth_n'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] - end - - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - web_auth_n == o.web_auth_n && - otp_sms == o.otp_sms && - otp_email == o.otp_email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [web_auth_n, otp_sms, otp_email].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceChallenges. + class BetaSessionServiceChallenges < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + web_auth_n: 'webAuthN', + otp_sms: 'otpSms', + otp_email: 'otpEmail' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + web_auth_n: 'BetaSessionServiceWebAuthN', + otp_sms: 'String', + otp_email: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :web_auth_n, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_sms, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_email, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_check_i_d_p_intent.rb b/lib/zitadel/client/models/beta_session_service_check_i_d_p_intent.rb deleted file mode 100644 index 109589fc..00000000 --- a/lib/zitadel/client/models/beta_session_service_check_i_d_p_intent.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceCheckIDPIntent - attr_accessor :idp_intent_id - - attr_accessor :idp_intent_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_intent_id' => :'idpIntentId', - :'idp_intent_token' => :'idpIntentToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_intent_id' => :'String', - :'idp_intent_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckIDPIntent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckIDPIntent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_intent_id') - self.idp_intent_id = attributes[:'idp_intent_id'] - end - - if attributes.key?(:'idp_intent_token') - self.idp_intent_token = attributes[:'idp_intent_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_intent_id == o.idp_intent_id && - idp_intent_token == o.idp_intent_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_intent_id, idp_intent_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_session_service_check_idp_intent.rb b/lib/zitadel/client/models/beta_session_service_check_idp_intent.rb new file mode 100644 index 00000000..587bf8fb --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_check_idp_intent.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceCheckIDPIntent. + class BetaSessionServiceCheckIDPIntent < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_intent_id: 'idpIntentId', + idp_intent_token: 'idpIntentToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_intent_id: 'String', + idp_intent_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp_intent_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_intent_token, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_session_service_check_o_t_p.rb b/lib/zitadel/client/models/beta_session_service_check_o_t_p.rb deleted file mode 100644 index da981372..00000000 --- a/lib/zitadel/client/models/beta_session_service_check_o_t_p.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceCheckOTP - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckOTP` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckOTP`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_session_service_check_otp.rb b/lib/zitadel/client/models/beta_session_service_check_otp.rb new file mode 100644 index 00000000..9eddd68c --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_check_otp.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceCheckOTP. + class BetaSessionServiceCheckOTP < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_session_service_check_password.rb b/lib/zitadel/client/models/beta_session_service_check_password.rb index df0a146b..1f86de15 100644 --- a/lib/zitadel/client/models/beta_session_service_check_password.rb +++ b/lib/zitadel/client/models/beta_session_service_check_password.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceCheckPassword - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'password' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckPassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceCheckPassword. + class BetaSessionServiceCheckPassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + password: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_check_t_o_t_p.rb b/lib/zitadel/client/models/beta_session_service_check_t_o_t_p.rb deleted file mode 100644 index 9d27fe8d..00000000 --- a/lib/zitadel/client/models/beta_session_service_check_t_o_t_p.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceCheckTOTP - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckTOTP` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckTOTP`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_session_service_check_totp.rb b/lib/zitadel/client/models/beta_session_service_check_totp.rb new file mode 100644 index 00000000..7701ecb1 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_check_totp.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceCheckTOTP. + class BetaSessionServiceCheckTOTP < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_session_service_check_user.rb b/lib/zitadel/client/models/beta_session_service_check_user.rb index a520e532..5efab067 100644 --- a/lib/zitadel/client/models/beta_session_service_check_user.rb +++ b/lib/zitadel/client/models/beta_session_service_check_user.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceCheckUser - attr_accessor :login_name - - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_name' => :'loginName', - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_name' => :'String', - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_name') - self.login_name = attributes[:'login_name'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_name == o.login_name && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_name, user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceCheckUser. + class BetaSessionServiceCheckUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_name: 'loginName', + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_name: 'String', + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_check_web_auth_n.rb b/lib/zitadel/client/models/beta_session_service_check_web_auth_n.rb index 45d4c412..fa04ed26 100644 --- a/lib/zitadel/client/models/beta_session_service_check_web_auth_n.rb +++ b/lib/zitadel/client/models/beta_session_service_check_web_auth_n.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceCheckWebAuthN - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :credential_assertion_data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'credential_assertion_data' => :'credentialAssertionData' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'credential_assertion_data' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCheckWebAuthN` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCheckWebAuthN`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'credential_assertion_data') - if (value = attributes[:'credential_assertion_data']).is_a?(Hash) - self.credential_assertion_data = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - credential_assertion_data == o.credential_assertion_data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [credential_assertion_data].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceCheckWebAuthN. + class BetaSessionServiceCheckWebAuthN < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + credential_assertion_data: 'credentialAssertionData' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + credential_assertion_data: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :credential_assertion_data, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_checks.rb b/lib/zitadel/client/models/beta_session_service_checks.rb index 47e84e5f..6b6c7b5f 100644 --- a/lib/zitadel/client/models/beta_session_service_checks.rb +++ b/lib/zitadel/client/models/beta_session_service_checks.rb @@ -1,269 +1,97 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceChecks - attr_accessor :user - - attr_accessor :password - - attr_accessor :web_auth_n - - attr_accessor :idp_intent - - attr_accessor :totp - - attr_accessor :otp_sms - - attr_accessor :otp_email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user' => :'user', - :'password' => :'password', - :'web_auth_n' => :'webAuthN', - :'idp_intent' => :'idpIntent', - :'totp' => :'totp', - :'otp_sms' => :'otpSms', - :'otp_email' => :'otpEmail' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user' => :'BetaSessionServiceCheckUser', - :'password' => :'BetaSessionServiceCheckPassword', - :'web_auth_n' => :'BetaSessionServiceCheckWebAuthN', - :'idp_intent' => :'BetaSessionServiceCheckIDPIntent', - :'totp' => :'BetaSessionServiceCheckTOTP', - :'otp_sms' => :'BetaSessionServiceCheckOTP', - :'otp_email' => :'BetaSessionServiceCheckOTP' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceChecks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceChecks`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'web_auth_n') - self.web_auth_n = attributes[:'web_auth_n'] - end - - if attributes.key?(:'idp_intent') - self.idp_intent = attributes[:'idp_intent'] - end - - if attributes.key?(:'totp') - self.totp = attributes[:'totp'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] - end - - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user == o.user && - password == o.password && - web_auth_n == o.web_auth_n && - idp_intent == o.idp_intent && - totp == o.totp && - otp_sms == o.otp_sms && - otp_email == o.otp_email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user, password, web_auth_n, idp_intent, totp, otp_sms, otp_email].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceChecks. + class BetaSessionServiceChecks < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user: 'user', + password: 'password', + web_auth_n: 'webAuthN', + idp_intent: 'idpIntent', + totp: 'totp', + otp_sms: 'otpSms', + otp_email: 'otpEmail' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user: 'BetaSessionServiceCheckUser', + password: 'BetaSessionServiceCheckPassword', + web_auth_n: 'BetaSessionServiceCheckWebAuthN', + idp_intent: 'BetaSessionServiceCheckIDPIntent', + totp: 'BetaSessionServiceCheckTOTP', + otp_sms: 'BetaSessionServiceCheckOTP', + otp_email: 'BetaSessionServiceCheckOTP' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :web_auth_n, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_intent, Types::Any.optional.meta(omittable: true) + # @example null + attribute :totp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_sms, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_email, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_connect_error.rb b/lib/zitadel/client/models/beta_session_service_connect_error.rb index db6ae921..ed38056d 100644 --- a/lib/zitadel/client/models/beta_session_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_session_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaSessionServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaSessionServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_create_session_request.rb b/lib/zitadel/client/models/beta_session_service_create_session_request.rb index f9b33ec5..5854b2fd 100644 --- a/lib/zitadel/client/models/beta_session_service_create_session_request.rb +++ b/lib/zitadel/client/models/beta_session_service_create_session_request.rb @@ -1,254 +1,92 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceCreateSessionRequest - attr_accessor :checks - - attr_accessor :metadata - - attr_accessor :challenges - - attr_accessor :user_agent - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :lifetime - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'checks' => :'checks', - :'metadata' => :'metadata', - :'challenges' => :'challenges', - :'user_agent' => :'userAgent', - :'lifetime' => :'lifetime' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'checks' => :'BetaSessionServiceChecks', - :'metadata' => :'Hash', - :'challenges' => :'BetaSessionServiceRequestChallenges', - :'user_agent' => :'BetaSessionServiceUserAgent', - :'lifetime' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCreateSessionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCreateSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'checks') - self.checks = attributes[:'checks'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'challenges') - self.challenges = attributes[:'challenges'] - end - - if attributes.key?(:'user_agent') - self.user_agent = attributes[:'user_agent'] - end - - if attributes.key?(:'lifetime') - self.lifetime = attributes[:'lifetime'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - checks == o.checks && - metadata == o.metadata && - challenges == o.challenges && - user_agent == o.user_agent && - lifetime == o.lifetime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [checks, metadata, challenges, user_agent, lifetime].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceCreateSessionRequest. + class BetaSessionServiceCreateSessionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + checks: 'checks', + metadata: 'metadata', + challenges: 'challenges', + user_agent: 'userAgent', + lifetime: 'lifetime' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + checks: 'BetaSessionServiceChecks', + metadata: 'Hash', + challenges: 'BetaSessionServiceRequestChallenges', + user_agent: 'BetaSessionServiceUserAgent', + lifetime: 'ISO8601::Duration' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + inner: 'byte[]', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :checks, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :challenges, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_agent, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :lifetime, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_create_session_response.rb b/lib/zitadel/client/models/beta_session_service_create_session_response.rb index 0d3d61e8..6259cf8b 100644 --- a/lib/zitadel/client/models/beta_session_service_create_session_response.rb +++ b/lib/zitadel/client/models/beta_session_service_create_session_response.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceCreateSessionResponse - attr_accessor :details - - attr_accessor :session_id - - attr_accessor :session_token - - attr_accessor :challenges - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken', - :'challenges' => :'challenges' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSessionServiceDetails', - :'session_id' => :'String', - :'session_token' => :'String', - :'challenges' => :'BetaSessionServiceChallenges' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCreateSessionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCreateSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - - if attributes.key?(:'challenges') - self.challenges = attributes[:'challenges'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - session_id == o.session_id && - session_token == o.session_token && - challenges == o.challenges - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, session_id, session_token, challenges].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceCreateSessionResponse. + class BetaSessionServiceCreateSessionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + session_id: 'sessionId', + session_token: 'sessionToken', + challenges: 'challenges' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSessionServiceDetails', + session_id: 'String', + session_token: 'String', + challenges: 'BetaSessionServiceChallenges' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :challenges, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_creation_date_query.rb b/lib/zitadel/client/models/beta_session_service_creation_date_query.rb index 527dae69..6f23ed17 100644 --- a/lib/zitadel/client/models/beta_session_service_creation_date_query.rb +++ b/lib/zitadel/client/models/beta_session_service_creation_date_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceCreationDateQuery - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'method' => :'BetaSessionServiceTimestampQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceCreationDateQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceCreationDateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceCreationDateQuery. + class BetaSessionServiceCreationDateQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + method: 'BetaSessionServiceTimestampQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_delete_session_request.rb b/lib/zitadel/client/models/beta_session_service_delete_session_request.rb index c06b59a4..8c8b827b 100644 --- a/lib/zitadel/client/models/beta_session_service_delete_session_request.rb +++ b/lib/zitadel/client/models/beta_session_service_delete_session_request.rb @@ -1,225 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceDeleteSessionRequest - attr_accessor :session_id - - attr_accessor :session_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'session_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'session_token' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceDeleteSessionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceDeleteSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - session_token == o.session_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, session_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceDeleteSessionRequest. + class BetaSessionServiceDeleteSessionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session_id: 'sessionId', + session_token: 'sessionToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session_id: 'String', + session_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_delete_session_response.rb b/lib/zitadel/client/models/beta_session_service_delete_session_response.rb index e3aba8f0..0575420e 100644 --- a/lib/zitadel/client/models/beta_session_service_delete_session_response.rb +++ b/lib/zitadel/client/models/beta_session_service_delete_session_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceDeleteSessionResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSessionServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceDeleteSessionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceDeleteSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceDeleteSessionResponse. + class BetaSessionServiceDeleteSessionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSessionServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_details.rb b/lib/zitadel/client/models/beta_session_service_details.rb index 6c794daf..0b157cdf 100644 --- a/lib/zitadel/client/models/beta_session_service_details.rb +++ b/lib/zitadel/client/models/beta_session_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceDetails. + class BetaSessionServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_factors.rb b/lib/zitadel/client/models/beta_session_service_factors.rb index 7585c799..dc1dea96 100644 --- a/lib/zitadel/client/models/beta_session_service_factors.rb +++ b/lib/zitadel/client/models/beta_session_service_factors.rb @@ -1,269 +1,97 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceFactors - attr_accessor :user - - attr_accessor :password - - attr_accessor :web_auth_n - - attr_accessor :intent - - attr_accessor :totp - - attr_accessor :otp_sms - - attr_accessor :otp_email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user' => :'user', - :'password' => :'password', - :'web_auth_n' => :'webAuthN', - :'intent' => :'intent', - :'totp' => :'totp', - :'otp_sms' => :'otpSms', - :'otp_email' => :'otpEmail' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user' => :'BetaSessionServiceUserFactor', - :'password' => :'BetaSessionServicePasswordFactor', - :'web_auth_n' => :'BetaSessionServiceWebAuthNFactor', - :'intent' => :'BetaSessionServiceIntentFactor', - :'totp' => :'BetaSessionServiceTOTPFactor', - :'otp_sms' => :'BetaSessionServiceOTPFactor', - :'otp_email' => :'BetaSessionServiceOTPFactor' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceFactors` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceFactors`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'web_auth_n') - self.web_auth_n = attributes[:'web_auth_n'] - end - - if attributes.key?(:'intent') - self.intent = attributes[:'intent'] - end - - if attributes.key?(:'totp') - self.totp = attributes[:'totp'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] - end - - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user == o.user && - password == o.password && - web_auth_n == o.web_auth_n && - intent == o.intent && - totp == o.totp && - otp_sms == o.otp_sms && - otp_email == o.otp_email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user, password, web_auth_n, intent, totp, otp_sms, otp_email].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceFactors. + class BetaSessionServiceFactors < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user: 'user', + password: 'password', + web_auth_n: 'webAuthN', + intent: 'intent', + totp: 'totp', + otp_sms: 'otpSms', + otp_email: 'otpEmail' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user: 'BetaSessionServiceUserFactor', + password: 'BetaSessionServicePasswordFactor', + web_auth_n: 'BetaSessionServiceWebAuthNFactor', + intent: 'BetaSessionServiceIntentFactor', + totp: 'BetaSessionServiceTOTPFactor', + otp_sms: 'BetaSessionServiceOTPFactor', + otp_email: 'BetaSessionServiceOTPFactor' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :web_auth_n, Types::Any.optional.meta(omittable: true) + # @example null + attribute :intent, Types::Any.optional.meta(omittable: true) + # @example null + attribute :totp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_sms, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_email, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_get_session_request.rb b/lib/zitadel/client/models/beta_session_service_get_session_request.rb index ca7aa5b9..4c7d68d7 100644 --- a/lib/zitadel/client/models/beta_session_service_get_session_request.rb +++ b/lib/zitadel/client/models/beta_session_service_get_session_request.rb @@ -1,225 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceGetSessionRequest - attr_accessor :session_id - - attr_accessor :session_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'session_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'session_token' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceGetSessionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceGetSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - session_token == o.session_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, session_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceGetSessionRequest. + class BetaSessionServiceGetSessionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session_id: 'sessionId', + session_token: 'sessionToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session_id: 'String', + session_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_get_session_response.rb b/lib/zitadel/client/models/beta_session_service_get_session_response.rb index cfa0feae..8a227832 100644 --- a/lib/zitadel/client/models/beta_session_service_get_session_response.rb +++ b/lib/zitadel/client/models/beta_session_service_get_session_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceGetSessionResponse - attr_accessor :session - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session' => :'session' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session' => :'BetaSessionServiceSession' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceGetSessionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceGetSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session') - self.session = attributes[:'session'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session == o.session - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceGetSessionResponse. + class BetaSessionServiceGetSessionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session: 'session' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session: 'BetaSessionServiceSession' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :session, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_header_values.rb b/lib/zitadel/client/models/beta_session_service_header_values.rb index e0c5a665..9c95ccd9 100644 --- a/lib/zitadel/client/models/beta_session_service_header_values.rb +++ b/lib/zitadel/client/models/beta_session_service_header_values.rb @@ -1,218 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # A header may have multiple values. In Go, headers are defined as map[string][]string, but protobuf doesn't allow this scheme. - class BetaSessionServiceHeaderValues - attr_accessor :values - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'values' => :'values' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'values' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceHeaderValues` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceHeaderValues`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'values') - if (value = attributes[:'values']).is_a?(Array) - self.values = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - values == o.values - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [values].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # A header may have multiple values. In Go, headers are defined as map[string][]string, but protobuf doesn't allow this scheme. + class BetaSessionServiceHeaderValues < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + values: 'values' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + values: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :values, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_i_ds_query.rb b/lib/zitadel/client/models/beta_session_service_i_ds_query.rb deleted file mode 100644 index 2149df6a..00000000 --- a/lib/zitadel/client/models/beta_session_service_i_ds_query.rb +++ /dev/null @@ -1,217 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceIDsQuery - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceIDsQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceIDsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_session_service_ids_query.rb b/lib/zitadel/client/models/beta_session_service_ids_query.rb new file mode 100644 index 00000000..191ac214 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_ids_query.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceIDsQuery. + class BetaSessionServiceIDsQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_session_service_intent_factor.rb b/lib/zitadel/client/models/beta_session_service_intent_factor.rb index 5f40b096..a12691a3 100644 --- a/lib/zitadel/client/models/beta_session_service_intent_factor.rb +++ b/lib/zitadel/client/models/beta_session_service_intent_factor.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceIntentFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceIntentFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceIntentFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceIntentFactor. + class BetaSessionServiceIntentFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_list_details.rb b/lib/zitadel/client/models/beta_session_service_list_details.rb index 5160a6bc..14bbbd41 100644 --- a/lib/zitadel/client/models/beta_session_service_list_details.rb +++ b/lib/zitadel/client/models/beta_session_service_list_details.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceListDetails - attr_accessor :total_result - - attr_accessor :processed_sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'processed_sequence' => :'processedSequence', - :'timestamp' => :'timestamp' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'processed_sequence' => :'Object', - :'timestamp' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'processed_sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceListDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'processed_sequence') - self.processed_sequence = attributes[:'processed_sequence'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - processed_sequence == o.processed_sequence && - timestamp == o.timestamp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, processed_sequence, timestamp].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceListDetails. + class BetaSessionServiceListDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + processed_sequence: 'processedSequence', + timestamp: 'timestamp' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + processed_sequence: 'Object', + timestamp: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # @example null + attribute :processed_sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_list_query.rb b/lib/zitadel/client/models/beta_session_service_list_query.rb index b5233f4a..75402669 100644 --- a/lib/zitadel/client/models/beta_session_service_list_query.rb +++ b/lib/zitadel/client/models/beta_session_service_list_query.rb @@ -1,234 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceListQuery - attr_accessor :offset - - attr_accessor :limit - - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceListQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceListQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceListQuery. + class BetaSessionServiceListQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_list_sessions_request.rb b/lib/zitadel/client/models/beta_session_service_list_sessions_request.rb index 31277ef8..7f1659b1 100644 --- a/lib/zitadel/client/models/beta_session_service_list_sessions_request.rb +++ b/lib/zitadel/client/models/beta_session_service_list_sessions_request.rb @@ -1,257 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceListSessionsRequest - attr_accessor :query - - attr_accessor :queries - - attr_accessor :sorting_column - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'query' => :'query', - :'queries' => :'queries', - :'sorting_column' => :'sortingColumn' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'query' => :'BetaSessionServiceListQuery', - :'queries' => :'Array', - :'sorting_column' => :'BetaSessionServiceSessionFieldName' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceListSessionsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceListSessionsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - query == o.query && - queries == o.queries && - sorting_column == o.sorting_column - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [query, queries, sorting_column].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceListSessionsRequest. + class BetaSessionServiceListSessionsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + query: 'query', + queries: 'queries', + sorting_column: 'sortingColumn' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + query: 'BetaSessionServiceListQuery', + queries: 'Array', + sorting_column: 'BetaSessionServiceSessionFieldName' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_list_sessions_response.rb b/lib/zitadel/client/models/beta_session_service_list_sessions_response.rb index 34fdb453..6107f126 100644 --- a/lib/zitadel/client/models/beta_session_service_list_sessions_response.rb +++ b/lib/zitadel/client/models/beta_session_service_list_sessions_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceListSessionsResponse - attr_accessor :details - - attr_accessor :sessions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'sessions' => :'sessions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSessionServiceListDetails', - :'sessions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceListSessionsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceListSessionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'sessions') - if (value = attributes[:'sessions']).is_a?(Array) - self.sessions = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - sessions == o.sessions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, sessions].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceListSessionsResponse. + class BetaSessionServiceListSessionsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + sessions: 'sessions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSessionServiceListDetails', + sessions: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sessions, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_o_t_p_email.rb b/lib/zitadel/client/models/beta_session_service_o_t_p_email.rb deleted file mode 100644 index 40ee9a09..00000000 --- a/lib/zitadel/client/models/beta_session_service_o_t_p_email.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceOTPEmail - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'return_code' => :'Object', - :'send_code' => :'BetaSessionServiceSendCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceOTPEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceOTPEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_session_service_o_t_p_factor.rb b/lib/zitadel/client/models/beta_session_service_o_t_p_factor.rb deleted file mode 100644 index 3aed2973..00000000 --- a/lib/zitadel/client/models/beta_session_service_o_t_p_factor.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceOTPFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceOTPFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceOTPFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_session_service_o_t_p_s_m_s.rb b/lib/zitadel/client/models/beta_session_service_o_t_p_s_m_s.rb deleted file mode 100644 index 4180f045..00000000 --- a/lib/zitadel/client/models/beta_session_service_o_t_p_s_m_s.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceOTPSMS - attr_accessor :return_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'return_code' => :'returnCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'return_code' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceOTPSMS` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceOTPSMS`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - return_code == o.return_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [return_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_session_service_otp_email.rb b/lib/zitadel/client/models/beta_session_service_otp_email.rb new file mode 100644 index 00000000..e30b9781 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_otp_email.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceOTPEmail. + class BetaSessionServiceOTPEmail < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + return_code: 'Object', + send_code: 'BetaSessionServiceSendCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_session_service_otp_factor.rb b/lib/zitadel/client/models/beta_session_service_otp_factor.rb new file mode 100644 index 00000000..26402a69 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_otp_factor.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceOTPFactor. + class BetaSessionServiceOTPFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_session_service_otpsms.rb b/lib/zitadel/client/models/beta_session_service_otpsms.rb new file mode 100644 index 00000000..02e21f02 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_otpsms.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceOTPSMS. + class BetaSessionServiceOTPSMS < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + return_code: 'returnCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + return_code: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_session_service_password_factor.rb b/lib/zitadel/client/models/beta_session_service_password_factor.rb index 9efcbbde..4ef517e1 100644 --- a/lib/zitadel/client/models/beta_session_service_password_factor.rb +++ b/lib/zitadel/client/models/beta_session_service_password_factor.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServicePasswordFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServicePasswordFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServicePasswordFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServicePasswordFactor. + class BetaSessionServicePasswordFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_request_challenges.rb b/lib/zitadel/client/models/beta_session_service_request_challenges.rb index abb71806..24938c8a 100644 --- a/lib/zitadel/client/models/beta_session_service_request_challenges.rb +++ b/lib/zitadel/client/models/beta_session_service_request_challenges.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceRequestChallenges - attr_accessor :web_auth_n - - attr_accessor :otp_sms - - attr_accessor :otp_email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'web_auth_n' => :'webAuthN', - :'otp_sms' => :'otpSms', - :'otp_email' => :'otpEmail' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'web_auth_n' => :'BetaSessionServiceWebAuthN', - :'otp_sms' => :'BetaSessionServiceOTPSMS', - :'otp_email' => :'BetaSessionServiceOTPEmail' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceRequestChallenges` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceRequestChallenges`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'web_auth_n') - self.web_auth_n = attributes[:'web_auth_n'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] - end - - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - web_auth_n == o.web_auth_n && - otp_sms == o.otp_sms && - otp_email == o.otp_email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [web_auth_n, otp_sms, otp_email].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceRequestChallenges. + class BetaSessionServiceRequestChallenges < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + web_auth_n: 'webAuthN', + otp_sms: 'otpSms', + otp_email: 'otpEmail' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + web_auth_n: 'BetaSessionServiceWebAuthN', + otp_sms: 'BetaSessionServiceOTPSMS', + otp_email: 'BetaSessionServiceOTPEmail' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :web_auth_n, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_sms, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_email, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_search_query.rb b/lib/zitadel/client/models/beta_session_service_search_query.rb index 16460669..ad784f78 100644 --- a/lib/zitadel/client/models/beta_session_service_search_query.rb +++ b/lib/zitadel/client/models/beta_session_service_search_query.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceSearchQuery - attr_accessor :creation_date_query - - attr_accessor :ids_query - - attr_accessor :user_id_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date_query' => :'creationDateQuery', - :'ids_query' => :'idsQuery', - :'user_id_query' => :'userIdQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date_query' => :'BetaSessionServiceCreationDateQuery', - :'ids_query' => :'BetaSessionServiceIDsQuery', - :'user_id_query' => :'BetaSessionServiceUserIDQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date_query') - self.creation_date_query = attributes[:'creation_date_query'] - end - - if attributes.key?(:'ids_query') - self.ids_query = attributes[:'ids_query'] - end - - if attributes.key?(:'user_id_query') - self.user_id_query = attributes[:'user_id_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date_query == o.creation_date_query && - ids_query == o.ids_query && - user_id_query == o.user_id_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date_query, ids_query, user_id_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceSearchQuery. + class BetaSessionServiceSearchQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date_query: 'creationDateQuery', + ids_query: 'idsQuery', + user_id_query: 'userIdQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date_query: 'BetaSessionServiceCreationDateQuery', + ids_query: 'BetaSessionServiceIDsQuery', + user_id_query: 'BetaSessionServiceUserIDQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :creation_date_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ids_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_send_code.rb b/lib/zitadel/client/models/beta_session_service_send_code.rb index 5e4f6d1f..c15b48e1 100644 --- a/lib/zitadel/client/models/beta_session_service_send_code.rb +++ b/lib/zitadel/client/models/beta_session_service_send_code.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceSendCode - attr_accessor :url_template - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceSendCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceSendCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceSendCode. + class BetaSessionServiceSendCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_session_service_session.rb b/lib/zitadel/client/models/beta_session_service_session.rb index 1d88d7bb..426ccaaf 100644 --- a/lib/zitadel/client/models/beta_session_service_session.rb +++ b/lib/zitadel/client/models/beta_session_service_session.rb @@ -1,284 +1,106 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceSession - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :sequence - - attr_accessor :factors - - attr_accessor :metadata - - attr_accessor :user_agent - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'sequence' => :'sequence', - :'factors' => :'factors', - :'metadata' => :'metadata', - :'user_agent' => :'userAgent', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'sequence' => :'Object', - :'factors' => :'BetaSessionServiceFactors', - :'metadata' => :'Hash', - :'user_agent' => :'BetaSessionServiceUserAgent', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceSession` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'factors') - self.factors = attributes[:'factors'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'user_agent') - self.user_agent = attributes[:'user_agent'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - change_date == o.change_date && - sequence == o.sequence && - factors == o.factors && - metadata == o.metadata && - user_agent == o.user_agent && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, change_date, sequence, factors, metadata, user_agent, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceSession. + class BetaSessionServiceSession < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + change_date: 'changeDate', + sequence: 'sequence', + factors: 'factors', + metadata: 'metadata', + user_agent: 'userAgent', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + change_date: 'Time', + sequence: 'Object', + factors: 'BetaSessionServiceFactors', + metadata: 'Hash', + user_agent: 'BetaSessionServiceUserAgent', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + inner: 'byte[]', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # @example null + attribute :factors, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_agent, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_session_field_name.rb b/lib/zitadel/client/models/beta_session_service_session_field_name.rb index f3d88fca..a4b623ed 100644 --- a/lib/zitadel/client/models/beta_session_service_session_field_name.rb +++ b/lib/zitadel/client/models/beta_session_service_session_field_name.rb @@ -1,41 +1,61 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaSessionServiceSessionFieldName - SESSION_FIELD_NAME_UNSPECIFIED = "SESSION_FIELD_NAME_UNSPECIFIED".freeze - SESSION_FIELD_NAME_CREATION_DATE = "SESSION_FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [SESSION_FIELD_NAME_UNSPECIFIED, SESSION_FIELD_NAME_CREATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaSessionServiceSessionFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSessionServiceSessionFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaSessionServiceSessionFieldName. + class BetaSessionServiceSessionFieldName + SESSION_FIELD_NAME_UNSPECIFIED = 'SESSION_FIELD_NAME_UNSPECIFIED' + SESSION_FIELD_NAME_CREATION_DATE = 'SESSION_FIELD_NAME_CREATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [SESSION_FIELD_NAME_UNSPECIFIED, SESSION_FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaSessionServiceSessionFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_session_service_set_session_request.rb b/lib/zitadel/client/models/beta_session_service_set_session_request.rb index b7e87576..d6727f56 100644 --- a/lib/zitadel/client/models/beta_session_service_set_session_request.rb +++ b/lib/zitadel/client/models/beta_session_service_set_session_request.rb @@ -1,263 +1,96 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceSetSessionRequest - attr_accessor :session_id - - attr_accessor :session_token - - attr_accessor :checks - - attr_accessor :metadata - - attr_accessor :challenges - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :lifetime - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken', - :'checks' => :'checks', - :'metadata' => :'metadata', - :'challenges' => :'challenges', - :'lifetime' => :'lifetime' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'session_token' => :'String', - :'checks' => :'BetaSessionServiceChecks', - :'metadata' => :'Hash', - :'challenges' => :'BetaSessionServiceRequestChallenges', - :'lifetime' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceSetSessionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceSetSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - - if attributes.key?(:'checks') - self.checks = attributes[:'checks'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'challenges') - self.challenges = attributes[:'challenges'] - end - - if attributes.key?(:'lifetime') - self.lifetime = attributes[:'lifetime'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - session_token == o.session_token && - checks == o.checks && - metadata == o.metadata && - challenges == o.challenges && - lifetime == o.lifetime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, session_token, checks, metadata, challenges, lifetime].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceSetSessionRequest. + class BetaSessionServiceSetSessionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session_id: 'sessionId', + session_token: 'sessionToken', + checks: 'checks', + metadata: 'metadata', + challenges: 'challenges', + lifetime: 'lifetime' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session_id: 'String', + session_token: 'String', + checks: 'BetaSessionServiceChecks', + metadata: 'Hash', + challenges: 'BetaSessionServiceRequestChallenges', + lifetime: 'ISO8601::Duration' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + inner: 'byte[]', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :checks, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :challenges, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :lifetime, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_set_session_response.rb b/lib/zitadel/client/models/beta_session_service_set_session_response.rb index 1b7a95c6..4efae456 100644 --- a/lib/zitadel/client/models/beta_session_service_set_session_response.rb +++ b/lib/zitadel/client/models/beta_session_service_set_session_response.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceSetSessionResponse - attr_accessor :details - - attr_accessor :session_token - - attr_accessor :challenges - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'session_token' => :'sessionToken', - :'challenges' => :'challenges' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSessionServiceDetails', - :'session_token' => :'String', - :'challenges' => :'BetaSessionServiceChallenges' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceSetSessionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceSetSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - - if attributes.key?(:'challenges') - self.challenges = attributes[:'challenges'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - session_token == o.session_token && - challenges == o.challenges - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, session_token, challenges].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceSetSessionResponse. + class BetaSessionServiceSetSessionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + session_token: 'sessionToken', + challenges: 'challenges' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSessionServiceDetails', + session_token: 'String', + challenges: 'BetaSessionServiceChallenges' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :challenges, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_t_o_t_p_factor.rb b/lib/zitadel/client/models/beta_session_service_t_o_t_p_factor.rb deleted file mode 100644 index dbc9e463..00000000 --- a/lib/zitadel/client/models/beta_session_service_t_o_t_p_factor.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceTOTPFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceTOTPFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceTOTPFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_session_service_timestamp_query_method.rb b/lib/zitadel/client/models/beta_session_service_timestamp_query_method.rb index 34cbe75f..22dc62f3 100644 --- a/lib/zitadel/client/models/beta_session_service_timestamp_query_method.rb +++ b/lib/zitadel/client/models/beta_session_service_timestamp_query_method.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaSessionServiceTimestampQueryMethod - TIMESTAMP_QUERY_METHOD_EQUALS = "TIMESTAMP_QUERY_METHOD_EQUALS".freeze - TIMESTAMP_QUERY_METHOD_GREATER = "TIMESTAMP_QUERY_METHOD_GREATER".freeze - TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS = "TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS".freeze - TIMESTAMP_QUERY_METHOD_LESS = "TIMESTAMP_QUERY_METHOD_LESS".freeze - TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS = "TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaSessionServiceTimestampQueryMethod. + class BetaSessionServiceTimestampQueryMethod + TIMESTAMP_QUERY_METHOD_EQUALS = 'TIMESTAMP_QUERY_METHOD_EQUALS' + TIMESTAMP_QUERY_METHOD_GREATER = 'TIMESTAMP_QUERY_METHOD_GREATER' + TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS = 'TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS' + TIMESTAMP_QUERY_METHOD_LESS = 'TIMESTAMP_QUERY_METHOD_LESS' + TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS = 'TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS' - def self.all_vars - @all_vars ||= [TIMESTAMP_QUERY_METHOD_EQUALS, TIMESTAMP_QUERY_METHOD_GREATER, TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS, TIMESTAMP_QUERY_METHOD_LESS, TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [TIMESTAMP_QUERY_METHOD_EQUALS, TIMESTAMP_QUERY_METHOD_GREATER, TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS, TIMESTAMP_QUERY_METHOD_LESS, TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaSessionServiceTimestampQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSessionServiceTimestampQueryMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaSessionServiceTimestampQueryMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_session_service_totp_factor.rb b/lib/zitadel/client/models/beta_session_service_totp_factor.rb new file mode 100644 index 00000000..2358b5af --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_totp_factor.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceTOTPFactor. + class BetaSessionServiceTOTPFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_session_service_user_agent.rb b/lib/zitadel/client/models/beta_session_service_user_agent.rb index 86b221e7..0933add4 100644 --- a/lib/zitadel/client/models/beta_session_service_user_agent.rb +++ b/lib/zitadel/client/models/beta_session_service_user_agent.rb @@ -1,247 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceUserAgent - attr_accessor :fingerprint_id - - attr_accessor :ip - - attr_accessor :description - - attr_accessor :header - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fingerprint_id' => :'fingerprintId', - :'ip' => :'ip', - :'description' => :'description', - :'header' => :'header' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'fingerprint_id' => :'String', - :'ip' => :'String', - :'description' => :'String', - :'header' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'fingerprint_id', - :'ip', - :'description', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceUserAgent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceUserAgent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fingerprint_id') - self.fingerprint_id = attributes[:'fingerprint_id'] - end - - if attributes.key?(:'ip') - self.ip = attributes[:'ip'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'header') - if (value = attributes[:'header']).is_a?(Hash) - self.header = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fingerprint_id == o.fingerprint_id && - ip == o.ip && - description == o.description && - header == o.header - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fingerprint_id, ip, description, header].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceUserAgent. + class BetaSessionServiceUserAgent < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + fingerprint_id: 'fingerprintId', + ip: 'ip', + description: 'description', + header: 'header' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + fingerprint_id: 'String', + ip: 'String', + description: 'String', + header: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :fingerprint_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ip, Types::Any.optional.meta(omittable: true) + # @example null + attribute :description, Types::Any.optional.meta(omittable: true) + # @example null + attribute :header, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_user_factor.rb b/lib/zitadel/client/models/beta_session_service_user_factor.rb index ebc5a3ab..ccecbec1 100644 --- a/lib/zitadel/client/models/beta_session_service_user_factor.rb +++ b/lib/zitadel/client/models/beta_session_service_user_factor.rb @@ -1,252 +1,90 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceUserFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - attr_accessor :id - - attr_accessor :login_name - - attr_accessor :display_name - - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt', - :'id' => :'id', - :'login_name' => :'loginName', - :'display_name' => :'displayName', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time', - :'id' => :'String', - :'login_name' => :'String', - :'display_name' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceUserFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceUserFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'login_name') - self.login_name = attributes[:'login_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at && - id == o.id && - login_name == o.login_name && - display_name == o.display_name && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at, id, login_name, display_name, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceUserFactor. + class BetaSessionServiceUserFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt', + id: 'id', + login_name: 'loginName', + display_name: 'displayName', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time', + id: 'String', + login_name: 'String', + display_name: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_user_i_d_query.rb b/lib/zitadel/client/models/beta_session_service_user_i_d_query.rb deleted file mode 100644 index c9703ffd..00000000 --- a/lib/zitadel/client/models/beta_session_service_user_i_d_query.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceUserIDQuery - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceUserIDQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceUserIDQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_session_service_user_id_query.rb b/lib/zitadel/client/models/beta_session_service_user_id_query.rb new file mode 100644 index 00000000..5f3a0a51 --- /dev/null +++ b/lib/zitadel/client/models/beta_session_service_user_id_query.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceUserIDQuery. + class BetaSessionServiceUserIDQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_session_service_user_verification_requirement.rb b/lib/zitadel/client/models/beta_session_service_user_verification_requirement.rb index 43ea8c91..0c7be5fb 100644 --- a/lib/zitadel/client/models/beta_session_service_user_verification_requirement.rb +++ b/lib/zitadel/client/models/beta_session_service_user_verification_requirement.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaSessionServiceUserVerificationRequirement - USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED".freeze - USER_VERIFICATION_REQUIREMENT_REQUIRED = "USER_VERIFICATION_REQUIREMENT_REQUIRED".freeze - USER_VERIFICATION_REQUIREMENT_PREFERRED = "USER_VERIFICATION_REQUIREMENT_PREFERRED".freeze - USER_VERIFICATION_REQUIREMENT_DISCOURAGED = "USER_VERIFICATION_REQUIREMENT_DISCOURAGED".freeze - - def self.all_vars - @all_vars ||= [USER_VERIFICATION_REQUIREMENT_UNSPECIFIED, USER_VERIFICATION_REQUIREMENT_REQUIRED, USER_VERIFICATION_REQUIREMENT_PREFERRED, USER_VERIFICATION_REQUIREMENT_DISCOURAGED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaSessionServiceUserVerificationRequirement.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSessionServiceUserVerificationRequirement" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaSessionServiceUserVerificationRequirement. + class BetaSessionServiceUserVerificationRequirement + USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED' + USER_VERIFICATION_REQUIREMENT_REQUIRED = 'USER_VERIFICATION_REQUIREMENT_REQUIRED' + USER_VERIFICATION_REQUIREMENT_PREFERRED = 'USER_VERIFICATION_REQUIREMENT_PREFERRED' + USER_VERIFICATION_REQUIREMENT_DISCOURAGED = 'USER_VERIFICATION_REQUIREMENT_DISCOURAGED' + + # Frozen set of all allowed values, used for validation. + VALUES = [USER_VERIFICATION_REQUIREMENT_UNSPECIFIED, USER_VERIFICATION_REQUIREMENT_REQUIRED, USER_VERIFICATION_REQUIREMENT_PREFERRED, USER_VERIFICATION_REQUIREMENT_DISCOURAGED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaSessionServiceUserVerificationRequirement: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_session_service_web_auth_n.rb b/lib/zitadel/client/models/beta_session_service_web_auth_n.rb index 602af5ab..398c62a4 100644 --- a/lib/zitadel/client/models/beta_session_service_web_auth_n.rb +++ b/lib/zitadel/client/models/beta_session_service_web_auth_n.rb @@ -1,246 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceWebAuthN - attr_accessor :domain - - attr_accessor :user_verification_requirement - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain' => :'domain', - :'user_verification_requirement' => :'userVerificationRequirement' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain' => :'String', - :'user_verification_requirement' => :'BetaSessionServiceUserVerificationRequirement' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceWebAuthN` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceWebAuthN`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'user_verification_requirement') - self.user_verification_requirement = attributes[:'user_verification_requirement'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain == o.domain && - user_verification_requirement == o.user_verification_requirement - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain, user_verification_requirement].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceWebAuthN. + class BetaSessionServiceWebAuthN < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain: 'domain', + user_verification_requirement: 'userVerificationRequirement' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain: 'String', + user_verification_requirement: 'BetaSessionServiceUserVerificationRequirement' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_verification_requirement, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_session_service_web_auth_n_factor.rb b/lib/zitadel/client/models/beta_session_service_web_auth_n_factor.rb index a45300f9..4b7d849c 100644 --- a/lib/zitadel/client/models/beta_session_service_web_auth_n_factor.rb +++ b/lib/zitadel/client/models/beta_session_service_web_auth_n_factor.rb @@ -1,225 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSessionServiceWebAuthNFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - attr_accessor :user_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt', - :'user_verified' => :'userVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time', - :'user_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSessionServiceWebAuthNFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSessionServiceWebAuthNFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - - if attributes.key?(:'user_verified') - self.user_verified = attributes[:'user_verified'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at && - user_verified == o.user_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at, user_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSessionServiceWebAuthNFactor. + class BetaSessionServiceWebAuthNFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt', + user_verified: 'userVerified' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time', + user_verified: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_verified, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_any.rb b/lib/zitadel/client/models/beta_settings_service_any.rb index 347af12c..19191c6b 100644 --- a/lib/zitadel/client/models/beta_settings_service_any.rb +++ b/lib/zitadel/client/models/beta_settings_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaSettingsServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaSettingsServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_branding_settings.rb b/lib/zitadel/client/models/beta_settings_service_branding_settings.rb index 9993c960..2166e7c3 100644 --- a/lib/zitadel/client/models/beta_settings_service_branding_settings.rb +++ b/lib/zitadel/client/models/beta_settings_service_branding_settings.rb @@ -1,292 +1,98 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceBrandingSettings - attr_accessor :light_theme - - attr_accessor :dark_theme - - attr_accessor :font_url - - # hides the org suffix on the login form if the scope \\\"urn:zitadel:iam:org:domain:primary:{domainname}\\\" is set - attr_accessor :hide_login_name_suffix - - attr_accessor :disable_watermark - - attr_accessor :resource_owner_type - - attr_accessor :theme_mode - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'light_theme' => :'lightTheme', - :'dark_theme' => :'darkTheme', - :'font_url' => :'fontUrl', - :'hide_login_name_suffix' => :'hideLoginNameSuffix', - :'disable_watermark' => :'disableWatermark', - :'resource_owner_type' => :'resourceOwnerType', - :'theme_mode' => :'themeMode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'light_theme' => :'BetaSettingsServiceTheme', - :'dark_theme' => :'BetaSettingsServiceTheme', - :'font_url' => :'String', - :'hide_login_name_suffix' => :'Boolean', - :'disable_watermark' => :'Boolean', - :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType', - :'theme_mode' => :'BetaSettingsServiceThemeMode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceBrandingSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceBrandingSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'light_theme') - self.light_theme = attributes[:'light_theme'] - end - - if attributes.key?(:'dark_theme') - self.dark_theme = attributes[:'dark_theme'] - end - - if attributes.key?(:'font_url') - self.font_url = attributes[:'font_url'] - end - - if attributes.key?(:'hide_login_name_suffix') - self.hide_login_name_suffix = attributes[:'hide_login_name_suffix'] - end - - if attributes.key?(:'disable_watermark') - self.disable_watermark = attributes[:'disable_watermark'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - - if attributes.key?(:'theme_mode') - self.theme_mode = attributes[:'theme_mode'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - light_theme == o.light_theme && - dark_theme == o.dark_theme && - font_url == o.font_url && - hide_login_name_suffix == o.hide_login_name_suffix && - disable_watermark == o.disable_watermark && - resource_owner_type == o.resource_owner_type && - theme_mode == o.theme_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [light_theme, dark_theme, font_url, hide_login_name_suffix, disable_watermark, resource_owner_type, theme_mode].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceBrandingSettings. + class BetaSettingsServiceBrandingSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + light_theme: 'lightTheme', + dark_theme: 'darkTheme', + font_url: 'fontUrl', + hide_login_name_suffix: 'hideLoginNameSuffix', + disable_watermark: 'disableWatermark', + resource_owner_type: 'resourceOwnerType', + theme_mode: 'themeMode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + light_theme: 'BetaSettingsServiceTheme', + dark_theme: 'BetaSettingsServiceTheme', + font_url: 'String', + hide_login_name_suffix: 'Boolean', + disable_watermark: 'Boolean', + resource_owner_type: 'BetaSettingsServiceResourceOwnerType', + theme_mode: 'BetaSettingsServiceThemeMode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :light_theme, Types::Any.optional.meta(omittable: true) + # @example null + attribute :dark_theme, Types::Any.optional.meta(omittable: true) + # @example null + attribute :font_url, Types::Any.optional.meta(omittable: true) + # hides the org suffix on the login form if the scope \\\"urn:zitadel:iam:org:domain:primary:{domainname}\\\" is set + # @example null + attribute :hide_login_name_suffix, Types::Any.optional.meta(omittable: true) + # @example null + attribute :disable_watermark, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :theme_mode, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_connect_error.rb b/lib/zitadel/client/models/beta_settings_service_connect_error.rb index 2f530135..a116f6e8 100644 --- a/lib/zitadel/client/models/beta_settings_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_settings_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaSettingsServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaSettingsServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_details.rb b/lib/zitadel/client/models/beta_settings_service_details.rb index 910954ef..468c37d1 100644 --- a/lib/zitadel/client/models/beta_settings_service_details.rb +++ b/lib/zitadel/client/models/beta_settings_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceDetails. + class BetaSettingsServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_domain_settings.rb b/lib/zitadel/client/models/beta_settings_service_domain_settings.rb index f45764fc..dfe107d2 100644 --- a/lib/zitadel/client/models/beta_settings_service_domain_settings.rb +++ b/lib/zitadel/client/models/beta_settings_service_domain_settings.rb @@ -1,264 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceDomainSettings - attr_accessor :login_name_includes_domain - - attr_accessor :require_org_domain_verification - - attr_accessor :smtp_sender_address_matches_instance_domain - - attr_accessor :resource_owner_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_name_includes_domain' => :'loginNameIncludesDomain', - :'require_org_domain_verification' => :'requireOrgDomainVerification', - :'smtp_sender_address_matches_instance_domain' => :'smtpSenderAddressMatchesInstanceDomain', - :'resource_owner_type' => :'resourceOwnerType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_name_includes_domain' => :'Boolean', - :'require_org_domain_verification' => :'Boolean', - :'smtp_sender_address_matches_instance_domain' => :'Boolean', - :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceDomainSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceDomainSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_name_includes_domain') - self.login_name_includes_domain = attributes[:'login_name_includes_domain'] - end - - if attributes.key?(:'require_org_domain_verification') - self.require_org_domain_verification = attributes[:'require_org_domain_verification'] - end - - if attributes.key?(:'smtp_sender_address_matches_instance_domain') - self.smtp_sender_address_matches_instance_domain = attributes[:'smtp_sender_address_matches_instance_domain'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_name_includes_domain == o.login_name_includes_domain && - require_org_domain_verification == o.require_org_domain_verification && - smtp_sender_address_matches_instance_domain == o.smtp_sender_address_matches_instance_domain && - resource_owner_type == o.resource_owner_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_name_includes_domain, require_org_domain_verification, smtp_sender_address_matches_instance_domain, resource_owner_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceDomainSettings. + class BetaSettingsServiceDomainSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_name_includes_domain: 'loginNameIncludesDomain', + require_org_domain_verification: 'requireOrgDomainVerification', + smtp_sender_address_matches_instance_domain: 'smtpSenderAddressMatchesInstanceDomain', + resource_owner_type: 'resourceOwnerType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_name_includes_domain: 'Boolean', + require_org_domain_verification: 'Boolean', + smtp_sender_address_matches_instance_domain: 'Boolean', + resource_owner_type: 'BetaSettingsServiceResourceOwnerType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_name_includes_domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :require_org_domain_verification, Types::Any.optional.meta(omittable: true) + # @example null + attribute :smtp_sender_address_matches_instance_domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rb b/lib/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rb index 485b9f82..69835a1a 100644 --- a/lib/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rb +++ b/lib/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceEmbeddedIframeSettings - attr_accessor :enabled - - attr_accessor :allowed_origins - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enabled' => :'enabled', - :'allowed_origins' => :'allowedOrigins' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'enabled' => :'Boolean', - :'allowed_origins' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceEmbeddedIframeSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceEmbeddedIframeSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enabled') - self.enabled = attributes[:'enabled'] - end - - if attributes.key?(:'allowed_origins') - if (value = attributes[:'allowed_origins']).is_a?(Array) - self.allowed_origins = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enabled == o.enabled && - allowed_origins == o.allowed_origins - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enabled, allowed_origins].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceEmbeddedIframeSettings. + class BetaSettingsServiceEmbeddedIframeSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + enabled: 'enabled', + allowed_origins: 'allowedOrigins' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + enabled: 'Boolean', + allowed_origins: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :enabled, Types::Any.optional.meta(omittable: true) + # @example null + attribute :allowed_origins, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rb b/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rb index a11f969e..78b3de71 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetActiveIdentityProvidersRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'BetaSettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetActiveIdentityProvidersRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetActiveIdentityProvidersRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetActiveIdentityProvidersRequest. + class BetaSettingsServiceGetActiveIdentityProvidersRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'BetaSettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rb b/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rb index 84a4b2b6..90d86f56 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetActiveIdentityProvidersResponse - attr_accessor :details - - attr_accessor :identity_providers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'identity_providers' => :'identityProviders' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceListDetails', - :'identity_providers' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetActiveIdentityProvidersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetActiveIdentityProvidersResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'identity_providers') - if (value = attributes[:'identity_providers']).is_a?(Array) - self.identity_providers = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - identity_providers == o.identity_providers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, identity_providers].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetActiveIdentityProvidersResponse. + class BetaSettingsServiceGetActiveIdentityProvidersResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + identity_providers: 'identityProviders' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceListDetails', + identity_providers: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :identity_providers, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_branding_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_branding_settings_request.rb index e0220958..6a72d61e 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_branding_settings_request.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_branding_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetBrandingSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'BetaSettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetBrandingSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetBrandingSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetBrandingSettingsRequest. + class BetaSettingsServiceGetBrandingSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'BetaSettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_branding_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_branding_settings_response.rb index 3fcfa402..c29eefb6 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_branding_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_branding_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetBrandingSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceDetails', - :'settings' => :'BetaSettingsServiceBrandingSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetBrandingSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetBrandingSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetBrandingSettingsResponse. + class BetaSettingsServiceGetBrandingSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceDetails', + settings: 'BetaSettingsServiceBrandingSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_domain_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_domain_settings_request.rb index 2303f70e..e18d91e9 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_domain_settings_request.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_domain_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetDomainSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'BetaSettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetDomainSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetDomainSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetDomainSettingsRequest. + class BetaSettingsServiceGetDomainSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'BetaSettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_domain_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_domain_settings_response.rb index 01087298..a4d820d3 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_domain_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_domain_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetDomainSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceDetails', - :'settings' => :'BetaSettingsServiceDomainSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetDomainSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetDomainSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetDomainSettingsResponse. + class BetaSettingsServiceGetDomainSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceDetails', + settings: 'BetaSettingsServiceDomainSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_general_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_general_settings_response.rb index 2ed202a4..a1e82edd 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_general_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_general_settings_response.rb @@ -1,235 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetGeneralSettingsResponse - attr_accessor :default_org_id - - attr_accessor :default_language - - attr_accessor :supported_languages - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'default_org_id' => :'defaultOrgId', - :'default_language' => :'defaultLanguage', - :'supported_languages' => :'supportedLanguages' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'default_org_id' => :'String', - :'default_language' => :'String', - :'supported_languages' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetGeneralSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetGeneralSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'default_org_id') - self.default_org_id = attributes[:'default_org_id'] - end - - if attributes.key?(:'default_language') - self.default_language = attributes[:'default_language'] - end - - if attributes.key?(:'supported_languages') - if (value = attributes[:'supported_languages']).is_a?(Array) - self.supported_languages = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - default_org_id == o.default_org_id && - default_language == o.default_language && - supported_languages == o.supported_languages - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [default_org_id, default_language, supported_languages].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetGeneralSettingsResponse. + class BetaSettingsServiceGetGeneralSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + default_org_id: 'defaultOrgId', + default_language: 'defaultLanguage', + supported_languages: 'supportedLanguages' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + default_org_id: 'String', + default_language: 'String', + supported_languages: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :default_org_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :default_language, Types::Any.optional.meta(omittable: true) + # @example null + attribute :supported_languages, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rb index 05b2e70c..b71ebd5e 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetLegalAndSupportSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'BetaSettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLegalAndSupportSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLegalAndSupportSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetLegalAndSupportSettingsRequest. + class BetaSettingsServiceGetLegalAndSupportSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'BetaSettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rb index 963b876d..dc8bf5c1 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetLegalAndSupportSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceDetails', - :'settings' => :'BetaSettingsServiceLegalAndSupportSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLegalAndSupportSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLegalAndSupportSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetLegalAndSupportSettingsResponse. + class BetaSettingsServiceGetLegalAndSupportSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceDetails', + settings: 'BetaSettingsServiceLegalAndSupportSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rb index 33363a6c..09780229 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetLockoutSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'BetaSettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLockoutSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLockoutSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetLockoutSettingsRequest. + class BetaSettingsServiceGetLockoutSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'BetaSettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rb index e44b6614..550192e6 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetLockoutSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceDetails', - :'settings' => :'BetaSettingsServiceLockoutSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLockoutSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLockoutSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetLockoutSettingsResponse. + class BetaSettingsServiceGetLockoutSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceDetails', + settings: 'BetaSettingsServiceLockoutSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_login_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_login_settings_request.rb index 61142a08..e5074ab1 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_login_settings_request.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_login_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetLoginSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'BetaSettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLoginSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLoginSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetLoginSettingsRequest. + class BetaSettingsServiceGetLoginSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'BetaSettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_login_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_login_settings_response.rb index a52089f8..425c70a5 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_login_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_login_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetLoginSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceDetails', - :'settings' => :'BetaSettingsServiceLoginSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetLoginSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetLoginSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetLoginSettingsResponse. + class BetaSettingsServiceGetLoginSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceDetails', + settings: 'BetaSettingsServiceLoginSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rb index 952a5d1e..2f6b82e4 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetPasswordComplexitySettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'BetaSettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordComplexitySettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordComplexitySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetPasswordComplexitySettingsRequest. + class BetaSettingsServiceGetPasswordComplexitySettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'BetaSettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rb index e73e871a..502071cb 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetPasswordComplexitySettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceDetails', - :'settings' => :'BetaSettingsServicePasswordComplexitySettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordComplexitySettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordComplexitySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetPasswordComplexitySettingsResponse. + class BetaSettingsServiceGetPasswordComplexitySettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceDetails', + settings: 'BetaSettingsServicePasswordComplexitySettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rb index 23a3ad85..8ddd69b1 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetPasswordExpirySettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'BetaSettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordExpirySettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordExpirySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetPasswordExpirySettingsRequest. + class BetaSettingsServiceGetPasswordExpirySettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'BetaSettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rb index dd314ef7..67e99d2b 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetPasswordExpirySettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceDetails', - :'settings' => :'BetaSettingsServicePasswordExpirySettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordExpirySettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetPasswordExpirySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetPasswordExpirySettingsResponse. + class BetaSettingsServiceGetPasswordExpirySettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceDetails', + settings: 'BetaSettingsServicePasswordExpirySettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_get_security_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_get_security_settings_response.rb index aa5da182..73fd2226 100644 --- a/lib/zitadel/client/models/beta_settings_service_get_security_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_get_security_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceGetSecuritySettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceDetails', - :'settings' => :'BetaSettingsServiceSecuritySettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceGetSecuritySettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceGetSecuritySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceGetSecuritySettingsResponse. + class BetaSettingsServiceGetSecuritySettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceDetails', + settings: 'BetaSettingsServiceSecuritySettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_identity_provider.rb b/lib/zitadel/client/models/beta_settings_service_identity_provider.rb index 1490ba39..a98a5ace 100644 --- a/lib/zitadel/client/models/beta_settings_service_identity_provider.rb +++ b/lib/zitadel/client/models/beta_settings_service_identity_provider.rb @@ -1,255 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceIdentityProvider - attr_accessor :id - - attr_accessor :name - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'type' => :'type' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'type' => :'BetaSettingsServiceIdentityProviderType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceIdentityProvider` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceIdentityProvider`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceIdentityProvider. + class BetaSettingsServiceIdentityProvider < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name', + type: 'type' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String', + type: 'BetaSettingsServiceIdentityProviderType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_identity_provider_type.rb b/lib/zitadel/client/models/beta_settings_service_identity_provider_type.rb index 8f9db3f3..45555c5c 100644 --- a/lib/zitadel/client/models/beta_settings_service_identity_provider_type.rb +++ b/lib/zitadel/client/models/beta_settings_service_identity_provider_type.rb @@ -1,51 +1,71 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaSettingsServiceIdentityProviderType - IDENTITY_PROVIDER_TYPE_UNSPECIFIED = "IDENTITY_PROVIDER_TYPE_UNSPECIFIED".freeze - IDENTITY_PROVIDER_TYPE_OIDC = "IDENTITY_PROVIDER_TYPE_OIDC".freeze - IDENTITY_PROVIDER_TYPE_JWT = "IDENTITY_PROVIDER_TYPE_JWT".freeze - IDENTITY_PROVIDER_TYPE_LDAP = "IDENTITY_PROVIDER_TYPE_LDAP".freeze - IDENTITY_PROVIDER_TYPE_OAUTH = "IDENTITY_PROVIDER_TYPE_OAUTH".freeze - IDENTITY_PROVIDER_TYPE_AZURE_AD = "IDENTITY_PROVIDER_TYPE_AZURE_AD".freeze - IDENTITY_PROVIDER_TYPE_GITHUB = "IDENTITY_PROVIDER_TYPE_GITHUB".freeze - IDENTITY_PROVIDER_TYPE_GITHUB_ES = "IDENTITY_PROVIDER_TYPE_GITHUB_ES".freeze - IDENTITY_PROVIDER_TYPE_GITLAB = "IDENTITY_PROVIDER_TYPE_GITLAB".freeze - IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED = "IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED".freeze - IDENTITY_PROVIDER_TYPE_GOOGLE = "IDENTITY_PROVIDER_TYPE_GOOGLE".freeze - IDENTITY_PROVIDER_TYPE_SAML = "IDENTITY_PROVIDER_TYPE_SAML".freeze - - def self.all_vars - @all_vars ||= [IDENTITY_PROVIDER_TYPE_UNSPECIFIED, IDENTITY_PROVIDER_TYPE_OIDC, IDENTITY_PROVIDER_TYPE_JWT, IDENTITY_PROVIDER_TYPE_LDAP, IDENTITY_PROVIDER_TYPE_OAUTH, IDENTITY_PROVIDER_TYPE_AZURE_AD, IDENTITY_PROVIDER_TYPE_GITHUB, IDENTITY_PROVIDER_TYPE_GITHUB_ES, IDENTITY_PROVIDER_TYPE_GITLAB, IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED, IDENTITY_PROVIDER_TYPE_GOOGLE, IDENTITY_PROVIDER_TYPE_SAML].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaSettingsServiceIdentityProviderType. + class BetaSettingsServiceIdentityProviderType + IDENTITY_PROVIDER_TYPE_UNSPECIFIED = 'IDENTITY_PROVIDER_TYPE_UNSPECIFIED' + IDENTITY_PROVIDER_TYPE_OIDC = 'IDENTITY_PROVIDER_TYPE_OIDC' + IDENTITY_PROVIDER_TYPE_JWT = 'IDENTITY_PROVIDER_TYPE_JWT' + IDENTITY_PROVIDER_TYPE_LDAP = 'IDENTITY_PROVIDER_TYPE_LDAP' + IDENTITY_PROVIDER_TYPE_OAUTH = 'IDENTITY_PROVIDER_TYPE_OAUTH' + IDENTITY_PROVIDER_TYPE_AZURE_AD = 'IDENTITY_PROVIDER_TYPE_AZURE_AD' + IDENTITY_PROVIDER_TYPE_GITHUB = 'IDENTITY_PROVIDER_TYPE_GITHUB' + IDENTITY_PROVIDER_TYPE_GITHUB_ES = 'IDENTITY_PROVIDER_TYPE_GITHUB_ES' + IDENTITY_PROVIDER_TYPE_GITLAB = 'IDENTITY_PROVIDER_TYPE_GITLAB' + IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED = 'IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED' + IDENTITY_PROVIDER_TYPE_GOOGLE = 'IDENTITY_PROVIDER_TYPE_GOOGLE' + IDENTITY_PROVIDER_TYPE_SAML = 'IDENTITY_PROVIDER_TYPE_SAML' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [IDENTITY_PROVIDER_TYPE_UNSPECIFIED, IDENTITY_PROVIDER_TYPE_OIDC, IDENTITY_PROVIDER_TYPE_JWT, IDENTITY_PROVIDER_TYPE_LDAP, IDENTITY_PROVIDER_TYPE_OAUTH, IDENTITY_PROVIDER_TYPE_AZURE_AD, IDENTITY_PROVIDER_TYPE_GITHUB, IDENTITY_PROVIDER_TYPE_GITHUB_ES, IDENTITY_PROVIDER_TYPE_GITLAB, IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED, IDENTITY_PROVIDER_TYPE_GOOGLE, IDENTITY_PROVIDER_TYPE_SAML].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaSettingsServiceIdentityProviderType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceIdentityProviderType" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaSettingsServiceIdentityProviderType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_settings_service_legal_and_support_settings.rb b/lib/zitadel/client/models/beta_settings_service_legal_and_support_settings.rb index 3dd38d1f..dbae1560 100644 --- a/lib/zitadel/client/models/beta_settings_service_legal_and_support_settings.rb +++ b/lib/zitadel/client/models/beta_settings_service_legal_and_support_settings.rb @@ -1,300 +1,101 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceLegalAndSupportSettings - attr_accessor :tos_link - - attr_accessor :privacy_policy_link - - attr_accessor :help_link - - attr_accessor :support_email - - attr_accessor :resource_owner_type - - attr_accessor :docs_link - - attr_accessor :custom_link - - attr_accessor :custom_link_text - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tos_link' => :'tosLink', - :'privacy_policy_link' => :'privacyPolicyLink', - :'help_link' => :'helpLink', - :'support_email' => :'supportEmail', - :'resource_owner_type' => :'resourceOwnerType', - :'docs_link' => :'docsLink', - :'custom_link' => :'customLink', - :'custom_link_text' => :'customLinkText' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'tos_link' => :'String', - :'privacy_policy_link' => :'String', - :'help_link' => :'String', - :'support_email' => :'String', - :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType', - :'docs_link' => :'String', - :'custom_link' => :'String', - :'custom_link_text' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceLegalAndSupportSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceLegalAndSupportSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tos_link') - self.tos_link = attributes[:'tos_link'] - end - - if attributes.key?(:'privacy_policy_link') - self.privacy_policy_link = attributes[:'privacy_policy_link'] - end - - if attributes.key?(:'help_link') - self.help_link = attributes[:'help_link'] - end - - if attributes.key?(:'support_email') - self.support_email = attributes[:'support_email'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - - if attributes.key?(:'docs_link') - self.docs_link = attributes[:'docs_link'] - end - - if attributes.key?(:'custom_link') - self.custom_link = attributes[:'custom_link'] - end - - if attributes.key?(:'custom_link_text') - self.custom_link_text = attributes[:'custom_link_text'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tos_link == o.tos_link && - privacy_policy_link == o.privacy_policy_link && - help_link == o.help_link && - support_email == o.support_email && - resource_owner_type == o.resource_owner_type && - docs_link == o.docs_link && - custom_link == o.custom_link && - custom_link_text == o.custom_link_text - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tos_link, privacy_policy_link, help_link, support_email, resource_owner_type, docs_link, custom_link, custom_link_text].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceLegalAndSupportSettings. + class BetaSettingsServiceLegalAndSupportSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + tos_link: 'tosLink', + privacy_policy_link: 'privacyPolicyLink', + help_link: 'helpLink', + support_email: 'supportEmail', + resource_owner_type: 'resourceOwnerType', + docs_link: 'docsLink', + custom_link: 'customLink', + custom_link_text: 'customLinkText' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + tos_link: 'String', + privacy_policy_link: 'String', + help_link: 'String', + support_email: 'String', + resource_owner_type: 'BetaSettingsServiceResourceOwnerType', + docs_link: 'String', + custom_link: 'String', + custom_link_text: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :tos_link, Types::Any.optional.meta(omittable: true) + # @example null + attribute :privacy_policy_link, Types::Any.optional.meta(omittable: true) + # @example null + attribute :help_link, Types::Any.optional.meta(omittable: true) + # @example null + attribute :support_email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :docs_link, Types::Any.optional.meta(omittable: true) + # @example null + attribute :custom_link, Types::Any.optional.meta(omittable: true) + # @example null + attribute :custom_link_text, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_list_details.rb b/lib/zitadel/client/models/beta_settings_service_list_details.rb index 4ce0d8b2..57ba5dad 100644 --- a/lib/zitadel/client/models/beta_settings_service_list_details.rb +++ b/lib/zitadel/client/models/beta_settings_service_list_details.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceListDetails - attr_accessor :total_result - - attr_accessor :processed_sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'processed_sequence' => :'processedSequence', - :'timestamp' => :'timestamp' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'processed_sequence' => :'Object', - :'timestamp' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'processed_sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceListDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'processed_sequence') - self.processed_sequence = attributes[:'processed_sequence'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - processed_sequence == o.processed_sequence && - timestamp == o.timestamp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, processed_sequence, timestamp].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceListDetails. + class BetaSettingsServiceListDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + processed_sequence: 'processedSequence', + timestamp: 'timestamp' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + processed_sequence: 'Object', + timestamp: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # @example null + attribute :processed_sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_lockout_settings.rb b/lib/zitadel/client/models/beta_settings_service_lockout_settings.rb index 2fd59018..fd7f81a7 100644 --- a/lib/zitadel/client/models/beta_settings_service_lockout_settings.rb +++ b/lib/zitadel/client/models/beta_settings_service_lockout_settings.rb @@ -1,257 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceLockoutSettings - attr_accessor :max_password_attempts - - attr_accessor :resource_owner_type - - attr_accessor :max_otp_attempts - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'max_password_attempts' => :'maxPasswordAttempts', - :'resource_owner_type' => :'resourceOwnerType', - :'max_otp_attempts' => :'maxOtpAttempts' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'max_password_attempts' => :'Object', - :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType', - :'max_otp_attempts' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'max_password_attempts', - :'max_otp_attempts' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceLockoutSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceLockoutSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'max_password_attempts') - self.max_password_attempts = attributes[:'max_password_attempts'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - - if attributes.key?(:'max_otp_attempts') - self.max_otp_attempts = attributes[:'max_otp_attempts'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - max_password_attempts == o.max_password_attempts && - resource_owner_type == o.resource_owner_type && - max_otp_attempts == o.max_otp_attempts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [max_password_attempts, resource_owner_type, max_otp_attempts].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceLockoutSettings. + class BetaSettingsServiceLockoutSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + max_password_attempts: 'maxPasswordAttempts', + resource_owner_type: 'resourceOwnerType', + max_otp_attempts: 'maxOtpAttempts' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + max_password_attempts: 'Object', + resource_owner_type: 'BetaSettingsServiceResourceOwnerType', + max_otp_attempts: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :max_password_attempts, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :max_otp_attempts, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_login_settings.rb b/lib/zitadel/client/models/beta_settings_service_login_settings.rb index 442c6412..f913736e 100644 --- a/lib/zitadel/client/models/beta_settings_service_login_settings.rb +++ b/lib/zitadel/client/models/beta_settings_service_login_settings.rb @@ -1,418 +1,155 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceLoginSettings - attr_accessor :allow_username_password - - attr_accessor :allow_register - - attr_accessor :allow_external_idp - - attr_accessor :force_mfa - - attr_accessor :passkeys_type - - attr_accessor :hide_password_reset - - attr_accessor :ignore_unknown_usernames - - attr_accessor :default_redirect_uri - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :password_check_lifetime - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :external_login_check_lifetime - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :mfa_init_skip_lifetime - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :second_factor_check_lifetime - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :multi_factor_check_lifetime - - attr_accessor :second_factors - - attr_accessor :multi_factors - - # If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the org domains and will redirect to the registration of that organization on success. - attr_accessor :allow_domain_discovery - - attr_accessor :disable_login_with_email - - attr_accessor :disable_login_with_phone - - attr_accessor :resource_owner_type - - attr_accessor :force_mfa_local_only - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'allow_username_password' => :'allowUsernamePassword', - :'allow_register' => :'allowRegister', - :'allow_external_idp' => :'allowExternalIdp', - :'force_mfa' => :'forceMfa', - :'passkeys_type' => :'passkeysType', - :'hide_password_reset' => :'hidePasswordReset', - :'ignore_unknown_usernames' => :'ignoreUnknownUsernames', - :'default_redirect_uri' => :'defaultRedirectUri', - :'password_check_lifetime' => :'passwordCheckLifetime', - :'external_login_check_lifetime' => :'externalLoginCheckLifetime', - :'mfa_init_skip_lifetime' => :'mfaInitSkipLifetime', - :'second_factor_check_lifetime' => :'secondFactorCheckLifetime', - :'multi_factor_check_lifetime' => :'multiFactorCheckLifetime', - :'second_factors' => :'secondFactors', - :'multi_factors' => :'multiFactors', - :'allow_domain_discovery' => :'allowDomainDiscovery', - :'disable_login_with_email' => :'disableLoginWithEmail', - :'disable_login_with_phone' => :'disableLoginWithPhone', - :'resource_owner_type' => :'resourceOwnerType', - :'force_mfa_local_only' => :'forceMfaLocalOnly' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'allow_username_password' => :'Boolean', - :'allow_register' => :'Boolean', - :'allow_external_idp' => :'Boolean', - :'force_mfa' => :'Boolean', - :'passkeys_type' => :'BetaSettingsServicePasskeysType', - :'hide_password_reset' => :'Boolean', - :'ignore_unknown_usernames' => :'Boolean', - :'default_redirect_uri' => :'String', - :'password_check_lifetime' => :'String', - :'external_login_check_lifetime' => :'String', - :'mfa_init_skip_lifetime' => :'String', - :'second_factor_check_lifetime' => :'String', - :'multi_factor_check_lifetime' => :'String', - :'second_factors' => :'Array', - :'multi_factors' => :'Array', - :'allow_domain_discovery' => :'Boolean', - :'disable_login_with_email' => :'Boolean', - :'disable_login_with_phone' => :'Boolean', - :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType', - :'force_mfa_local_only' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceLoginSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceLoginSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'allow_username_password') - self.allow_username_password = attributes[:'allow_username_password'] - end - - if attributes.key?(:'allow_register') - self.allow_register = attributes[:'allow_register'] - end - - if attributes.key?(:'allow_external_idp') - self.allow_external_idp = attributes[:'allow_external_idp'] - end - - if attributes.key?(:'force_mfa') - self.force_mfa = attributes[:'force_mfa'] - end - - if attributes.key?(:'passkeys_type') - self.passkeys_type = attributes[:'passkeys_type'] - end - - if attributes.key?(:'hide_password_reset') - self.hide_password_reset = attributes[:'hide_password_reset'] - end - - if attributes.key?(:'ignore_unknown_usernames') - self.ignore_unknown_usernames = attributes[:'ignore_unknown_usernames'] - end - - if attributes.key?(:'default_redirect_uri') - self.default_redirect_uri = attributes[:'default_redirect_uri'] - end - - if attributes.key?(:'password_check_lifetime') - self.password_check_lifetime = attributes[:'password_check_lifetime'] - end - - if attributes.key?(:'external_login_check_lifetime') - self.external_login_check_lifetime = attributes[:'external_login_check_lifetime'] - end - - if attributes.key?(:'mfa_init_skip_lifetime') - self.mfa_init_skip_lifetime = attributes[:'mfa_init_skip_lifetime'] - end - - if attributes.key?(:'second_factor_check_lifetime') - self.second_factor_check_lifetime = attributes[:'second_factor_check_lifetime'] - end - - if attributes.key?(:'multi_factor_check_lifetime') - self.multi_factor_check_lifetime = attributes[:'multi_factor_check_lifetime'] - end - - if attributes.key?(:'second_factors') - if (value = attributes[:'second_factors']).is_a?(Array) - self.second_factors = value - end - end - - if attributes.key?(:'multi_factors') - if (value = attributes[:'multi_factors']).is_a?(Array) - self.multi_factors = value - end - end - - if attributes.key?(:'allow_domain_discovery') - self.allow_domain_discovery = attributes[:'allow_domain_discovery'] - end - - if attributes.key?(:'disable_login_with_email') - self.disable_login_with_email = attributes[:'disable_login_with_email'] - end - - if attributes.key?(:'disable_login_with_phone') - self.disable_login_with_phone = attributes[:'disable_login_with_phone'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - - if attributes.key?(:'force_mfa_local_only') - self.force_mfa_local_only = attributes[:'force_mfa_local_only'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - allow_username_password == o.allow_username_password && - allow_register == o.allow_register && - allow_external_idp == o.allow_external_idp && - force_mfa == o.force_mfa && - passkeys_type == o.passkeys_type && - hide_password_reset == o.hide_password_reset && - ignore_unknown_usernames == o.ignore_unknown_usernames && - default_redirect_uri == o.default_redirect_uri && - password_check_lifetime == o.password_check_lifetime && - external_login_check_lifetime == o.external_login_check_lifetime && - mfa_init_skip_lifetime == o.mfa_init_skip_lifetime && - second_factor_check_lifetime == o.second_factor_check_lifetime && - multi_factor_check_lifetime == o.multi_factor_check_lifetime && - second_factors == o.second_factors && - multi_factors == o.multi_factors && - allow_domain_discovery == o.allow_domain_discovery && - disable_login_with_email == o.disable_login_with_email && - disable_login_with_phone == o.disable_login_with_phone && - resource_owner_type == o.resource_owner_type && - force_mfa_local_only == o.force_mfa_local_only - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [allow_username_password, allow_register, allow_external_idp, force_mfa, passkeys_type, hide_password_reset, ignore_unknown_usernames, default_redirect_uri, password_check_lifetime, external_login_check_lifetime, mfa_init_skip_lifetime, second_factor_check_lifetime, multi_factor_check_lifetime, second_factors, multi_factors, allow_domain_discovery, disable_login_with_email, disable_login_with_phone, resource_owner_type, force_mfa_local_only].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceLoginSettings. + class BetaSettingsServiceLoginSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + allow_username_password: 'allowUsernamePassword', + allow_register: 'allowRegister', + allow_external_idp: 'allowExternalIdp', + force_mfa: 'forceMfa', + passkeys_type: 'passkeysType', + hide_password_reset: 'hidePasswordReset', + ignore_unknown_usernames: 'ignoreUnknownUsernames', + default_redirect_uri: 'defaultRedirectUri', + password_check_lifetime: 'passwordCheckLifetime', + external_login_check_lifetime: 'externalLoginCheckLifetime', + mfa_init_skip_lifetime: 'mfaInitSkipLifetime', + second_factor_check_lifetime: 'secondFactorCheckLifetime', + multi_factor_check_lifetime: 'multiFactorCheckLifetime', + second_factors: 'secondFactors', + multi_factors: 'multiFactors', + allow_domain_discovery: 'allowDomainDiscovery', + disable_login_with_email: 'disableLoginWithEmail', + disable_login_with_phone: 'disableLoginWithPhone', + resource_owner_type: 'resourceOwnerType', + force_mfa_local_only: 'forceMfaLocalOnly' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + allow_username_password: 'Boolean', + allow_register: 'Boolean', + allow_external_idp: 'Boolean', + force_mfa: 'Boolean', + passkeys_type: 'BetaSettingsServicePasskeysType', + hide_password_reset: 'Boolean', + ignore_unknown_usernames: 'Boolean', + default_redirect_uri: 'String', + password_check_lifetime: 'ISO8601::Duration', + external_login_check_lifetime: 'ISO8601::Duration', + mfa_init_skip_lifetime: 'ISO8601::Duration', + second_factor_check_lifetime: 'ISO8601::Duration', + multi_factor_check_lifetime: 'ISO8601::Duration', + second_factors: 'Array', + multi_factors: 'Array', + allow_domain_discovery: 'Boolean', + disable_login_with_email: 'Boolean', + disable_login_with_phone: 'Boolean', + resource_owner_type: 'BetaSettingsServiceResourceOwnerType', + force_mfa_local_only: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :allow_username_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :allow_register, Types::Any.optional.meta(omittable: true) + # @example null + attribute :allow_external_idp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :force_mfa, Types::Any.optional.meta(omittable: true) + # @example null + attribute :passkeys_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :hide_password_reset, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ignore_unknown_usernames, Types::Any.optional.meta(omittable: true) + # @example null + attribute :default_redirect_uri, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :password_check_lifetime, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :external_login_check_lifetime, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :mfa_init_skip_lifetime, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :second_factor_check_lifetime, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :multi_factor_check_lifetime, Types::Any.optional.meta(omittable: true) + # @example null + attribute :second_factors, Types::Any.optional.meta(omittable: true) + # @example null + attribute :multi_factors, Types::Any.optional.meta(omittable: true) + # If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the org domains and will redirect to the registration of that organization on success. + # @example null + attribute :allow_domain_discovery, Types::Any.optional.meta(omittable: true) + # @example null + attribute :disable_login_with_email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :disable_login_with_phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :force_mfa_local_only, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_multi_factor_type.rb b/lib/zitadel/client/models/beta_settings_service_multi_factor_type.rb index 43633a8c..7e26ba56 100644 --- a/lib/zitadel/client/models/beta_settings_service_multi_factor_type.rb +++ b/lib/zitadel/client/models/beta_settings_service_multi_factor_type.rb @@ -1,41 +1,61 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaSettingsServiceMultiFactorType - MULTI_FACTOR_TYPE_UNSPECIFIED = "MULTI_FACTOR_TYPE_UNSPECIFIED".freeze - MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION = "MULTI_FACTOR_TYPE_U2F_WITH_VERIFICATION".freeze - - def self.all_vars - @all_vars ||= [MULTI_FACTOR_TYPE_UNSPECIFIED, MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaSettingsServiceMultiFactorType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceMultiFactorType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaSettingsServiceMultiFactorType. + class BetaSettingsServiceMultiFactorType + MULTI_FACTOR_TYPE_UNSPECIFIED = 'MULTI_FACTOR_TYPE_UNSPECIFIED' + MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION = 'MULTI_FACTOR_TYPE_U2F_WITH_VERIFICATION' + + # Frozen set of all allowed values, used for validation. + VALUES = [MULTI_FACTOR_TYPE_UNSPECIFIED, MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaSettingsServiceMultiFactorType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_settings_service_passkeys_type.rb b/lib/zitadel/client/models/beta_settings_service_passkeys_type.rb index dd40e341..a8da223e 100644 --- a/lib/zitadel/client/models/beta_settings_service_passkeys_type.rb +++ b/lib/zitadel/client/models/beta_settings_service_passkeys_type.rb @@ -1,41 +1,61 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaSettingsServicePasskeysType - PASSKEYS_TYPE_NOT_ALLOWED = "PASSKEYS_TYPE_NOT_ALLOWED".freeze - PASSKEYS_TYPE_ALLOWED = "PASSKEYS_TYPE_ALLOWED".freeze - - def self.all_vars - @all_vars ||= [PASSKEYS_TYPE_NOT_ALLOWED, PASSKEYS_TYPE_ALLOWED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaSettingsServicePasskeysType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServicePasskeysType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaSettingsServicePasskeysType. + class BetaSettingsServicePasskeysType + PASSKEYS_TYPE_NOT_ALLOWED = 'PASSKEYS_TYPE_NOT_ALLOWED' + PASSKEYS_TYPE_ALLOWED = 'PASSKEYS_TYPE_ALLOWED' + + # Frozen set of all allowed values, used for validation. + VALUES = [PASSKEYS_TYPE_NOT_ALLOWED, PASSKEYS_TYPE_ALLOWED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaSettingsServicePasskeysType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_settings_service_password_complexity_settings.rb b/lib/zitadel/client/models/beta_settings_service_password_complexity_settings.rb index 50e4b48b..0dd18e78 100644 --- a/lib/zitadel/client/models/beta_settings_service_password_complexity_settings.rb +++ b/lib/zitadel/client/models/beta_settings_service_password_complexity_settings.rb @@ -1,283 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServicePasswordComplexitySettings - attr_accessor :min_length - - attr_accessor :requires_uppercase - - attr_accessor :requires_lowercase - - attr_accessor :requires_number - - attr_accessor :requires_symbol - - attr_accessor :resource_owner_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'min_length' => :'minLength', - :'requires_uppercase' => :'requiresUppercase', - :'requires_lowercase' => :'requiresLowercase', - :'requires_number' => :'requiresNumber', - :'requires_symbol' => :'requiresSymbol', - :'resource_owner_type' => :'resourceOwnerType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'min_length' => :'Object', - :'requires_uppercase' => :'Boolean', - :'requires_lowercase' => :'Boolean', - :'requires_number' => :'Boolean', - :'requires_symbol' => :'Boolean', - :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'min_length', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServicePasswordComplexitySettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServicePasswordComplexitySettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'min_length') - self.min_length = attributes[:'min_length'] - end - - if attributes.key?(:'requires_uppercase') - self.requires_uppercase = attributes[:'requires_uppercase'] - end - - if attributes.key?(:'requires_lowercase') - self.requires_lowercase = attributes[:'requires_lowercase'] - end - - if attributes.key?(:'requires_number') - self.requires_number = attributes[:'requires_number'] - end - - if attributes.key?(:'requires_symbol') - self.requires_symbol = attributes[:'requires_symbol'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - min_length == o.min_length && - requires_uppercase == o.requires_uppercase && - requires_lowercase == o.requires_lowercase && - requires_number == o.requires_number && - requires_symbol == o.requires_symbol && - resource_owner_type == o.resource_owner_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [min_length, requires_uppercase, requires_lowercase, requires_number, requires_symbol, resource_owner_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServicePasswordComplexitySettings. + class BetaSettingsServicePasswordComplexitySettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + min_length: 'minLength', + requires_uppercase: 'requiresUppercase', + requires_lowercase: 'requiresLowercase', + requires_number: 'requiresNumber', + requires_symbol: 'requiresSymbol', + resource_owner_type: 'resourceOwnerType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + min_length: 'Object', + requires_uppercase: 'Boolean', + requires_lowercase: 'Boolean', + requires_number: 'Boolean', + requires_symbol: 'Boolean', + resource_owner_type: 'BetaSettingsServiceResourceOwnerType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :min_length, Types::Any.optional.meta(omittable: true) + # @example null + attribute :requires_uppercase, Types::Any.optional.meta(omittable: true) + # @example null + attribute :requires_lowercase, Types::Any.optional.meta(omittable: true) + # @example null + attribute :requires_number, Types::Any.optional.meta(omittable: true) + # @example null + attribute :requires_symbol, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_password_expiry_settings.rb b/lib/zitadel/client/models/beta_settings_service_password_expiry_settings.rb index f53c9419..426c1899 100644 --- a/lib/zitadel/client/models/beta_settings_service_password_expiry_settings.rb +++ b/lib/zitadel/client/models/beta_settings_service_password_expiry_settings.rb @@ -1,259 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServicePasswordExpirySettings - # Amount of days after which a password will expire. The user will be forced to change the password on the following authentication. - attr_accessor :max_age_days - - # Amount of days after which the user should be notified of the upcoming expiry. ZITADEL will not notify the user. - attr_accessor :expire_warn_days - - attr_accessor :resource_owner_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'max_age_days' => :'maxAgeDays', - :'expire_warn_days' => :'expireWarnDays', - :'resource_owner_type' => :'resourceOwnerType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'max_age_days' => :'Object', - :'expire_warn_days' => :'Object', - :'resource_owner_type' => :'BetaSettingsServiceResourceOwnerType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'max_age_days', - :'expire_warn_days', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServicePasswordExpirySettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServicePasswordExpirySettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'max_age_days') - self.max_age_days = attributes[:'max_age_days'] - end - - if attributes.key?(:'expire_warn_days') - self.expire_warn_days = attributes[:'expire_warn_days'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - max_age_days == o.max_age_days && - expire_warn_days == o.expire_warn_days && - resource_owner_type == o.resource_owner_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [max_age_days, expire_warn_days, resource_owner_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServicePasswordExpirySettings. + class BetaSettingsServicePasswordExpirySettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + max_age_days: 'maxAgeDays', + expire_warn_days: 'expireWarnDays', + resource_owner_type: 'resourceOwnerType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + max_age_days: 'Object', + expire_warn_days: 'Object', + resource_owner_type: 'BetaSettingsServiceResourceOwnerType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Amount of days after which a password will expire. The user will be forced to change the password on the following authentication. + # @example null + attribute :max_age_days, Types::Any.optional.meta(omittable: true) + # Amount of days after which the user should be notified of the upcoming expiry. ZITADEL will not notify the user. + # @example null + attribute :expire_warn_days, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_request_context.rb b/lib/zitadel/client/models/beta_settings_service_request_context.rb index 4bc99667..4d9fc45c 100644 --- a/lib/zitadel/client/models/beta_settings_service_request_context.rb +++ b/lib/zitadel/client/models/beta_settings_service_request_context.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceRequestContext - attr_accessor :instance - - attr_accessor :org_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance' => :'instance', - :'org_id' => :'orgId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance' => :'Boolean', - :'org_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceRequestContext` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceRequestContext`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance == o.instance && - org_id == o.org_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance, org_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceRequestContext. + class BetaSettingsServiceRequestContext < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance: 'instance', + org_id: 'orgId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance: 'Boolean', + org_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :org_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_resource_owner_type.rb b/lib/zitadel/client/models/beta_settings_service_resource_owner_type.rb index 6ec56831..d30edd0f 100644 --- a/lib/zitadel/client/models/beta_settings_service_resource_owner_type.rb +++ b/lib/zitadel/client/models/beta_settings_service_resource_owner_type.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaSettingsServiceResourceOwnerType - RESOURCE_OWNER_TYPE_UNSPECIFIED = "RESOURCE_OWNER_TYPE_UNSPECIFIED".freeze - RESOURCE_OWNER_TYPE_INSTANCE = "RESOURCE_OWNER_TYPE_INSTANCE".freeze - RESOURCE_OWNER_TYPE_ORG = "RESOURCE_OWNER_TYPE_ORG".freeze - - def self.all_vars - @all_vars ||= [RESOURCE_OWNER_TYPE_UNSPECIFIED, RESOURCE_OWNER_TYPE_INSTANCE, RESOURCE_OWNER_TYPE_ORG].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaSettingsServiceResourceOwnerType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceResourceOwnerType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaSettingsServiceResourceOwnerType. + class BetaSettingsServiceResourceOwnerType + RESOURCE_OWNER_TYPE_UNSPECIFIED = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' + RESOURCE_OWNER_TYPE_INSTANCE = 'RESOURCE_OWNER_TYPE_INSTANCE' + RESOURCE_OWNER_TYPE_ORG = 'RESOURCE_OWNER_TYPE_ORG' + + # Frozen set of all allowed values, used for validation. + VALUES = [RESOURCE_OWNER_TYPE_UNSPECIFIED, RESOURCE_OWNER_TYPE_INSTANCE, RESOURCE_OWNER_TYPE_ORG].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaSettingsServiceResourceOwnerType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_settings_service_second_factor_type.rb b/lib/zitadel/client/models/beta_settings_service_second_factor_type.rb index 8d2236fb..40de058e 100644 --- a/lib/zitadel/client/models/beta_settings_service_second_factor_type.rb +++ b/lib/zitadel/client/models/beta_settings_service_second_factor_type.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaSettingsServiceSecondFactorType - SECOND_FACTOR_TYPE_UNSPECIFIED = "SECOND_FACTOR_TYPE_UNSPECIFIED".freeze - SECOND_FACTOR_TYPE_OTP = "SECOND_FACTOR_TYPE_OTP".freeze - SECOND_FACTOR_TYPE_U2_F = "SECOND_FACTOR_TYPE_U2F".freeze - SECOND_FACTOR_TYPE_OTP_EMAIL = "SECOND_FACTOR_TYPE_OTP_EMAIL".freeze - SECOND_FACTOR_TYPE_OTP_SMS = "SECOND_FACTOR_TYPE_OTP_SMS".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaSettingsServiceSecondFactorType. + class BetaSettingsServiceSecondFactorType + SECOND_FACTOR_TYPE_UNSPECIFIED = 'SECOND_FACTOR_TYPE_UNSPECIFIED' + SECOND_FACTOR_TYPE_OTP = 'SECOND_FACTOR_TYPE_OTP' + SECOND_FACTOR_TYPE_U2_F = 'SECOND_FACTOR_TYPE_U2F' + SECOND_FACTOR_TYPE_OTP_EMAIL = 'SECOND_FACTOR_TYPE_OTP_EMAIL' + SECOND_FACTOR_TYPE_OTP_SMS = 'SECOND_FACTOR_TYPE_OTP_SMS' - def self.all_vars - @all_vars ||= [SECOND_FACTOR_TYPE_UNSPECIFIED, SECOND_FACTOR_TYPE_OTP, SECOND_FACTOR_TYPE_U2_F, SECOND_FACTOR_TYPE_OTP_EMAIL, SECOND_FACTOR_TYPE_OTP_SMS].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [SECOND_FACTOR_TYPE_UNSPECIFIED, SECOND_FACTOR_TYPE_OTP, SECOND_FACTOR_TYPE_U2_F, SECOND_FACTOR_TYPE_OTP_EMAIL, SECOND_FACTOR_TYPE_OTP_SMS].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaSettingsServiceSecondFactorType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceSecondFactorType" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaSettingsServiceSecondFactorType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_settings_service_security_settings.rb b/lib/zitadel/client/models/beta_settings_service_security_settings.rb index 7b043846..895f6176 100644 --- a/lib/zitadel/client/models/beta_settings_service_security_settings.rb +++ b/lib/zitadel/client/models/beta_settings_service_security_settings.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceSecuritySettings - attr_accessor :embedded_iframe - - attr_accessor :enable_impersonation - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'embedded_iframe' => :'embeddedIframe', - :'enable_impersonation' => :'enableImpersonation' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'embedded_iframe' => :'BetaSettingsServiceEmbeddedIframeSettings', - :'enable_impersonation' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceSecuritySettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceSecuritySettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'embedded_iframe') - self.embedded_iframe = attributes[:'embedded_iframe'] - end - - if attributes.key?(:'enable_impersonation') - self.enable_impersonation = attributes[:'enable_impersonation'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - embedded_iframe == o.embedded_iframe && - enable_impersonation == o.enable_impersonation - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [embedded_iframe, enable_impersonation].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceSecuritySettings. + class BetaSettingsServiceSecuritySettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + embedded_iframe: 'embeddedIframe', + enable_impersonation: 'enableImpersonation' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + embedded_iframe: 'BetaSettingsServiceEmbeddedIframeSettings', + enable_impersonation: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :embedded_iframe, Types::Any.optional.meta(omittable: true) + # @example null + attribute :enable_impersonation, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_set_security_settings_request.rb b/lib/zitadel/client/models/beta_settings_service_set_security_settings_request.rb index 9bff39ad..ad7fde7a 100644 --- a/lib/zitadel/client/models/beta_settings_service_set_security_settings_request.rb +++ b/lib/zitadel/client/models/beta_settings_service_set_security_settings_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceSetSecuritySettingsRequest - attr_accessor :embedded_iframe - - attr_accessor :enable_impersonation - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'embedded_iframe' => :'embeddedIframe', - :'enable_impersonation' => :'enableImpersonation' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'embedded_iframe' => :'BetaSettingsServiceEmbeddedIframeSettings', - :'enable_impersonation' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceSetSecuritySettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceSetSecuritySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'embedded_iframe') - self.embedded_iframe = attributes[:'embedded_iframe'] - end - - if attributes.key?(:'enable_impersonation') - self.enable_impersonation = attributes[:'enable_impersonation'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - embedded_iframe == o.embedded_iframe && - enable_impersonation == o.enable_impersonation - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [embedded_iframe, enable_impersonation].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceSetSecuritySettingsRequest. + class BetaSettingsServiceSetSecuritySettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + embedded_iframe: 'embeddedIframe', + enable_impersonation: 'enableImpersonation' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + embedded_iframe: 'BetaSettingsServiceEmbeddedIframeSettings', + enable_impersonation: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :embedded_iframe, Types::Any.optional.meta(omittable: true) + # @example null + attribute :enable_impersonation, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_set_security_settings_response.rb b/lib/zitadel/client/models/beta_settings_service_set_security_settings_response.rb index 91017038..7842178d 100644 --- a/lib/zitadel/client/models/beta_settings_service_set_security_settings_response.rb +++ b/lib/zitadel/client/models/beta_settings_service_set_security_settings_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceSetSecuritySettingsResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaSettingsServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceSetSecuritySettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceSetSecuritySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceSetSecuritySettingsResponse. + class BetaSettingsServiceSetSecuritySettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaSettingsServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_theme.rb b/lib/zitadel/client/models/beta_settings_service_theme.rb index b5b41c43..50bd6475 100644 --- a/lib/zitadel/client/models/beta_settings_service_theme.rb +++ b/lib/zitadel/client/models/beta_settings_service_theme.rb @@ -1,266 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaSettingsServiceTheme - # hex value for primary color - attr_accessor :primary_color - - # hex value for background color - attr_accessor :background_color - - # hex value for warning color - attr_accessor :warn_color - - # hex value for font color - attr_accessor :font_color - - # url where the logo is served - attr_accessor :logo_url - - # url where the icon is served - attr_accessor :icon_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'primary_color' => :'primaryColor', - :'background_color' => :'backgroundColor', - :'warn_color' => :'warnColor', - :'font_color' => :'fontColor', - :'logo_url' => :'logoUrl', - :'icon_url' => :'iconUrl' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'primary_color' => :'String', - :'background_color' => :'String', - :'warn_color' => :'String', - :'font_color' => :'String', - :'logo_url' => :'String', - :'icon_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaSettingsServiceTheme` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaSettingsServiceTheme`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'primary_color') - self.primary_color = attributes[:'primary_color'] - end - - if attributes.key?(:'background_color') - self.background_color = attributes[:'background_color'] - end - - if attributes.key?(:'warn_color') - self.warn_color = attributes[:'warn_color'] - end - - if attributes.key?(:'font_color') - self.font_color = attributes[:'font_color'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'icon_url') - self.icon_url = attributes[:'icon_url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - primary_color == o.primary_color && - background_color == o.background_color && - warn_color == o.warn_color && - font_color == o.font_color && - logo_url == o.logo_url && - icon_url == o.icon_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [primary_color, background_color, warn_color, font_color, logo_url, icon_url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaSettingsServiceTheme. + class BetaSettingsServiceTheme < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + primary_color: 'primaryColor', + background_color: 'backgroundColor', + warn_color: 'warnColor', + font_color: 'fontColor', + logo_url: 'logoUrl', + icon_url: 'iconUrl' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + primary_color: 'String', + background_color: 'String', + warn_color: 'String', + font_color: 'String', + logo_url: 'String', + icon_url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # hex value for primary color + # @example null + attribute :primary_color, Types::Any.optional.meta(omittable: true) + # hex value for background color + # @example null + attribute :background_color, Types::Any.optional.meta(omittable: true) + # hex value for warning color + # @example null + attribute :warn_color, Types::Any.optional.meta(omittable: true) + # hex value for font color + # @example null + attribute :font_color, Types::Any.optional.meta(omittable: true) + # url where the logo is served + # @example null + attribute :logo_url, Types::Any.optional.meta(omittable: true) + # url where the icon is served + # @example null + attribute :icon_url, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_settings_service_theme_mode.rb b/lib/zitadel/client/models/beta_settings_service_theme_mode.rb index f6e18339..6bd09c17 100644 --- a/lib/zitadel/client/models/beta_settings_service_theme_mode.rb +++ b/lib/zitadel/client/models/beta_settings_service_theme_mode.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaSettingsServiceThemeMode - THEME_MODE_UNSPECIFIED = "THEME_MODE_UNSPECIFIED".freeze - THEME_MODE_AUTO = "THEME_MODE_AUTO".freeze - THEME_MODE_LIGHT = "THEME_MODE_LIGHT".freeze - THEME_MODE_DARK = "THEME_MODE_DARK".freeze - - def self.all_vars - @all_vars ||= [THEME_MODE_UNSPECIFIED, THEME_MODE_AUTO, THEME_MODE_LIGHT, THEME_MODE_DARK].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaSettingsServiceThemeMode.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaSettingsServiceThemeMode" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaSettingsServiceThemeMode. + class BetaSettingsServiceThemeMode + THEME_MODE_UNSPECIFIED = 'THEME_MODE_UNSPECIFIED' + THEME_MODE_AUTO = 'THEME_MODE_AUTO' + THEME_MODE_LIGHT = 'THEME_MODE_LIGHT' + THEME_MODE_DARK = 'THEME_MODE_DARK' + + # Frozen set of all allowed values, used for validation. + VALUES = [THEME_MODE_UNSPECIFIED, THEME_MODE_AUTO, THEME_MODE_LIGHT, THEME_MODE_DARK].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaSettingsServiceThemeMode: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_telemetry_service_any.rb b/lib/zitadel/client/models/beta_telemetry_service_any.rb index 7eb9231b..b23748e1 100644 --- a/lib/zitadel/client/models/beta_telemetry_service_any.rb +++ b/lib/zitadel/client/models/beta_telemetry_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaTelemetryServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaTelemetryServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaTelemetryServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaTelemetryServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_telemetry_service_connect_error.rb b/lib/zitadel/client/models/beta_telemetry_service_connect_error.rb index 4029fae0..4b9a8a39 100644 --- a/lib/zitadel/client/models/beta_telemetry_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_telemetry_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaTelemetryServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaTelemetryServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaTelemetryServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaTelemetryServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_telemetry_service_count_parent_type.rb b/lib/zitadel/client/models/beta_telemetry_service_count_parent_type.rb index a1553838..0009e812 100644 --- a/lib/zitadel/client/models/beta_telemetry_service_count_parent_type.rb +++ b/lib/zitadel/client/models/beta_telemetry_service_count_parent_type.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaTelemetryServiceCountParentType - COUNT_PARENT_TYPE_UNSPECIFIED = "COUNT_PARENT_TYPE_UNSPECIFIED".freeze - COUNT_PARENT_TYPE_INSTANCE = "COUNT_PARENT_TYPE_INSTANCE".freeze - COUNT_PARENT_TYPE_ORGANIZATION = "COUNT_PARENT_TYPE_ORGANIZATION".freeze - - def self.all_vars - @all_vars ||= [COUNT_PARENT_TYPE_UNSPECIFIED, COUNT_PARENT_TYPE_INSTANCE, COUNT_PARENT_TYPE_ORGANIZATION].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaTelemetryServiceCountParentType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaTelemetryServiceCountParentType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaTelemetryServiceCountParentType. + class BetaTelemetryServiceCountParentType + COUNT_PARENT_TYPE_UNSPECIFIED = 'COUNT_PARENT_TYPE_UNSPECIFIED' + COUNT_PARENT_TYPE_INSTANCE = 'COUNT_PARENT_TYPE_INSTANCE' + COUNT_PARENT_TYPE_ORGANIZATION = 'COUNT_PARENT_TYPE_ORGANIZATION' + + # Frozen set of all allowed values, used for validation. + VALUES = [COUNT_PARENT_TYPE_UNSPECIFIED, COUNT_PARENT_TYPE_INSTANCE, COUNT_PARENT_TYPE_ORGANIZATION].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaTelemetryServiceCountParentType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_telemetry_service_instance_information.rb b/lib/zitadel/client/models/beta_telemetry_service_instance_information.rb index dbbb1862..15628277 100644 --- a/lib/zitadel/client/models/beta_telemetry_service_instance_information.rb +++ b/lib/zitadel/client/models/beta_telemetry_service_instance_information.rb @@ -1,238 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaTelemetryServiceInstanceInformation - # The unique identifier of the instance. - attr_accessor :id - - # The custom domains (incl. generated ones) of the instance. - attr_accessor :domains - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :created_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'domains' => :'domains', - :'created_at' => :'createdAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'domains' => :'Array', - :'created_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaTelemetryServiceInstanceInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaTelemetryServiceInstanceInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'domains') - if (value = attributes[:'domains']).is_a?(Array) - self.domains = value - end - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - domains == o.domains && - created_at == o.created_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, domains, created_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaTelemetryServiceInstanceInformation. + class BetaTelemetryServiceInstanceInformation < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + domains: 'domains', + created_at: 'createdAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + domains: 'Array', + created_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the instance. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # The custom domains (incl. generated ones) of the instance. + # @example null + attribute :domains, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :created_at, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_telemetry_service_report_base_information_request.rb b/lib/zitadel/client/models/beta_telemetry_service_report_base_information_request.rb index 6b934ad9..def85c73 100644 --- a/lib/zitadel/client/models/beta_telemetry_service_report_base_information_request.rb +++ b/lib/zitadel/client/models/beta_telemetry_service_report_base_information_request.rb @@ -1,238 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaTelemetryServiceReportBaseInformationRequest - # The system ID is a unique identifier for the ZITADEL system. - attr_accessor :system_id - - # The current version of the ZITADEL system. - attr_accessor :version - - # A list of instances in the ZITADEL system and their information. - attr_accessor :instances - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'system_id' => :'systemId', - :'version' => :'version', - :'instances' => :'instances' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'system_id' => :'String', - :'version' => :'String', - :'instances' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaTelemetryServiceReportBaseInformationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaTelemetryServiceReportBaseInformationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'system_id') - self.system_id = attributes[:'system_id'] - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'instances') - if (value = attributes[:'instances']).is_a?(Array) - self.instances = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - system_id == o.system_id && - version == o.version && - instances == o.instances - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [system_id, version, instances].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaTelemetryServiceReportBaseInformationRequest. + class BetaTelemetryServiceReportBaseInformationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + system_id: 'systemId', + version: 'version', + instances: 'instances' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + system_id: 'String', + version: 'String', + instances: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The system ID is a unique identifier for the ZITADEL system. + # @example null + attribute :system_id, Types::Any.optional.meta(omittable: true) + # The current version of the ZITADEL system. + # @example null + attribute :version, Types::Any.optional.meta(omittable: true) + # A list of instances in the ZITADEL system and their information. + # @example null + attribute :instances, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_telemetry_service_report_base_information_response.rb b/lib/zitadel/client/models/beta_telemetry_service_report_base_information_response.rb index 117b7ff5..7b556455 100644 --- a/lib/zitadel/client/models/beta_telemetry_service_report_base_information_response.rb +++ b/lib/zitadel/client/models/beta_telemetry_service_report_base_information_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaTelemetryServiceReportBaseInformationResponse - # The report ID is a unique identifier for the report. It is used to identify the report to be able to link it to the resource counts or other reports. Note that the report ID is only valid for the same system ID. - attr_accessor :report_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_id' => :'reportId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaTelemetryServiceReportBaseInformationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaTelemetryServiceReportBaseInformationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_id') - self.report_id = attributes[:'report_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_id == o.report_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaTelemetryServiceReportBaseInformationResponse. + class BetaTelemetryServiceReportBaseInformationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + report_id: 'reportId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + report_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The report ID is a unique identifier for the report. It is used to identify the report to be able to link it to the resource counts or other reports. Note that the report ID is only valid for the same system ID. + # @example null + attribute :report_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_request.rb b/lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_request.rb index 77d61f9b..773dd909 100644 --- a/lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_request.rb +++ b/lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_request.rb @@ -1,239 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaTelemetryServiceReportResourceCountsRequest - # The system ID is a unique identifier for the ZITADEL system. - attr_accessor :system_id - - # The previously returned report ID from the server to continue reporting. Note that the report ID is only valid for the same system ID. - attr_accessor :report_id - - # A list of resource counts to report. - attr_accessor :resource_counts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'system_id' => :'systemId', - :'report_id' => :'reportId', - :'resource_counts' => :'resourceCounts' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'system_id' => :'String', - :'report_id' => :'String', - :'resource_counts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'report_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaTelemetryServiceReportResourceCountsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaTelemetryServiceReportResourceCountsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'system_id') - self.system_id = attributes[:'system_id'] - end - - if attributes.key?(:'report_id') - self.report_id = attributes[:'report_id'] - end - - if attributes.key?(:'resource_counts') - if (value = attributes[:'resource_counts']).is_a?(Array) - self.resource_counts = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - system_id == o.system_id && - report_id == o.report_id && - resource_counts == o.resource_counts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [system_id, report_id, resource_counts].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaTelemetryServiceReportResourceCountsRequest. + class BetaTelemetryServiceReportResourceCountsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + system_id: 'systemId', + report_id: 'reportId', + resource_counts: 'resourceCounts' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + system_id: 'String', + report_id: 'String', + resource_counts: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The system ID is a unique identifier for the ZITADEL system. + # @example null + attribute :system_id, Types::Any.optional.meta(omittable: true) + # The previously returned report ID from the server to continue reporting. Note that the report ID is only valid for the same system ID. + # @example null + attribute :report_id, Types::Any.optional.meta(omittable: true) + # A list of resource counts to report. + # @example null + attribute :resource_counts, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_response.rb b/lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_response.rb index 855c71f0..4a2c4110 100644 --- a/lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_response.rb +++ b/lib/zitadel/client/models/beta_telemetry_service_report_resource_counts_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaTelemetryServiceReportResourceCountsResponse - # The report ID is a unique identifier for the report. It is used to identify the report in case of additional data / pagination. Note that the report ID is only valid for the same system ID. - attr_accessor :report_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_id' => :'reportId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaTelemetryServiceReportResourceCountsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaTelemetryServiceReportResourceCountsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_id') - self.report_id = attributes[:'report_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_id == o.report_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaTelemetryServiceReportResourceCountsResponse. + class BetaTelemetryServiceReportResourceCountsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + report_id: 'reportId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + report_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The report ID is a unique identifier for the report. It is used to identify the report in case of additional data / pagination. Note that the report ID is only valid for the same system ID. + # @example null + attribute :report_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_telemetry_service_resource_count.rb b/lib/zitadel/client/models/beta_telemetry_service_resource_count.rb index b51c76b9..a00befc3 100644 --- a/lib/zitadel/client/models/beta_telemetry_service_resource_count.rb +++ b/lib/zitadel/client/models/beta_telemetry_service_resource_count.rb @@ -1,297 +1,103 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaTelemetryServiceResourceCount - # The ID of the instance for which the resource counts are reported. - attr_accessor :instance_id - - attr_accessor :parent_type - - # The parent ID of the resource counts (e.g. organization or instance ID). For example, reporting the amount of users per organization would use `COUNT_PARENT_TYPE_ORGANIZATION` as parent type and the organization ID as parent ID. - attr_accessor :parent_id - - # The resource counts to report, e.g. amount of `users`, `organizations`, etc. - attr_accessor :resource_name - - # The name of the table in the database, which was used to calculate the counts. This can be used to deduplicate counts in case of multiple reports. For example, if the counts were calculated from the `users14` table, the table name would be `users14`, where there could also be a `users15` table reported at the same time as the system is rolling out a new version. - attr_accessor :table_name - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :updated_at - - # The actual amount of the resource. - attr_accessor :amount - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'parent_type' => :'parentType', - :'parent_id' => :'parentId', - :'resource_name' => :'resourceName', - :'table_name' => :'tableName', - :'updated_at' => :'updatedAt', - :'amount' => :'amount' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'parent_type' => :'BetaTelemetryServiceCountParentType', - :'parent_id' => :'String', - :'resource_name' => :'String', - :'table_name' => :'String', - :'updated_at' => :'Time', - :'amount' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaTelemetryServiceResourceCount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaTelemetryServiceResourceCount`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'parent_type') - self.parent_type = attributes[:'parent_type'] - end - - if attributes.key?(:'parent_id') - self.parent_id = attributes[:'parent_id'] - end - - if attributes.key?(:'resource_name') - self.resource_name = attributes[:'resource_name'] - end - - if attributes.key?(:'table_name') - self.table_name = attributes[:'table_name'] - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - parent_type == o.parent_type && - parent_id == o.parent_id && - resource_name == o.resource_name && - table_name == o.table_name && - updated_at == o.updated_at && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, parent_type, parent_id, resource_name, table_name, updated_at, amount].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaTelemetryServiceResourceCount. + class BetaTelemetryServiceResourceCount < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + parent_type: 'parentType', + parent_id: 'parentId', + resource_name: 'resourceName', + table_name: 'tableName', + updated_at: 'updatedAt', + amount: 'amount' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + parent_type: 'BetaTelemetryServiceCountParentType', + parent_id: 'String', + resource_name: 'String', + table_name: 'String', + updated_at: 'Time', + amount: 'Integer' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The ID of the instance for which the resource counts are reported. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :parent_type, Types::Any.optional.meta(omittable: true) + # The parent ID of the resource counts (e.g. organization or instance ID). For example, reporting the amount of users per organization would use `COUNT_PARENT_TYPE_ORGANIZATION` as parent type and the organization ID as parent ID. + # @example null + attribute :parent_id, Types::Any.optional.meta(omittable: true) + # The resource counts to report, e.g. amount of `users`, `organizations`, etc. + # @example null + attribute :resource_name, Types::Any.optional.meta(omittable: true) + # The name of the table in the database, which was used to calculate the counts. This can be used to deduplicate counts in case of multiple reports. For example, if the counts were calculated from the `users14` table, the table name would be `users14`, where there could also be a `users15` table reported at the same time as the system is rolling out a new version. + # @example null + attribute :table_name, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :updated_at, Types::Any.optional.meta(omittable: true) + # The actual amount of the resource. + # @example null + attribute :amount, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_access_token_type.rb b/lib/zitadel/client/models/beta_user_service_access_token_type.rb index 21b05ef2..af5570cd 100644 --- a/lib/zitadel/client/models/beta_user_service_access_token_type.rb +++ b/lib/zitadel/client/models/beta_user_service_access_token_type.rb @@ -1,41 +1,61 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaUserServiceAccessTokenType - ACCESS_TOKEN_TYPE_BEARER = "ACCESS_TOKEN_TYPE_BEARER".freeze - ACCESS_TOKEN_TYPE_JWT = "ACCESS_TOKEN_TYPE_JWT".freeze - - def self.all_vars - @all_vars ||= [ACCESS_TOKEN_TYPE_BEARER, ACCESS_TOKEN_TYPE_JWT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaUserServiceAccessTokenType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceAccessTokenType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaUserServiceAccessTokenType. + class BetaUserServiceAccessTokenType + ACCESS_TOKEN_TYPE_BEARER = 'ACCESS_TOKEN_TYPE_BEARER' + ACCESS_TOKEN_TYPE_JWT = 'ACCESS_TOKEN_TYPE_JWT' + + # Frozen set of all allowed values, used for validation. + VALUES = [ACCESS_TOKEN_TYPE_BEARER, ACCESS_TOKEN_TYPE_JWT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaUserServiceAccessTokenType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_user_service_add_human_user_request.rb b/lib/zitadel/client/models/beta_user_service_add_human_user_request.rb index cb00809b..34897beb 100644 --- a/lib/zitadel/client/models/beta_user_service_add_human_user_request.rb +++ b/lib/zitadel/client/models/beta_user_service_add_human_user_request.rb @@ -1,315 +1,116 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceAddHumanUserRequest - # optionally set your own id unique for the user. - attr_accessor :user_id - - # optionally set a unique username, if none is provided the email will be used. - attr_accessor :username - - attr_accessor :organization - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - attr_accessor :metadata - - attr_accessor :idp_links - - # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. - attr_accessor :totp_secret - - attr_accessor :hashed_password - - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'username' => :'username', - :'organization' => :'organization', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'metadata' => :'metadata', - :'idp_links' => :'idpLinks', - :'totp_secret' => :'totpSecret', - :'hashed_password' => :'hashedPassword', - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'username' => :'String', - :'organization' => :'BetaUserServiceOrganization', - :'profile' => :'BetaUserServiceSetHumanProfile', - :'email' => :'BetaUserServiceSetHumanEmail', - :'phone' => :'BetaUserServiceSetHumanPhone', - :'metadata' => :'Array', - :'idp_links' => :'Array', - :'totp_secret' => :'String', - :'hashed_password' => :'BetaUserServiceHashedPassword', - :'password' => :'BetaUserServicePassword' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user_id', - :'username', - :'totp_secret', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddHumanUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddHumanUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'organization') - self.organization = attributes[:'organization'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - - if attributes.key?(:'idp_links') - if (value = attributes[:'idp_links']).is_a?(Array) - self.idp_links = value - end - end - - if attributes.key?(:'totp_secret') - self.totp_secret = attributes[:'totp_secret'] - end - - if attributes.key?(:'hashed_password') - self.hashed_password = attributes[:'hashed_password'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - username == o.username && - organization == o.organization && - profile == o.profile && - email == o.email && - phone == o.phone && - metadata == o.metadata && - idp_links == o.idp_links && - totp_secret == o.totp_secret && - hashed_password == o.hashed_password && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, username, organization, profile, email, phone, metadata, idp_links, totp_secret, hashed_password, password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceAddHumanUserRequest. + class BetaUserServiceAddHumanUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + username: 'username', + organization: 'organization', + profile: 'profile', + email: 'email', + phone: 'phone', + metadata: 'metadata', + idp_links: 'idpLinks', + totp_secret: 'totpSecret', + hashed_password: 'hashedPassword', + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + username: 'String', + organization: 'BetaUserServiceOrganization', + profile: 'BetaUserServiceSetHumanProfile', + email: 'BetaUserServiceSetHumanEmail', + phone: 'BetaUserServiceSetHumanPhone', + metadata: 'Array', + idp_links: 'Array', + totp_secret: 'String', + hashed_password: 'BetaUserServiceHashedPassword', + password: 'BetaUserServicePassword' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # optionally set your own id unique for the user. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # optionally set a unique username, if none is provided the email will be used. + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization, Types::Any.optional.meta(omittable: true) + # @example null + attribute :profile, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_links, Types::Any.optional.meta(omittable: true) + # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. + # @example null + attribute :totp_secret, Types::Any.optional.meta(omittable: true) + # @example null + attribute :hashed_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_add_human_user_response.rb b/lib/zitadel/client/models/beta_user_service_add_human_user_response.rb index 802434f1..94c0373f 100644 --- a/lib/zitadel/client/models/beta_user_service_add_human_user_response.rb +++ b/lib/zitadel/client/models/beta_user_service_add_human_user_response.rb @@ -1,244 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceAddHumanUserResponse - attr_accessor :user_id - - attr_accessor :details - - attr_accessor :email_code - - attr_accessor :phone_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'details' => :'details', - :'email_code' => :'emailCode', - :'phone_code' => :'phoneCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'details' => :'BetaUserServiceDetails', - :'email_code' => :'String', - :'phone_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_code', - :'phone_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddHumanUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddHumanUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'email_code') - self.email_code = attributes[:'email_code'] - end - - if attributes.key?(:'phone_code') - self.phone_code = attributes[:'phone_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - details == o.details && - email_code == o.email_code && - phone_code == o.phone_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, details, email_code, phone_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceAddHumanUserResponse. + class BetaUserServiceAddHumanUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + details: 'details', + email_code: 'emailCode', + phone_code: 'phoneCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + details: 'BetaUserServiceDetails', + email_code: 'String', + phone_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_request.rb b/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_request.rb deleted file mode 100644 index c748e2e3..00000000 --- a/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_request.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceAddIDPLinkRequest - attr_accessor :user_id - - attr_accessor :idp_link - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'idp_link' => :'idpLink' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'idp_link' => :'BetaUserServiceIDPLink' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddIDPLinkRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddIDPLinkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'idp_link') - self.idp_link = attributes[:'idp_link'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - idp_link == o.idp_link - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, idp_link].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_response.rb b/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_response.rb deleted file mode 100644 index 4ffab78b..00000000 --- a/lib/zitadel/client/models/beta_user_service_add_i_d_p_link_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceAddIDPLinkResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddIDPLinkResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddIDPLinkResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_add_idp_link_request.rb b/lib/zitadel/client/models/beta_user_service_add_idp_link_request.rb new file mode 100644 index 00000000..3a03d6e7 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_idp_link_request.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceAddIDPLinkRequest. + class BetaUserServiceAddIDPLinkRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + idp_link: 'idpLink' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + idp_link: 'BetaUserServiceIDPLink' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_link, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_add_idp_link_response.rb b/lib/zitadel/client/models/beta_user_service_add_idp_link_response.rb new file mode 100644 index 00000000..763b8400 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_idp_link_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceAddIDPLinkResponse. + class BetaUserServiceAddIDPLinkResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_request.rb b/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_request.rb deleted file mode 100644 index 2b7668f3..00000000 --- a/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceAddOTPEmailRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddOTPEmailRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddOTPEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_response.rb b/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_response.rb deleted file mode 100644 index 47aff7e2..00000000 --- a/lib/zitadel/client/models/beta_user_service_add_o_t_p_email_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceAddOTPEmailResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddOTPEmailResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddOTPEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_request.rb b/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_request.rb deleted file mode 100644 index 0a8df231..00000000 --- a/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceAddOTPSMSRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddOTPSMSRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddOTPSMSRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_response.rb b/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_response.rb deleted file mode 100644 index f0e034e7..00000000 --- a/lib/zitadel/client/models/beta_user_service_add_o_t_p_s_m_s_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceAddOTPSMSResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAddOTPSMSResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAddOTPSMSResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_add_otp_email_request.rb b/lib/zitadel/client/models/beta_user_service_add_otp_email_request.rb new file mode 100644 index 00000000..ce1a2f4a --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_otp_email_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceAddOTPEmailRequest. + class BetaUserServiceAddOTPEmailRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_add_otp_email_response.rb b/lib/zitadel/client/models/beta_user_service_add_otp_email_response.rb new file mode 100644 index 00000000..f04d8211 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_otp_email_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceAddOTPEmailResponse. + class BetaUserServiceAddOTPEmailResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_add_otpsms_request.rb b/lib/zitadel/client/models/beta_user_service_add_otpsms_request.rb new file mode 100644 index 00000000..207e55f9 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_otpsms_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceAddOTPSMSRequest. + class BetaUserServiceAddOTPSMSRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_add_otpsms_response.rb b/lib/zitadel/client/models/beta_user_service_add_otpsms_response.rb new file mode 100644 index 00000000..55bd9720 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_add_otpsms_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceAddOTPSMSResponse. + class BetaUserServiceAddOTPSMSResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_and_query.rb b/lib/zitadel/client/models/beta_user_service_and_query.rb index dddd62e6..9a30ef3e 100644 --- a/lib/zitadel/client/models/beta_user_service_and_query.rb +++ b/lib/zitadel/client/models/beta_user_service_and_query.rb @@ -1,218 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Connect multiple sub-condition with and AND operator. - class BetaUserServiceAndQuery - attr_accessor :queries - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAndQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAndQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Connect multiple sub-condition with and AND operator. + class BetaUserServiceAndQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_any.rb b/lib/zitadel/client/models/beta_user_service_any.rb index 4082f0a0..38b98c07 100644 --- a/lib/zitadel/client/models/beta_user_service_any.rb +++ b/lib/zitadel/client/models/beta_user_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaUserServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaUserServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_authentication_method_type.rb b/lib/zitadel/client/models/beta_user_service_authentication_method_type.rb index 1ea98a5e..d2596de7 100644 --- a/lib/zitadel/client/models/beta_user_service_authentication_method_type.rb +++ b/lib/zitadel/client/models/beta_user_service_authentication_method_type.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaUserServiceAuthenticationMethodType - AUTHENTICATION_METHOD_TYPE_UNSPECIFIED = "AUTHENTICATION_METHOD_TYPE_UNSPECIFIED".freeze - AUTHENTICATION_METHOD_TYPE_PASSWORD = "AUTHENTICATION_METHOD_TYPE_PASSWORD".freeze - AUTHENTICATION_METHOD_TYPE_PASSKEY = "AUTHENTICATION_METHOD_TYPE_PASSKEY".freeze - AUTHENTICATION_METHOD_TYPE_IDP = "AUTHENTICATION_METHOD_TYPE_IDP".freeze - AUTHENTICATION_METHOD_TYPE_TOTP = "AUTHENTICATION_METHOD_TYPE_TOTP".freeze - AUTHENTICATION_METHOD_TYPE_U2_F = "AUTHENTICATION_METHOD_TYPE_U2F".freeze - AUTHENTICATION_METHOD_TYPE_OTP_SMS = "AUTHENTICATION_METHOD_TYPE_OTP_SMS".freeze - AUTHENTICATION_METHOD_TYPE_OTP_EMAIL = "AUTHENTICATION_METHOD_TYPE_OTP_EMAIL".freeze - - def self.all_vars - @all_vars ||= [AUTHENTICATION_METHOD_TYPE_UNSPECIFIED, AUTHENTICATION_METHOD_TYPE_PASSWORD, AUTHENTICATION_METHOD_TYPE_PASSKEY, AUTHENTICATION_METHOD_TYPE_IDP, AUTHENTICATION_METHOD_TYPE_TOTP, AUTHENTICATION_METHOD_TYPE_U2_F, AUTHENTICATION_METHOD_TYPE_OTP_SMS, AUTHENTICATION_METHOD_TYPE_OTP_EMAIL].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaUserServiceAuthenticationMethodType. + class BetaUserServiceAuthenticationMethodType + AUTHENTICATION_METHOD_TYPE_UNSPECIFIED = 'AUTHENTICATION_METHOD_TYPE_UNSPECIFIED' + AUTHENTICATION_METHOD_TYPE_PASSWORD = 'AUTHENTICATION_METHOD_TYPE_PASSWORD' + AUTHENTICATION_METHOD_TYPE_PASSKEY = 'AUTHENTICATION_METHOD_TYPE_PASSKEY' + AUTHENTICATION_METHOD_TYPE_IDP = 'AUTHENTICATION_METHOD_TYPE_IDP' + AUTHENTICATION_METHOD_TYPE_TOTP = 'AUTHENTICATION_METHOD_TYPE_TOTP' + AUTHENTICATION_METHOD_TYPE_U2_F = 'AUTHENTICATION_METHOD_TYPE_U2F' + AUTHENTICATION_METHOD_TYPE_OTP_SMS = 'AUTHENTICATION_METHOD_TYPE_OTP_SMS' + AUTHENTICATION_METHOD_TYPE_OTP_EMAIL = 'AUTHENTICATION_METHOD_TYPE_OTP_EMAIL' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [AUTHENTICATION_METHOD_TYPE_UNSPECIFIED, AUTHENTICATION_METHOD_TYPE_PASSWORD, AUTHENTICATION_METHOD_TYPE_PASSKEY, AUTHENTICATION_METHOD_TYPE_IDP, AUTHENTICATION_METHOD_TYPE_TOTP, AUTHENTICATION_METHOD_TYPE_U2_F, AUTHENTICATION_METHOD_TYPE_OTP_SMS, AUTHENTICATION_METHOD_TYPE_OTP_EMAIL].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaUserServiceAuthenticationMethodType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceAuthenticationMethodType" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaUserServiceAuthenticationMethodType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_user_service_connect_error.rb b/lib/zitadel/client/models/beta_user_service_connect_error.rb index 08b27a43..decdb19a 100644 --- a/lib/zitadel/client/models/beta_user_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_user_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaUserServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaUserServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rb b/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rb index c6259257..b52aac2b 100644 --- a/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rb +++ b/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceCreatePasskeyRegistrationLinkRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_link - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_link' => :'sendLink' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_link' => :'BetaUserServiceSendPasskeyRegistrationLink' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceCreatePasskeyRegistrationLinkRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceCreatePasskeyRegistrationLinkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_link') - self.send_link = attributes[:'send_link'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_link == o.send_link - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_link].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceCreatePasskeyRegistrationLinkRequest. + class BetaUserServiceCreatePasskeyRegistrationLinkRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_link: 'sendLink' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_link: 'BetaUserServiceSendPasskeyRegistrationLink' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_link, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rb b/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rb index 98ea06bd..8baee79e 100644 --- a/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rb +++ b/lib/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceCreatePasskeyRegistrationLinkResponse - attr_accessor :details - - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'code' => :'BetaUserServicePasskeyRegistrationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceCreatePasskeyRegistrationLinkResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceCreatePasskeyRegistrationLinkResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceCreatePasskeyRegistrationLinkResponse. + class BetaUserServiceCreatePasskeyRegistrationLinkResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + code: 'BetaUserServicePasskeyRegistrationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_deactivate_user_request.rb b/lib/zitadel/client/models/beta_user_service_deactivate_user_request.rb index 3cd323d6..72667a9d 100644 --- a/lib/zitadel/client/models/beta_user_service_deactivate_user_request.rb +++ b/lib/zitadel/client/models/beta_user_service_deactivate_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceDeactivateUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDeactivateUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDeactivateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceDeactivateUserRequest. + class BetaUserServiceDeactivateUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_deactivate_user_response.rb b/lib/zitadel/client/models/beta_user_service_deactivate_user_response.rb index 940c078a..d771b09c 100644 --- a/lib/zitadel/client/models/beta_user_service_deactivate_user_response.rb +++ b/lib/zitadel/client/models/beta_user_service_deactivate_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceDeactivateUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDeactivateUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDeactivateUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceDeactivateUserResponse. + class BetaUserServiceDeactivateUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_delete_user_request.rb b/lib/zitadel/client/models/beta_user_service_delete_user_request.rb index 63094810..2383969c 100644 --- a/lib/zitadel/client/models/beta_user_service_delete_user_request.rb +++ b/lib/zitadel/client/models/beta_user_service_delete_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceDeleteUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDeleteUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDeleteUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceDeleteUserRequest. + class BetaUserServiceDeleteUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_delete_user_response.rb b/lib/zitadel/client/models/beta_user_service_delete_user_response.rb index c255f778..5b67db10 100644 --- a/lib/zitadel/client/models/beta_user_service_delete_user_response.rb +++ b/lib/zitadel/client/models/beta_user_service_delete_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceDeleteUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDeleteUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDeleteUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceDeleteUserResponse. + class BetaUserServiceDeleteUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_details.rb b/lib/zitadel/client/models/beta_user_service_details.rb index 14435387..9f3c64ec 100644 --- a/lib/zitadel/client/models/beta_user_service_details.rb +++ b/lib/zitadel/client/models/beta_user_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceDetails. + class BetaUserServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_display_name_query.rb b/lib/zitadel/client/models/beta_user_service_display_name_query.rb index 3c3911bb..d221d40f 100644 --- a/lib/zitadel/client/models/beta_user_service_display_name_query.rb +++ b/lib/zitadel/client/models/beta_user_service_display_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific display name. - class BetaUserServiceDisplayNameQuery - attr_accessor :display_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name' => :'displayName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name' => :'String', - :'method' => :'BetaUserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceDisplayNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceDisplayNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name == o.display_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific display name. + class BetaUserServiceDisplayNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name: 'displayName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name: 'String', + method: 'BetaUserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_email_query.rb b/lib/zitadel/client/models/beta_user_service_email_query.rb index dbbce976..66750b4b 100644 --- a/lib/zitadel/client/models/beta_user_service_email_query.rb +++ b/lib/zitadel/client/models/beta_user_service_email_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific email. - class BetaUserServiceEmailQuery - attr_accessor :email_address - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email_address' => :'emailAddress', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email_address' => :'String', - :'method' => :'BetaUserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceEmailQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceEmailQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email_address == o.email_address && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email_address, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific email. + class BetaUserServiceEmailQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + email_address: 'emailAddress', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + email_address: 'String', + method: 'BetaUserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :email_address, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_first_name_query.rb b/lib/zitadel/client/models/beta_user_service_first_name_query.rb index f34404ce..e6cf89ad 100644 --- a/lib/zitadel/client/models/beta_user_service_first_name_query.rb +++ b/lib/zitadel/client/models/beta_user_service_first_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific first name. - class BetaUserServiceFirstNameQuery - attr_accessor :first_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'first_name' => :'firstName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'first_name' => :'String', - :'method' => :'BetaUserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceFirstNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceFirstNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - first_name == o.first_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [first_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific first name. + class BetaUserServiceFirstNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + first_name: 'firstName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + first_name: 'String', + method: 'BetaUserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :first_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_form_data.rb b/lib/zitadel/client/models/beta_user_service_form_data.rb index ef87bfb8..4e012421 100644 --- a/lib/zitadel/client/models/beta_user_service_form_data.rb +++ b/lib/zitadel/client/models/beta_user_service_form_data.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceFormData - # The URL to which the form should be submitted using the POST method. - attr_accessor :url - - # The form fields to be submitted. Each field is represented as a key-value pair, where the key is the field / input name and the value is the field / input value. All fields need to be submitted as is and as input type \"text\". - attr_accessor :fields - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url' => :'url', - :'fields' => :'fields' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url' => :'String', - :'fields' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceFormData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceFormData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'fields') - if (value = attributes[:'fields']).is_a?(Hash) - self.fields = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url == o.url && - fields == o.fields - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url, fields].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceFormData. + class BetaUserServiceFormData < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url: 'url', + fields: 'fields' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url: 'String', + fields: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The URL to which the form should be submitted using the POST method. + # @example null + attribute :url, Types::Any.optional.meta(omittable: true) + # The form fields to be submitted. Each field is represented as a key-value pair, where the key is the field / input name and the value is the field / input value. All fields need to be submitted as is and as input type \"text\". + # @example null + attribute :fields, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_gender.rb b/lib/zitadel/client/models/beta_user_service_gender.rb index b023ef25..cfbd1677 100644 --- a/lib/zitadel/client/models/beta_user_service_gender.rb +++ b/lib/zitadel/client/models/beta_user_service_gender.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaUserServiceGender - GENDER_UNSPECIFIED = "GENDER_UNSPECIFIED".freeze - GENDER_FEMALE = "GENDER_FEMALE".freeze - GENDER_MALE = "GENDER_MALE".freeze - GENDER_DIVERSE = "GENDER_DIVERSE".freeze - - def self.all_vars - @all_vars ||= [GENDER_UNSPECIFIED, GENDER_FEMALE, GENDER_MALE, GENDER_DIVERSE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaUserServiceGender.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceGender" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaUserServiceGender. + class BetaUserServiceGender + GENDER_UNSPECIFIED = 'GENDER_UNSPECIFIED' + GENDER_FEMALE = 'GENDER_FEMALE' + GENDER_MALE = 'GENDER_MALE' + GENDER_DIVERSE = 'GENDER_DIVERSE' + + # Frozen set of all allowed values, used for validation. + VALUES = [GENDER_UNSPECIFIED, GENDER_FEMALE, GENDER_MALE, GENDER_DIVERSE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaUserServiceGender: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_request.rb b/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_request.rb deleted file mode 100644 index 18ca4a38..00000000 --- a/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceGetUserByIDRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceGetUserByIDRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceGetUserByIDRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_response.rb b/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_response.rb deleted file mode 100644 index 6d47aa06..00000000 --- a/lib/zitadel/client/models/beta_user_service_get_user_by_i_d_response.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceGetUserByIDResponse - attr_accessor :details - - attr_accessor :user - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'user' => :'user' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'user' => :'BetaUserServiceUser' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceGetUserByIDResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceGetUserByIDResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - user == o.user - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, user].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_get_user_by_id_request.rb b/lib/zitadel/client/models/beta_user_service_get_user_by_id_request.rb new file mode 100644 index 00000000..9eea27a9 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_get_user_by_id_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceGetUserByIDRequest. + class BetaUserServiceGetUserByIDRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_get_user_by_id_response.rb b/lib/zitadel/client/models/beta_user_service_get_user_by_id_response.rb new file mode 100644 index 00000000..f4a536c9 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_get_user_by_id_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceGetUserByIDResponse. + class BetaUserServiceGetUserByIDResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + user: 'user' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + user: 'BetaUserServiceUser' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_hashed_password.rb b/lib/zitadel/client/models/beta_user_service_hashed_password.rb index 37acd938..0ecab48c 100644 --- a/lib/zitadel/client/models/beta_user_service_hashed_password.rb +++ b/lib/zitadel/client/models/beta_user_service_hashed_password.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceHashedPassword - attr_accessor :hash - - attr_accessor :change_required - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'hash' => :'hash', - :'change_required' => :'changeRequired' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'hash' => :'String', - :'change_required' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceHashedPassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceHashedPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'hash') - self.hash = attributes[:'hash'] - end - - if attributes.key?(:'change_required') - self.change_required = attributes[:'change_required'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - hash == o.hash && - change_required == o.change_required - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [hash, change_required].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceHashedPassword. + class BetaUserServiceHashedPassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + hash: 'hash', + change_required: 'changeRequired' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + hash: 'String', + change_required: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :hash, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_required, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_human_email.rb b/lib/zitadel/client/models/beta_user_service_human_email.rb index ea3eb12e..0a6b7fb2 100644 --- a/lib/zitadel/client/models/beta_user_service_human_email.rb +++ b/lib/zitadel/client/models/beta_user_service_human_email.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceHumanEmail - attr_accessor :email - - attr_accessor :is_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'is_verified' => :'isVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'is_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceHumanEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceHumanEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - is_verified == o.is_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, is_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceHumanEmail. + class BetaUserServiceHumanEmail < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + email: 'email', + is_verified: 'isVerified' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + email: 'String', + is_verified: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_human_phone.rb b/lib/zitadel/client/models/beta_user_service_human_phone.rb index 5c41374f..2b331420 100644 --- a/lib/zitadel/client/models/beta_user_service_human_phone.rb +++ b/lib/zitadel/client/models/beta_user_service_human_phone.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceHumanPhone - attr_accessor :phone - - attr_accessor :is_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone' => :'phone', - :'is_verified' => :'isVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone' => :'String', - :'is_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceHumanPhone` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceHumanPhone`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone == o.phone && - is_verified == o.is_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone, is_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceHumanPhone. + class BetaUserServiceHumanPhone < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + phone: 'phone', + is_verified: 'isVerified' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + phone: 'String', + is_verified: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_human_profile.rb b/lib/zitadel/client/models/beta_user_service_human_profile.rb index 70b5e5fa..2a117fdb 100644 --- a/lib/zitadel/client/models/beta_user_service_human_profile.rb +++ b/lib/zitadel/client/models/beta_user_service_human_profile.rb @@ -1,294 +1,97 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceHumanProfile - attr_accessor :given_name - - attr_accessor :family_name - - attr_accessor :nick_name - - attr_accessor :display_name - - attr_accessor :preferred_language - - attr_accessor :gender - - attr_accessor :avatar_url - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'givenName', - :'family_name' => :'familyName', - :'nick_name' => :'nickName', - :'display_name' => :'displayName', - :'preferred_language' => :'preferredLanguage', - :'gender' => :'gender', - :'avatar_url' => :'avatarUrl' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'nick_name' => :'String', - :'display_name' => :'String', - :'preferred_language' => :'String', - :'gender' => :'BetaUserServiceGender', - :'avatar_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'nick_name', - :'display_name', - :'preferred_language', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceHumanProfile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceHumanProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'preferred_language') - self.preferred_language = attributes[:'preferred_language'] - end - - if attributes.key?(:'gender') - self.gender = attributes[:'gender'] - end - - if attributes.key?(:'avatar_url') - self.avatar_url = attributes[:'avatar_url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - nick_name == o.nick_name && - display_name == o.display_name && - preferred_language == o.preferred_language && - gender == o.gender && - avatar_url == o.avatar_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, nick_name, display_name, preferred_language, gender, avatar_url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceHumanProfile. + class BetaUserServiceHumanProfile < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + given_name: 'givenName', + family_name: 'familyName', + nick_name: 'nickName', + display_name: 'displayName', + preferred_language: 'preferredLanguage', + gender: 'gender', + avatar_url: 'avatarUrl' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + given_name: 'String', + family_name: 'String', + nick_name: 'String', + display_name: 'String', + preferred_language: 'String', + gender: 'BetaUserServiceGender', + avatar_url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :given_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :family_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :nick_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_language, Types::Any.optional.meta(omittable: true) + # @example null + attribute :gender, Types::Any.optional.meta(omittable: true) + # @example null + attribute :avatar_url, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_human_user.rb b/lib/zitadel/client/models/beta_user_service_human_user.rb index b90a456b..9d8c9fa3 100644 --- a/lib/zitadel/client/models/beta_user_service_human_user.rb +++ b/lib/zitadel/client/models/beta_user_service_human_user.rb @@ -1,326 +1,115 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceHumanUser - # Unique identifier of the user. - attr_accessor :user_id - - attr_accessor :state - - # Username of the user, which can be globally unique or unique on organization level. - attr_accessor :username - - # Possible usable login names for the user. - attr_accessor :login_names - - # Preferred login name of the user. - attr_accessor :preferred_login_name - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - # User is required to change the used password on the next login. - attr_accessor :password_change_required - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :password_changed - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'state' => :'state', - :'username' => :'username', - :'login_names' => :'loginNames', - :'preferred_login_name' => :'preferredLoginName', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'password_change_required' => :'passwordChangeRequired', - :'password_changed' => :'passwordChanged' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'state' => :'BetaUserServiceUserState', - :'username' => :'String', - :'login_names' => :'Array', - :'preferred_login_name' => :'String', - :'profile' => :'BetaUserServiceHumanProfile', - :'email' => :'BetaUserServiceHumanEmail', - :'phone' => :'BetaUserServiceHumanPhone', - :'password_change_required' => :'Boolean', - :'password_changed' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceHumanUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceHumanUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'login_names') - if (value = attributes[:'login_names']).is_a?(Array) - self.login_names = value - end - end - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'password_change_required') - self.password_change_required = attributes[:'password_change_required'] - end - - if attributes.key?(:'password_changed') - self.password_changed = attributes[:'password_changed'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - state == o.state && - username == o.username && - login_names == o.login_names && - preferred_login_name == o.preferred_login_name && - profile == o.profile && - email == o.email && - phone == o.phone && - password_change_required == o.password_change_required && - password_changed == o.password_changed - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, state, username, login_names, preferred_login_name, profile, email, phone, password_change_required, password_changed].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceHumanUser. + class BetaUserServiceHumanUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + state: 'state', + username: 'username', + login_names: 'loginNames', + preferred_login_name: 'preferredLoginName', + profile: 'profile', + email: 'email', + phone: 'phone', + password_change_required: 'passwordChangeRequired', + password_changed: 'passwordChanged' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + state: 'BetaUserServiceUserState', + username: 'String', + login_names: 'Array', + preferred_login_name: 'String', + profile: 'BetaUserServiceHumanProfile', + email: 'BetaUserServiceHumanEmail', + phone: 'BetaUserServiceHumanPhone', + password_change_required: 'Boolean', + password_changed: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Unique identifier of the user. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # Username of the user, which can be globally unique or unique on organization level. + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # Possible usable login names for the user. + # @example null + attribute :login_names, Types::Any.optional.meta(omittable: true) + # Preferred login name of the user. + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :profile, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # User is required to change the used password on the next login. + # @example null + attribute :password_change_required, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :password_changed, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_i_d_p_information.rb b/lib/zitadel/client/models/beta_user_service_i_d_p_information.rb deleted file mode 100644 index 915115a6..00000000 --- a/lib/zitadel/client/models/beta_user_service_i_d_p_information.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceIDPInformation - attr_accessor :idp_id - - attr_accessor :user_id - - attr_accessor :user_name - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :raw_information - - attr_accessor :ldap - - attr_accessor :oauth - - attr_accessor :saml - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_id' => :'idpId', - :'user_id' => :'userId', - :'user_name' => :'userName', - :'raw_information' => :'rawInformation', - :'ldap' => :'ldap', - :'oauth' => :'oauth', - :'saml' => :'saml' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_id' => :'String', - :'user_id' => :'String', - :'user_name' => :'String', - :'raw_information' => :'Hash', - :'ldap' => :'BetaUserServiceIDPLDAPAccessInformation', - :'oauth' => :'BetaUserServiceIDPOAuthAccessInformation', - :'saml' => :'BetaUserServiceIDPSAMLAccessInformation' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceIDPInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceIDPInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] - end - - if attributes.key?(:'raw_information') - if (value = attributes[:'raw_information']).is_a?(Hash) - self.raw_information = value - end - end - - if attributes.key?(:'ldap') - self.ldap = attributes[:'ldap'] - end - - if attributes.key?(:'oauth') - self.oauth = attributes[:'oauth'] - end - - if attributes.key?(:'saml') - self.saml = attributes[:'saml'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_id == o.idp_id && - user_id == o.user_id && - user_name == o.user_name && - raw_information == o.raw_information && - ldap == o.ldap && - oauth == o.oauth && - saml == o.saml - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_id, user_id, user_name, raw_information, ldap, oauth, saml].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_i_d_p_intent.rb b/lib/zitadel/client/models/beta_user_service_i_d_p_intent.rb deleted file mode 100644 index 025780f8..00000000 --- a/lib/zitadel/client/models/beta_user_service_i_d_p_intent.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceIDPIntent - attr_accessor :idp_intent_id - - attr_accessor :idp_intent_token - - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_intent_id' => :'idpIntentId', - :'idp_intent_token' => :'idpIntentToken', - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_intent_id' => :'String', - :'idp_intent_token' => :'String', - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceIDPIntent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceIDPIntent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_intent_id') - self.idp_intent_id = attributes[:'idp_intent_id'] - end - - if attributes.key?(:'idp_intent_token') - self.idp_intent_token = attributes[:'idp_intent_token'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_intent_id == o.idp_intent_id && - idp_intent_token == o.idp_intent_token && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_intent_id, idp_intent_token, user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_i_d_p_l_d_a_p_access_information.rb b/lib/zitadel/client/models/beta_user_service_i_d_p_l_d_a_p_access_information.rb deleted file mode 100644 index 67595a72..00000000 --- a/lib/zitadel/client/models/beta_user_service_i_d_p_l_d_a_p_access_information.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceIDPLDAPAccessInformation - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :attributes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attributes' => :'attributes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'attributes' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceIDPLDAPAccessInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceIDPLDAPAccessInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attributes') - if (value = attributes[:'attributes']).is_a?(Hash) - self.attributes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attributes == o.attributes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attributes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_i_d_p_link.rb b/lib/zitadel/client/models/beta_user_service_i_d_p_link.rb deleted file mode 100644 index 8e900be5..00000000 --- a/lib/zitadel/client/models/beta_user_service_i_d_p_link.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceIDPLink - attr_accessor :idp_id - - attr_accessor :user_id - - attr_accessor :user_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_id' => :'idpId', - :'user_id' => :'userId', - :'user_name' => :'userName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_id' => :'String', - :'user_id' => :'String', - :'user_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceIDPLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceIDPLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_id == o.idp_id && - user_id == o.user_id && - user_name == o.user_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_id, user_id, user_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_i_d_p_o_auth_access_information.rb b/lib/zitadel/client/models/beta_user_service_i_d_p_o_auth_access_information.rb deleted file mode 100644 index d5b04ee8..00000000 --- a/lib/zitadel/client/models/beta_user_service_i_d_p_o_auth_access_information.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceIDPOAuthAccessInformation - attr_accessor :access_token - - attr_accessor :id_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'accessToken', - :'id_token' => :'idToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'id_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'id_token' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceIDPOAuthAccessInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceIDPOAuthAccessInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'id_token') - self.id_token = attributes[:'id_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - id_token == o.id_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, id_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_i_d_p_s_a_m_l_access_information.rb b/lib/zitadel/client/models/beta_user_service_i_d_p_s_a_m_l_access_information.rb deleted file mode 100644 index 9f74b7f8..00000000 --- a/lib/zitadel/client/models/beta_user_service_i_d_p_s_a_m_l_access_information.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceIDPSAMLAccessInformation - attr_accessor :assertion - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'assertion' => :'assertion' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'assertion' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceIDPSAMLAccessInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceIDPSAMLAccessInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'assertion') - self.assertion = attributes[:'assertion'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - assertion == o.assertion - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [assertion].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_idp_information.rb b/lib/zitadel/client/models/beta_user_service_idp_information.rb new file mode 100644 index 00000000..bda645f2 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_idp_information.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceIDPInformation. + class BetaUserServiceIDPInformation < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_id: 'idpId', + user_id: 'userId', + user_name: 'userName', + raw_information: 'rawInformation', + ldap: 'ldap', + oauth: 'oauth', + saml: 'saml' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_id: 'String', + user_id: 'String', + user_name: 'String', + raw_information: 'Hash', + ldap: 'BetaUserServiceIDPLDAPAccessInformation', + oauth: 'BetaUserServiceIDPOAuthAccessInformation', + saml: 'BetaUserServiceIDPSAMLAccessInformation' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_name, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :raw_information, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ldap, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oauth, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_idp_intent.rb b/lib/zitadel/client/models/beta_user_service_idp_intent.rb new file mode 100644 index 00000000..26cb8a04 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_idp_intent.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceIDPIntent. + class BetaUserServiceIDPIntent < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_intent_id: 'idpIntentId', + idp_intent_token: 'idpIntentToken', + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_intent_id: 'String', + idp_intent_token: 'String', + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp_intent_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_intent_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_idp_link.rb b/lib/zitadel/client/models/beta_user_service_idp_link.rb new file mode 100644 index 00000000..9d0465c9 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_idp_link.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceIDPLink. + class BetaUserServiceIDPLink < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_id: 'idpId', + user_id: 'userId', + user_name: 'userName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_id: 'String', + user_id: 'String', + user_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_name, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_idpldap_access_information.rb b/lib/zitadel/client/models/beta_user_service_idpldap_access_information.rb new file mode 100644 index 00000000..0a94ce74 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_idpldap_access_information.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceIDPLDAPAccessInformation. + class BetaUserServiceIDPLDAPAccessInformation < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + attributes: 'attributes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + attributes: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :attributes, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_idpo_auth_access_information.rb b/lib/zitadel/client/models/beta_user_service_idpo_auth_access_information.rb new file mode 100644 index 00000000..950eaf1b --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_idpo_auth_access_information.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceIDPOAuthAccessInformation. + class BetaUserServiceIDPOAuthAccessInformation < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + access_token: 'accessToken', + id_token: 'idToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + access_token: 'String', + id_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :access_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_token, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_idpsaml_access_information.rb b/lib/zitadel/client/models/beta_user_service_idpsaml_access_information.rb new file mode 100644 index 00000000..cd84a475 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_idpsaml_access_information.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceIDPSAMLAccessInformation. + class BetaUserServiceIDPSAMLAccessInformation < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + assertion: 'assertion' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + assertion: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + assertion: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :assertion, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_in_user_emails_query.rb b/lib/zitadel/client/models/beta_user_service_in_user_emails_query.rb index 98ffd282..afc05d99 100644 --- a/lib/zitadel/client/models/beta_user_service_in_user_emails_query.rb +++ b/lib/zitadel/client/models/beta_user_service_in_user_emails_query.rb @@ -1,218 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with email in list of emails. - class BetaUserServiceInUserEmailsQuery - attr_accessor :user_emails - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_emails' => :'userEmails' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_emails' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceInUserEmailsQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceInUserEmailsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_emails') - if (value = attributes[:'user_emails']).is_a?(Array) - self.user_emails = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_emails == o.user_emails - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_emails].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with email in list of emails. + class BetaUserServiceInUserEmailsQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_emails: 'userEmails' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_emails: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_emails, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_in_user_i_d_query.rb b/lib/zitadel/client/models/beta_user_service_in_user_i_d_query.rb deleted file mode 100644 index a021a5ca..00000000 --- a/lib/zitadel/client/models/beta_user_service_in_user_i_d_query.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Query for users with ID in list of IDs. - class BetaUserServiceInUserIDQuery - attr_accessor :user_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_ids' => :'userIds' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceInUserIDQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceInUserIDQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_ids') - if (value = attributes[:'user_ids']).is_a?(Array) - self.user_ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_ids == o.user_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_in_user_id_query.rb b/lib/zitadel/client/models/beta_user_service_in_user_id_query.rb new file mode 100644 index 00000000..865da6b2 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_in_user_id_query.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with ID in list of IDs. + class BetaUserServiceInUserIDQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_ids: 'userIds' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_l_d_a_p_credentials.rb b/lib/zitadel/client/models/beta_user_service_l_d_a_p_credentials.rb deleted file mode 100644 index 7602dea3..00000000 --- a/lib/zitadel/client/models/beta_user_service_l_d_a_p_credentials.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceLDAPCredentials - attr_accessor :username - - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'username' => :'username', - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'username' => :'String', - :'password' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceLDAPCredentials` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceLDAPCredentials`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - username == o.username && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [username, password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_last_name_query.rb b/lib/zitadel/client/models/beta_user_service_last_name_query.rb index 07741d0b..ac15cb36 100644 --- a/lib/zitadel/client/models/beta_user_service_last_name_query.rb +++ b/lib/zitadel/client/models/beta_user_service_last_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific last name. - class BetaUserServiceLastNameQuery - attr_accessor :last_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'last_name' => :'lastName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'last_name' => :'String', - :'method' => :'BetaUserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceLastNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceLastNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - last_name == o.last_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [last_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific last name. + class BetaUserServiceLastNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + last_name: 'lastName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + last_name: 'String', + method: 'BetaUserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :last_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_ldap_credentials.rb b/lib/zitadel/client/models/beta_user_service_ldap_credentials.rb new file mode 100644 index 00000000..525c4091 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_ldap_credentials.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceLDAPCredentials. + class BetaUserServiceLDAPCredentials < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + username: 'username', + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + username: 'String', + password: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rb b/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rb index 92e5ae27..d68e6922 100644 --- a/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rb +++ b/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceListAuthenticationMethodTypesRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListAuthenticationMethodTypesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListAuthenticationMethodTypesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceListAuthenticationMethodTypesRequest. + class BetaUserServiceListAuthenticationMethodTypesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rb b/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rb index 915813f1..f4118b87 100644 --- a/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rb +++ b/lib/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceListAuthenticationMethodTypesResponse - attr_accessor :details - - attr_accessor :auth_method_types - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'auth_method_types' => :'authMethodTypes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceListDetails', - :'auth_method_types' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListAuthenticationMethodTypesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListAuthenticationMethodTypesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'auth_method_types') - if (value = attributes[:'auth_method_types']).is_a?(Array) - self.auth_method_types = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - auth_method_types == o.auth_method_types - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, auth_method_types].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceListAuthenticationMethodTypesResponse. + class BetaUserServiceListAuthenticationMethodTypesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + auth_method_types: 'authMethodTypes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceListDetails', + auth_method_types: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_types, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_list_details.rb b/lib/zitadel/client/models/beta_user_service_list_details.rb index ec21895e..7b2a3553 100644 --- a/lib/zitadel/client/models/beta_user_service_list_details.rb +++ b/lib/zitadel/client/models/beta_user_service_list_details.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceListDetails - attr_accessor :total_result - - attr_accessor :processed_sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'processed_sequence' => :'processedSequence', - :'timestamp' => :'timestamp' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'processed_sequence' => :'Object', - :'timestamp' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'processed_sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'processed_sequence') - self.processed_sequence = attributes[:'processed_sequence'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - processed_sequence == o.processed_sequence && - timestamp == o.timestamp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, processed_sequence, timestamp].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceListDetails. + class BetaUserServiceListDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + processed_sequence: 'processedSequence', + timestamp: 'timestamp' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + processed_sequence: 'Object', + timestamp: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # @example null + attribute :processed_sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_list_query.rb b/lib/zitadel/client/models/beta_user_service_list_query.rb index 17b250e4..396abfbb 100644 --- a/lib/zitadel/client/models/beta_user_service_list_query.rb +++ b/lib/zitadel/client/models/beta_user_service_list_query.rb @@ -1,234 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceListQuery - attr_accessor :offset - - attr_accessor :limit - - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceListQuery. + class BetaUserServiceListQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_list_users_request.rb b/lib/zitadel/client/models/beta_user_service_list_users_request.rb index f3d73f67..0afa86ad 100644 --- a/lib/zitadel/client/models/beta_user_service_list_users_request.rb +++ b/lib/zitadel/client/models/beta_user_service_list_users_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceListUsersRequest - attr_accessor :query - - attr_accessor :sorting_column - - # criteria the client is looking for - attr_accessor :queries - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'query' => :'query', - :'sorting_column' => :'sortingColumn', - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'query' => :'BetaUserServiceListQuery', - :'sorting_column' => :'BetaUserServiceUserFieldName', - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListUsersRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListUsersRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - query == o.query && - sorting_column == o.sorting_column && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [query, sorting_column, queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceListUsersRequest. + class BetaUserServiceListUsersRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + query: 'query', + sorting_column: 'sortingColumn', + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + query: 'BetaUserServiceListQuery', + sorting_column: 'BetaUserServiceUserFieldName', + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # criteria the client is looking for + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_list_users_response.rb b/lib/zitadel/client/models/beta_user_service_list_users_response.rb index 446978c2..5c269c9b 100644 --- a/lib/zitadel/client/models/beta_user_service_list_users_response.rb +++ b/lib/zitadel/client/models/beta_user_service_list_users_response.rb @@ -1,257 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceListUsersResponse - attr_accessor :details - - attr_accessor :sorting_column - - attr_accessor :result - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'sorting_column' => :'sortingColumn', - :'result' => :'result' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceListDetails', - :'sorting_column' => :'BetaUserServiceUserFieldName', - :'result' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceListUsersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceListUsersResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'result') - if (value = attributes[:'result']).is_a?(Array) - self.result = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - sorting_column == o.sorting_column && - result == o.result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, sorting_column, result].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceListUsersResponse. + class BetaUserServiceListUsersResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + sorting_column: 'sortingColumn', + result: 'result' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceListDetails', + sorting_column: 'BetaUserServiceUserFieldName', + result: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # @example null + attribute :result, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_lock_user_request.rb b/lib/zitadel/client/models/beta_user_service_lock_user_request.rb index bd965c20..ea8afb3b 100644 --- a/lib/zitadel/client/models/beta_user_service_lock_user_request.rb +++ b/lib/zitadel/client/models/beta_user_service_lock_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceLockUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceLockUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceLockUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceLockUserRequest. + class BetaUserServiceLockUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_lock_user_response.rb b/lib/zitadel/client/models/beta_user_service_lock_user_response.rb index fb82c0aa..adc7435d 100644 --- a/lib/zitadel/client/models/beta_user_service_lock_user_response.rb +++ b/lib/zitadel/client/models/beta_user_service_lock_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceLockUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceLockUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceLockUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceLockUserResponse. + class BetaUserServiceLockUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_login_name_query.rb b/lib/zitadel/client/models/beta_user_service_login_name_query.rb index e6dd442b..ee7bc7f9 100644 --- a/lib/zitadel/client/models/beta_user_service_login_name_query.rb +++ b/lib/zitadel/client/models/beta_user_service_login_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific state. - class BetaUserServiceLoginNameQuery - attr_accessor :login_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_name' => :'loginName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_name' => :'String', - :'method' => :'BetaUserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceLoginNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceLoginNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_name') - self.login_name = attributes[:'login_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_name == o.login_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific state. + class BetaUserServiceLoginNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_name: 'loginName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_name: 'String', + method: 'BetaUserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_machine_user.rb b/lib/zitadel/client/models/beta_user_service_machine_user.rb index 43a19b5f..da843225 100644 --- a/lib/zitadel/client/models/beta_user_service_machine_user.rb +++ b/lib/zitadel/client/models/beta_user_service_machine_user.rb @@ -1,264 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceMachineUser - attr_accessor :name - - attr_accessor :description - - attr_accessor :has_secret - - attr_accessor :access_token_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'description' => :'description', - :'has_secret' => :'hasSecret', - :'access_token_type' => :'accessTokenType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'description' => :'String', - :'has_secret' => :'Boolean', - :'access_token_type' => :'BetaUserServiceAccessTokenType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceMachineUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceMachineUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'has_secret') - self.has_secret = attributes[:'has_secret'] - end - - if attributes.key?(:'access_token_type') - self.access_token_type = attributes[:'access_token_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - description == o.description && - has_secret == o.has_secret && - access_token_type == o.access_token_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, description, has_secret, access_token_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceMachineUser. + class BetaUserServiceMachineUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + description: 'description', + has_secret: 'hasSecret', + access_token_type: 'accessTokenType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + description: 'String', + has_secret: 'Boolean', + access_token_type: 'BetaUserServiceAccessTokenType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :description, Types::Any.optional.meta(omittable: true) + # @example null + attribute :has_secret, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_nick_name_query.rb b/lib/zitadel/client/models/beta_user_service_nick_name_query.rb index 7937d7e3..90da5986 100644 --- a/lib/zitadel/client/models/beta_user_service_nick_name_query.rb +++ b/lib/zitadel/client/models/beta_user_service_nick_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific nickname. - class BetaUserServiceNickNameQuery - attr_accessor :nick_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'nick_name' => :'nickName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'nick_name' => :'String', - :'method' => :'BetaUserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceNickNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceNickNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - nick_name == o.nick_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [nick_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific nickname. + class BetaUserServiceNickNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + nick_name: 'nickName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + nick_name: 'String', + method: 'BetaUserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :nick_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_not_query.rb b/lib/zitadel/client/models/beta_user_service_not_query.rb index 0d23def4..92e70f2c 100644 --- a/lib/zitadel/client/models/beta_user_service_not_query.rb +++ b/lib/zitadel/client/models/beta_user_service_not_query.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Negate the sub-condition. - class BetaUserServiceNotQuery - attr_accessor :query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'query' => :'query' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'query' => :'BetaUserServiceSearchQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceNotQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceNotQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - query == o.query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Negate the sub-condition. + class BetaUserServiceNotQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + query: 'query' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + query: 'BetaUserServiceSearchQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_notification_type.rb b/lib/zitadel/client/models/beta_user_service_notification_type.rb index 2330d4b9..4c9a4179 100644 --- a/lib/zitadel/client/models/beta_user_service_notification_type.rb +++ b/lib/zitadel/client/models/beta_user_service_notification_type.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaUserServiceNotificationType - NOTIFICATION_TYPE_UNSPECIFIED = "NOTIFICATION_TYPE_Unspecified".freeze - NOTIFICATION_TYPE_EMAIL = "NOTIFICATION_TYPE_Email".freeze - NOTIFICATION_TYPE_SMS = "NOTIFICATION_TYPE_SMS".freeze - - def self.all_vars - @all_vars ||= [NOTIFICATION_TYPE_UNSPECIFIED, NOTIFICATION_TYPE_EMAIL, NOTIFICATION_TYPE_SMS].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaUserServiceNotificationType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceNotificationType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaUserServiceNotificationType. + class BetaUserServiceNotificationType + NOTIFICATION_TYPE_UNSPECIFIED = 'NOTIFICATION_TYPE_Unspecified' + NOTIFICATION_TYPE_EMAIL = 'NOTIFICATION_TYPE_Email' + NOTIFICATION_TYPE_SMS = 'NOTIFICATION_TYPE_SMS' + + # Frozen set of all allowed values, used for validation. + VALUES = [NOTIFICATION_TYPE_UNSPECIFIED, NOTIFICATION_TYPE_EMAIL, NOTIFICATION_TYPE_SMS].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaUserServiceNotificationType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_user_service_or_query.rb b/lib/zitadel/client/models/beta_user_service_or_query.rb index b4e52601..2b7cc5f5 100644 --- a/lib/zitadel/client/models/beta_user_service_or_query.rb +++ b/lib/zitadel/client/models/beta_user_service_or_query.rb @@ -1,218 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Connect multiple sub-condition with and OR operator. - class BetaUserServiceOrQuery - attr_accessor :queries - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceOrQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceOrQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Connect multiple sub-condition with and OR operator. + class BetaUserServiceOrQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_organization.rb b/lib/zitadel/client/models/beta_user_service_organization.rb index cc4c86c2..1c6f9f78 100644 --- a/lib/zitadel/client/models/beta_user_service_organization.rb +++ b/lib/zitadel/client/models/beta_user_service_organization.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceOrganization - attr_accessor :org_domain - - attr_accessor :org_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'org_domain' => :'orgDomain', - :'org_id' => :'orgId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'org_domain' => :'String', - :'org_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceOrganization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'org_domain') - self.org_domain = attributes[:'org_domain'] - end - - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - org_domain == o.org_domain && - org_id == o.org_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [org_domain, org_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceOrganization. + class BetaUserServiceOrganization < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + org_domain: 'orgDomain', + org_id: 'orgId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + org_domain: 'String', + org_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :org_domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :org_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_organization_id_query.rb b/lib/zitadel/client/models/beta_user_service_organization_id_query.rb index a0d22cde..55eda7fd 100644 --- a/lib/zitadel/client/models/beta_user_service_organization_id_query.rb +++ b/lib/zitadel/client/models/beta_user_service_organization_id_query.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users under a specific organization as resource owner. - class BetaUserServiceOrganizationIdQuery - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceOrganizationIdQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceOrganizationIdQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users under a specific organization as resource owner. + class BetaUserServiceOrganizationIdQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_passkey_authenticator.rb b/lib/zitadel/client/models/beta_user_service_passkey_authenticator.rb index e12bd18d..aebff592 100644 --- a/lib/zitadel/client/models/beta_user_service_passkey_authenticator.rb +++ b/lib/zitadel/client/models/beta_user_service_passkey_authenticator.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaUserServicePasskeyAuthenticator - PASSKEY_AUTHENTICATOR_UNSPECIFIED = "PASSKEY_AUTHENTICATOR_UNSPECIFIED".freeze - PASSKEY_AUTHENTICATOR_PLATFORM = "PASSKEY_AUTHENTICATOR_PLATFORM".freeze - PASSKEY_AUTHENTICATOR_CROSS_PLATFORM = "PASSKEY_AUTHENTICATOR_CROSS_PLATFORM".freeze - - def self.all_vars - @all_vars ||= [PASSKEY_AUTHENTICATOR_UNSPECIFIED, PASSKEY_AUTHENTICATOR_PLATFORM, PASSKEY_AUTHENTICATOR_CROSS_PLATFORM].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaUserServicePasskeyAuthenticator.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServicePasskeyAuthenticator" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaUserServicePasskeyAuthenticator. + class BetaUserServicePasskeyAuthenticator + PASSKEY_AUTHENTICATOR_UNSPECIFIED = 'PASSKEY_AUTHENTICATOR_UNSPECIFIED' + PASSKEY_AUTHENTICATOR_PLATFORM = 'PASSKEY_AUTHENTICATOR_PLATFORM' + PASSKEY_AUTHENTICATOR_CROSS_PLATFORM = 'PASSKEY_AUTHENTICATOR_CROSS_PLATFORM' + + # Frozen set of all allowed values, used for validation. + VALUES = [PASSKEY_AUTHENTICATOR_UNSPECIFIED, PASSKEY_AUTHENTICATOR_PLATFORM, PASSKEY_AUTHENTICATOR_CROSS_PLATFORM].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaUserServicePasskeyAuthenticator: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_user_service_passkey_registration_code.rb b/lib/zitadel/client/models/beta_user_service_passkey_registration_code.rb index 01a30211..896fc421 100644 --- a/lib/zitadel/client/models/beta_user_service_passkey_registration_code.rb +++ b/lib/zitadel/client/models/beta_user_service_passkey_registration_code.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServicePasskeyRegistrationCode - attr_accessor :id - - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServicePasskeyRegistrationCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServicePasskeyRegistrationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServicePasskeyRegistrationCode. + class BetaUserServicePasskeyRegistrationCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_password.rb b/lib/zitadel/client/models/beta_user_service_password.rb index d77ab28c..27c5d795 100644 --- a/lib/zitadel/client/models/beta_user_service_password.rb +++ b/lib/zitadel/client/models/beta_user_service_password.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServicePassword - attr_accessor :password - - attr_accessor :change_required - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'password' => :'password', - :'change_required' => :'changeRequired' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'password' => :'String', - :'change_required' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServicePassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServicePassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'change_required') - self.change_required = attributes[:'change_required'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - password == o.password && - change_required == o.change_required - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [password, change_required].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServicePassword. + class BetaUserServicePassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + password: 'password', + change_required: 'changeRequired' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + password: 'String', + change_required: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_required, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_password_reset_request.rb b/lib/zitadel/client/models/beta_user_service_password_reset_request.rb index a5bd2a27..16a96922 100644 --- a/lib/zitadel/client/models/beta_user_service_password_reset_request.rb +++ b/lib/zitadel/client/models/beta_user_service_password_reset_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServicePasswordResetRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_link - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_link' => :'sendLink' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_link' => :'BetaUserServiceSendPasswordResetLink' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServicePasswordResetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServicePasswordResetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_link') - self.send_link = attributes[:'send_link'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_link == o.send_link - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_link].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServicePasswordResetRequest. + class BetaUserServicePasswordResetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_link: 'sendLink' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_link: 'BetaUserServiceSendPasswordResetLink' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_link, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_password_reset_response.rb b/lib/zitadel/client/models/beta_user_service_password_reset_response.rb index 883729a2..9f677fd9 100644 --- a/lib/zitadel/client/models/beta_user_service_password_reset_response.rb +++ b/lib/zitadel/client/models/beta_user_service_password_reset_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServicePasswordResetResponse - attr_accessor :details - - # in case the medium was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServicePasswordResetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServicePasswordResetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServicePasswordResetResponse. + class BetaUserServicePasswordResetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the medium was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_phone_query.rb b/lib/zitadel/client/models/beta_user_service_phone_query.rb index 9b599e22..3bb8c868 100644 --- a/lib/zitadel/client/models/beta_user_service_phone_query.rb +++ b/lib/zitadel/client/models/beta_user_service_phone_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific phone. - class BetaUserServicePhoneQuery - attr_accessor :number - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'number' => :'number', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'number' => :'String', - :'method' => :'BetaUserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServicePhoneQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServicePhoneQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'number') - self.number = attributes[:'number'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - number == o.number && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [number, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific phone. + class BetaUserServicePhoneQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + number: 'number', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + number: 'String', + method: 'BetaUserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :number, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_reactivate_user_request.rb b/lib/zitadel/client/models/beta_user_service_reactivate_user_request.rb index 50a007b1..4b08e823 100644 --- a/lib/zitadel/client/models/beta_user_service_reactivate_user_request.rb +++ b/lib/zitadel/client/models/beta_user_service_reactivate_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceReactivateUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceReactivateUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceReactivateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceReactivateUserRequest. + class BetaUserServiceReactivateUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_reactivate_user_response.rb b/lib/zitadel/client/models/beta_user_service_reactivate_user_response.rb index 7d731004..ac11d143 100644 --- a/lib/zitadel/client/models/beta_user_service_reactivate_user_response.rb +++ b/lib/zitadel/client/models/beta_user_service_reactivate_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceReactivateUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceReactivateUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceReactivateUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceReactivateUserResponse. + class BetaUserServiceReactivateUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_redirect_u_r_ls.rb b/lib/zitadel/client/models/beta_user_service_redirect_u_r_ls.rb deleted file mode 100644 index 6730d8b0..00000000 --- a/lib/zitadel/client/models/beta_user_service_redirect_u_r_ls.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRedirectURLs - attr_accessor :success_url - - attr_accessor :failure_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'success_url' => :'successUrl', - :'failure_url' => :'failureUrl' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'success_url' => :'String', - :'failure_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRedirectURLs` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRedirectURLs`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'success_url') - self.success_url = attributes[:'success_url'] - end - - if attributes.key?(:'failure_url') - self.failure_url = attributes[:'failure_url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - success_url == o.success_url && - failure_url == o.failure_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [success_url, failure_url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_redirect_urls.rb b/lib/zitadel/client/models/beta_user_service_redirect_urls.rb new file mode 100644 index 00000000..784f82ec --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_redirect_urls.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRedirectURLs. + class BetaUserServiceRedirectURLs < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + success_url: 'successUrl', + failure_url: 'failureUrl' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + success_url: 'String', + failure_url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :success_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :failure_url, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_register_passkey_request.rb b/lib/zitadel/client/models/beta_user_service_register_passkey_request.rb index 6d2e7353..f6799d71 100644 --- a/lib/zitadel/client/models/beta_user_service_register_passkey_request.rb +++ b/lib/zitadel/client/models/beta_user_service_register_passkey_request.rb @@ -1,264 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRegisterPasskeyRequest - attr_accessor :user_id - - attr_accessor :code - - attr_accessor :authenticator - - attr_accessor :domain - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'code' => :'code', - :'authenticator' => :'authenticator', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'code' => :'BetaUserServicePasskeyRegistrationCode', - :'authenticator' => :'BetaUserServicePasskeyAuthenticator', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterPasskeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterPasskeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'authenticator') - self.authenticator = attributes[:'authenticator'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - code == o.code && - authenticator == o.authenticator && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, code, authenticator, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRegisterPasskeyRequest. + class BetaUserServiceRegisterPasskeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + code: 'code', + authenticator: 'authenticator', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + code: 'BetaUserServicePasskeyRegistrationCode', + authenticator: 'BetaUserServicePasskeyAuthenticator', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :authenticator, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_register_passkey_response.rb b/lib/zitadel/client/models/beta_user_service_register_passkey_response.rb index 80a548d0..4c121aee 100644 --- a/lib/zitadel/client/models/beta_user_service_register_passkey_response.rb +++ b/lib/zitadel/client/models/beta_user_service_register_passkey_response.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRegisterPasskeyResponse - attr_accessor :details - - attr_accessor :passkey_id - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :public_key_credential_creation_options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'passkey_id' => :'passkeyId', - :'public_key_credential_creation_options' => :'publicKeyCredentialCreationOptions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'passkey_id' => :'String', - :'public_key_credential_creation_options' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterPasskeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterPasskeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'passkey_id') - self.passkey_id = attributes[:'passkey_id'] - end - - if attributes.key?(:'public_key_credential_creation_options') - if (value = attributes[:'public_key_credential_creation_options']).is_a?(Hash) - self.public_key_credential_creation_options = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - passkey_id == o.passkey_id && - public_key_credential_creation_options == o.public_key_credential_creation_options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, passkey_id, public_key_credential_creation_options].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRegisterPasskeyResponse. + class BetaUserServiceRegisterPasskeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + passkey_id: 'passkeyId', + public_key_credential_creation_options: 'publicKeyCredentialCreationOptions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + passkey_id: 'String', + public_key_credential_creation_options: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :passkey_id, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :public_key_credential_creation_options, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_request.rb b/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_request.rb deleted file mode 100644 index c556d325..00000000 --- a/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRegisterTOTPRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterTOTPRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterTOTPRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_response.rb b/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_response.rb deleted file mode 100644 index f391ac8e..00000000 --- a/lib/zitadel/client/models/beta_user_service_register_t_o_t_p_response.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRegisterTOTPResponse - attr_accessor :details - - attr_accessor :uri - - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'uri' => :'uri', - :'secret' => :'secret' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'uri' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterTOTPResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterTOTPResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'uri') - self.uri = attributes[:'uri'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - uri == o.uri && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, uri, secret].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_register_totp_request.rb b/lib/zitadel/client/models/beta_user_service_register_totp_request.rb new file mode 100644 index 00000000..0ad7b7a9 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_register_totp_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRegisterTOTPRequest. + class BetaUserServiceRegisterTOTPRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_register_totp_response.rb b/lib/zitadel/client/models/beta_user_service_register_totp_response.rb new file mode 100644 index 00000000..d1c0a27c --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_register_totp_response.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRegisterTOTPResponse. + class BetaUserServiceRegisterTOTPResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + uri: 'uri', + secret: 'secret' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + uri: 'String', + secret: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :secret, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_register_u2_f_request.rb b/lib/zitadel/client/models/beta_user_service_register_u2_f_request.rb index 4aabb3d1..7ee81957 100644 --- a/lib/zitadel/client/models/beta_user_service_register_u2_f_request.rb +++ b/lib/zitadel/client/models/beta_user_service_register_u2_f_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRegisterU2FRequest - attr_accessor :user_id - - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterU2FRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterU2FRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRegisterU2FRequest. + class BetaUserServiceRegisterU2FRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_register_u2_f_response.rb b/lib/zitadel/client/models/beta_user_service_register_u2_f_response.rb index 0e50817f..5c5f45ac 100644 --- a/lib/zitadel/client/models/beta_user_service_register_u2_f_response.rb +++ b/lib/zitadel/client/models/beta_user_service_register_u2_f_response.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRegisterU2FResponse - attr_accessor :details - - attr_accessor :u2f_id - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :public_key_credential_creation_options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'u2f_id' => :'u2fId', - :'public_key_credential_creation_options' => :'publicKeyCredentialCreationOptions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'u2f_id' => :'String', - :'public_key_credential_creation_options' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRegisterU2FResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRegisterU2FResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'u2f_id') - self.u2f_id = attributes[:'u2f_id'] - end - - if attributes.key?(:'public_key_credential_creation_options') - if (value = attributes[:'public_key_credential_creation_options']).is_a?(Hash) - self.public_key_credential_creation_options = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - u2f_id == o.u2f_id && - public_key_credential_creation_options == o.public_key_credential_creation_options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, u2f_id, public_key_credential_creation_options].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRegisterU2FResponse. + class BetaUserServiceRegisterU2FResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + u2f_id: 'u2fId', + public_key_credential_creation_options: 'publicKeyCredentialCreationOptions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + u2f_id: 'String', + public_key_credential_creation_options: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :u2f_id, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :public_key_credential_creation_options, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_request.rb b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_request.rb deleted file mode 100644 index 017bcf39..00000000 --- a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRemoveOTPEmailRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveOTPEmailRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveOTPEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_response.rb b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_response.rb deleted file mode 100644 index f5c212d1..00000000 --- a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_email_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRemoveOTPEmailResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveOTPEmailResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveOTPEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_request.rb b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_request.rb deleted file mode 100644 index 8a8d172a..00000000 --- a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRemoveOTPSMSRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveOTPSMSRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveOTPSMSRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_response.rb b/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_response.rb deleted file mode 100644 index f5a76a08..00000000 --- a/lib/zitadel/client/models/beta_user_service_remove_o_t_p_s_m_s_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRemoveOTPSMSResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveOTPSMSResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveOTPSMSResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_remove_otp_email_request.rb b/lib/zitadel/client/models/beta_user_service_remove_otp_email_request.rb new file mode 100644 index 00000000..28150307 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_otp_email_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRemoveOTPEmailRequest. + class BetaUserServiceRemoveOTPEmailRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_remove_otp_email_response.rb b/lib/zitadel/client/models/beta_user_service_remove_otp_email_response.rb new file mode 100644 index 00000000..3969345e --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_otp_email_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRemoveOTPEmailResponse. + class BetaUserServiceRemoveOTPEmailResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_remove_otpsms_request.rb b/lib/zitadel/client/models/beta_user_service_remove_otpsms_request.rb new file mode 100644 index 00000000..6760bc50 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_otpsms_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRemoveOTPSMSRequest. + class BetaUserServiceRemoveOTPSMSRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_remove_otpsms_response.rb b/lib/zitadel/client/models/beta_user_service_remove_otpsms_response.rb new file mode 100644 index 00000000..1440804b --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_otpsms_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRemoveOTPSMSResponse. + class BetaUserServiceRemoveOTPSMSResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_remove_phone_request.rb b/lib/zitadel/client/models/beta_user_service_remove_phone_request.rb index c7c44bad..a7405ccc 100644 --- a/lib/zitadel/client/models/beta_user_service_remove_phone_request.rb +++ b/lib/zitadel/client/models/beta_user_service_remove_phone_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRemovePhoneRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemovePhoneRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemovePhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRemovePhoneRequest. + class BetaUserServiceRemovePhoneRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_remove_phone_response.rb b/lib/zitadel/client/models/beta_user_service_remove_phone_response.rb index 7e5f60d8..d5d15c9e 100644 --- a/lib/zitadel/client/models/beta_user_service_remove_phone_response.rb +++ b/lib/zitadel/client/models/beta_user_service_remove_phone_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRemovePhoneResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemovePhoneResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemovePhoneResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRemovePhoneResponse. + class BetaUserServiceRemovePhoneResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_request.rb b/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_request.rb deleted file mode 100644 index 4151c816..00000000 --- a/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRemoveTOTPRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveTOTPRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveTOTPRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_response.rb b/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_response.rb deleted file mode 100644 index c102ccc0..00000000 --- a/lib/zitadel/client/models/beta_user_service_remove_t_o_t_p_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRemoveTOTPResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRemoveTOTPResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRemoveTOTPResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_remove_totp_request.rb b/lib/zitadel/client/models/beta_user_service_remove_totp_request.rb new file mode 100644 index 00000000..5d0a5363 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_totp_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRemoveTOTPRequest. + class BetaUserServiceRemoveTOTPRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_remove_totp_response.rb b/lib/zitadel/client/models/beta_user_service_remove_totp_response.rb new file mode 100644 index 00000000..ba111990 --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_remove_totp_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRemoveTOTPResponse. + class BetaUserServiceRemoveTOTPResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_resend_email_code_request.rb b/lib/zitadel/client/models/beta_user_service_resend_email_code_request.rb index 63245115..6f09dde5 100644 --- a/lib/zitadel/client/models/beta_user_service_resend_email_code_request.rb +++ b/lib/zitadel/client/models/beta_user_service_resend_email_code_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceResendEmailCodeRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_code' => :'BetaUserServiceSendEmailVerificationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceResendEmailCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceResendEmailCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceResendEmailCodeRequest. + class BetaUserServiceResendEmailCodeRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_code: 'BetaUserServiceSendEmailVerificationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_resend_email_code_response.rb b/lib/zitadel/client/models/beta_user_service_resend_email_code_response.rb index 38e01ab7..e9011c06 100644 --- a/lib/zitadel/client/models/beta_user_service_resend_email_code_response.rb +++ b/lib/zitadel/client/models/beta_user_service_resend_email_code_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceResendEmailCodeResponse - attr_accessor :details - - # in case the verification was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceResendEmailCodeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceResendEmailCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceResendEmailCodeResponse. + class BetaUserServiceResendEmailCodeResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the verification was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_resend_phone_code_request.rb b/lib/zitadel/client/models/beta_user_service_resend_phone_code_request.rb index 0fc1900d..ec12efe8 100644 --- a/lib/zitadel/client/models/beta_user_service_resend_phone_code_request.rb +++ b/lib/zitadel/client/models/beta_user_service_resend_phone_code_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceResendPhoneCodeRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceResendPhoneCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceResendPhoneCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceResendPhoneCodeRequest. + class BetaUserServiceResendPhoneCodeRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_code: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_resend_phone_code_response.rb b/lib/zitadel/client/models/beta_user_service_resend_phone_code_response.rb index 2c96142a..a056d478 100644 --- a/lib/zitadel/client/models/beta_user_service_resend_phone_code_response.rb +++ b/lib/zitadel/client/models/beta_user_service_resend_phone_code_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceResendPhoneCodeResponse - attr_accessor :details - - # in case the verification was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceResendPhoneCodeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceResendPhoneCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceResendPhoneCodeResponse. + class BetaUserServiceResendPhoneCodeResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the verification was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rb b/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rb index 0c4e53d1..0c302f75 100644 --- a/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rb +++ b/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRetrieveIdentityProviderIntentRequest - attr_accessor :idp_intent_id - - attr_accessor :idp_intent_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_intent_id' => :'idpIntentId', - :'idp_intent_token' => :'idpIntentToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_intent_id' => :'String', - :'idp_intent_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRetrieveIdentityProviderIntentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRetrieveIdentityProviderIntentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_intent_id') - self.idp_intent_id = attributes[:'idp_intent_id'] - end - - if attributes.key?(:'idp_intent_token') - self.idp_intent_token = attributes[:'idp_intent_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_intent_id == o.idp_intent_id && - idp_intent_token == o.idp_intent_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_intent_id, idp_intent_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRetrieveIdentityProviderIntentRequest. + class BetaUserServiceRetrieveIdentityProviderIntentRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_intent_id: 'idpIntentId', + idp_intent_token: 'idpIntentToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_intent_id: 'String', + idp_intent_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :idp_intent_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_intent_token, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rb b/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rb index ab5bab71..745c4577 100644 --- a/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rb +++ b/lib/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceRetrieveIdentityProviderIntentResponse - attr_accessor :details - - attr_accessor :idp_information - - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'idp_information' => :'idpInformation', - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'idp_information' => :'BetaUserServiceIDPInformation', - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceRetrieveIdentityProviderIntentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceRetrieveIdentityProviderIntentResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'idp_information') - self.idp_information = attributes[:'idp_information'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - idp_information == o.idp_information && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, idp_information, user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceRetrieveIdentityProviderIntentResponse. + class BetaUserServiceRetrieveIdentityProviderIntentResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + idp_information: 'idpInformation', + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + idp_information: 'BetaUserServiceIDPInformation', + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_information, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_search_query.rb b/lib/zitadel/client/models/beta_user_service_search_query.rb index 779c6cd1..eac4f9c0 100644 --- a/lib/zitadel/client/models/beta_user_service_search_query.rb +++ b/lib/zitadel/client/models/beta_user_service_search_query.rb @@ -1,350 +1,133 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSearchQuery - attr_accessor :and_query - - attr_accessor :display_name_query - - attr_accessor :email_query - - attr_accessor :first_name_query - - attr_accessor :in_user_emails_query - - attr_accessor :in_user_ids_query - - attr_accessor :last_name_query - - attr_accessor :login_name_query - - attr_accessor :nick_name_query - - attr_accessor :not_query - - attr_accessor :or_query - - attr_accessor :organization_id_query - - attr_accessor :phone_query - - attr_accessor :state_query - - attr_accessor :type_query - - attr_accessor :user_name_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'and_query' => :'andQuery', - :'display_name_query' => :'displayNameQuery', - :'email_query' => :'emailQuery', - :'first_name_query' => :'firstNameQuery', - :'in_user_emails_query' => :'inUserEmailsQuery', - :'in_user_ids_query' => :'inUserIdsQuery', - :'last_name_query' => :'lastNameQuery', - :'login_name_query' => :'loginNameQuery', - :'nick_name_query' => :'nickNameQuery', - :'not_query' => :'notQuery', - :'or_query' => :'orQuery', - :'organization_id_query' => :'organizationIdQuery', - :'phone_query' => :'phoneQuery', - :'state_query' => :'stateQuery', - :'type_query' => :'typeQuery', - :'user_name_query' => :'userNameQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'and_query' => :'BetaUserServiceAndQuery', - :'display_name_query' => :'BetaUserServiceDisplayNameQuery', - :'email_query' => :'BetaUserServiceEmailQuery', - :'first_name_query' => :'BetaUserServiceFirstNameQuery', - :'in_user_emails_query' => :'BetaUserServiceInUserEmailsQuery', - :'in_user_ids_query' => :'BetaUserServiceInUserIDQuery', - :'last_name_query' => :'BetaUserServiceLastNameQuery', - :'login_name_query' => :'BetaUserServiceLoginNameQuery', - :'nick_name_query' => :'BetaUserServiceNickNameQuery', - :'not_query' => :'BetaUserServiceNotQuery', - :'or_query' => :'BetaUserServiceOrQuery', - :'organization_id_query' => :'BetaUserServiceOrganizationIdQuery', - :'phone_query' => :'BetaUserServicePhoneQuery', - :'state_query' => :'BetaUserServiceStateQuery', - :'type_query' => :'BetaUserServiceTypeQuery', - :'user_name_query' => :'BetaUserServiceUserNameQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'and_query') - self.and_query = attributes[:'and_query'] - end - - if attributes.key?(:'display_name_query') - self.display_name_query = attributes[:'display_name_query'] - end - - if attributes.key?(:'email_query') - self.email_query = attributes[:'email_query'] - end - - if attributes.key?(:'first_name_query') - self.first_name_query = attributes[:'first_name_query'] - end - - if attributes.key?(:'in_user_emails_query') - self.in_user_emails_query = attributes[:'in_user_emails_query'] - end - - if attributes.key?(:'in_user_ids_query') - self.in_user_ids_query = attributes[:'in_user_ids_query'] - end - - if attributes.key?(:'last_name_query') - self.last_name_query = attributes[:'last_name_query'] - end - - if attributes.key?(:'login_name_query') - self.login_name_query = attributes[:'login_name_query'] - end - - if attributes.key?(:'nick_name_query') - self.nick_name_query = attributes[:'nick_name_query'] - end - - if attributes.key?(:'not_query') - self.not_query = attributes[:'not_query'] - end - - if attributes.key?(:'or_query') - self.or_query = attributes[:'or_query'] - end - - if attributes.key?(:'organization_id_query') - self.organization_id_query = attributes[:'organization_id_query'] - end - - if attributes.key?(:'phone_query') - self.phone_query = attributes[:'phone_query'] - end - - if attributes.key?(:'state_query') - self.state_query = attributes[:'state_query'] - end - - if attributes.key?(:'type_query') - self.type_query = attributes[:'type_query'] - end - - if attributes.key?(:'user_name_query') - self.user_name_query = attributes[:'user_name_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - and_query == o.and_query && - display_name_query == o.display_name_query && - email_query == o.email_query && - first_name_query == o.first_name_query && - in_user_emails_query == o.in_user_emails_query && - in_user_ids_query == o.in_user_ids_query && - last_name_query == o.last_name_query && - login_name_query == o.login_name_query && - nick_name_query == o.nick_name_query && - not_query == o.not_query && - or_query == o.or_query && - organization_id_query == o.organization_id_query && - phone_query == o.phone_query && - state_query == o.state_query && - type_query == o.type_query && - user_name_query == o.user_name_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [and_query, display_name_query, email_query, first_name_query, in_user_emails_query, in_user_ids_query, last_name_query, login_name_query, nick_name_query, not_query, or_query, organization_id_query, phone_query, state_query, type_query, user_name_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSearchQuery. + class BetaUserServiceSearchQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + and_query: 'andQuery', + display_name_query: 'displayNameQuery', + email_query: 'emailQuery', + first_name_query: 'firstNameQuery', + in_user_emails_query: 'inUserEmailsQuery', + in_user_ids_query: 'inUserIdsQuery', + last_name_query: 'lastNameQuery', + login_name_query: 'loginNameQuery', + nick_name_query: 'nickNameQuery', + not_query: 'notQuery', + or_query: 'orQuery', + organization_id_query: 'organizationIdQuery', + phone_query: 'phoneQuery', + state_query: 'stateQuery', + type_query: 'typeQuery', + user_name_query: 'userNameQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + and_query: 'BetaUserServiceAndQuery', + display_name_query: 'BetaUserServiceDisplayNameQuery', + email_query: 'BetaUserServiceEmailQuery', + first_name_query: 'BetaUserServiceFirstNameQuery', + in_user_emails_query: 'BetaUserServiceInUserEmailsQuery', + in_user_ids_query: 'BetaUserServiceInUserIDQuery', + last_name_query: 'BetaUserServiceLastNameQuery', + login_name_query: 'BetaUserServiceLoginNameQuery', + nick_name_query: 'BetaUserServiceNickNameQuery', + not_query: 'BetaUserServiceNotQuery', + or_query: 'BetaUserServiceOrQuery', + organization_id_query: 'BetaUserServiceOrganizationIdQuery', + phone_query: 'BetaUserServicePhoneQuery', + state_query: 'BetaUserServiceStateQuery', + type_query: 'BetaUserServiceTypeQuery', + user_name_query: 'BetaUserServiceUserNameQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :and_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :first_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_user_emails_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_user_ids_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :last_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :nick_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :not_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :or_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :type_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_name_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_send_email_verification_code.rb b/lib/zitadel/client/models/beta_user_service_send_email_verification_code.rb index 310630b4..95ef0bdd 100644 --- a/lib/zitadel/client/models/beta_user_service_send_email_verification_code.rb +++ b/lib/zitadel/client/models/beta_user_service_send_email_verification_code.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSendEmailVerificationCode - attr_accessor :url_template - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSendEmailVerificationCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSendEmailVerificationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSendEmailVerificationCode. + class BetaUserServiceSendEmailVerificationCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_send_passkey_registration_link.rb b/lib/zitadel/client/models/beta_user_service_send_passkey_registration_link.rb index d6bb1279..097843a6 100644 --- a/lib/zitadel/client/models/beta_user_service_send_passkey_registration_link.rb +++ b/lib/zitadel/client/models/beta_user_service_send_passkey_registration_link.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSendPasskeyRegistrationLink - attr_accessor :url_template - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSendPasskeyRegistrationLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSendPasskeyRegistrationLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSendPasskeyRegistrationLink. + class BetaUserServiceSendPasskeyRegistrationLink < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_send_password_reset_link.rb b/lib/zitadel/client/models/beta_user_service_send_password_reset_link.rb index fbeea1ee..497d433c 100644 --- a/lib/zitadel/client/models/beta_user_service_send_password_reset_link.rb +++ b/lib/zitadel/client/models/beta_user_service_send_password_reset_link.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSendPasswordResetLink - attr_accessor :notification_type - - attr_accessor :url_template - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'notification_type' => :'notificationType', - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'notification_type' => :'BetaUserServiceNotificationType', - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSendPasswordResetLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSendPasswordResetLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'notification_type') - self.notification_type = attributes[:'notification_type'] - end - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - notification_type == o.notification_type && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [notification_type, url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSendPasswordResetLink. + class BetaUserServiceSendPasswordResetLink < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + notification_type: 'notificationType', + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + notification_type: 'BetaUserServiceNotificationType', + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :notification_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_email_request.rb b/lib/zitadel/client/models/beta_user_service_set_email_request.rb index f630f91b..943ba2d9 100644 --- a/lib/zitadel/client/models/beta_user_service_set_email_request.rb +++ b/lib/zitadel/client/models/beta_user_service_set_email_request.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetEmailRequest - attr_accessor :user_id - - attr_accessor :email - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'email' => :'email', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'email' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'BetaUserServiceSendEmailVerificationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetEmailRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - email == o.email && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, email, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetEmailRequest. + class BetaUserServiceSetEmailRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + email: 'email', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + email: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'BetaUserServiceSendEmailVerificationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_email_response.rb b/lib/zitadel/client/models/beta_user_service_set_email_response.rb index 7feaf7d6..2b09e092 100644 --- a/lib/zitadel/client/models/beta_user_service_set_email_response.rb +++ b/lib/zitadel/client/models/beta_user_service_set_email_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetEmailResponse - attr_accessor :details - - # in case the verification was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetEmailResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetEmailResponse. + class BetaUserServiceSetEmailResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the verification was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_human_email.rb b/lib/zitadel/client/models/beta_user_service_set_human_email.rb index 19ff2b76..4b2c0a04 100644 --- a/lib/zitadel/client/models/beta_user_service_set_human_email.rb +++ b/lib/zitadel/client/models/beta_user_service_set_human_email.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetHumanEmail - attr_accessor :email - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'BetaUserServiceSendEmailVerificationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetHumanEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetHumanEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetHumanEmail. + class BetaUserServiceSetHumanEmail < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + email: 'email', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + email: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'BetaUserServiceSendEmailVerificationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_human_phone.rb b/lib/zitadel/client/models/beta_user_service_set_human_phone.rb index dfd0b31f..eb769317 100644 --- a/lib/zitadel/client/models/beta_user_service_set_human_phone.rb +++ b/lib/zitadel/client/models/beta_user_service_set_human_phone.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetHumanPhone - attr_accessor :phone - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone' => :'phone', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetHumanPhone` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetHumanPhone`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone == o.phone && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetHumanPhone. + class BetaUserServiceSetHumanPhone < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + phone: 'phone', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + phone: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_human_profile.rb b/lib/zitadel/client/models/beta_user_service_set_human_profile.rb index 29eaecb0..66fd6986 100644 --- a/lib/zitadel/client/models/beta_user_service_set_human_profile.rb +++ b/lib/zitadel/client/models/beta_user_service_set_human_profile.rb @@ -1,285 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetHumanProfile - attr_accessor :given_name - - attr_accessor :family_name - - attr_accessor :nick_name - - attr_accessor :display_name - - attr_accessor :preferred_language - - attr_accessor :gender - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'givenName', - :'family_name' => :'familyName', - :'nick_name' => :'nickName', - :'display_name' => :'displayName', - :'preferred_language' => :'preferredLanguage', - :'gender' => :'gender' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'nick_name' => :'String', - :'display_name' => :'String', - :'preferred_language' => :'String', - :'gender' => :'BetaUserServiceGender' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'nick_name', - :'display_name', - :'preferred_language', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetHumanProfile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetHumanProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'preferred_language') - self.preferred_language = attributes[:'preferred_language'] - end - - if attributes.key?(:'gender') - self.gender = attributes[:'gender'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - nick_name == o.nick_name && - display_name == o.display_name && - preferred_language == o.preferred_language && - gender == o.gender - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, nick_name, display_name, preferred_language, gender].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetHumanProfile. + class BetaUserServiceSetHumanProfile < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + given_name: 'givenName', + family_name: 'familyName', + nick_name: 'nickName', + display_name: 'displayName', + preferred_language: 'preferredLanguage', + gender: 'gender' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + given_name: 'String', + family_name: 'String', + nick_name: 'String', + display_name: 'String', + preferred_language: 'String', + gender: 'BetaUserServiceGender' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :given_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :family_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :nick_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_language, Types::Any.optional.meta(omittable: true) + # @example null + attribute :gender, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_metadata_entry.rb b/lib/zitadel/client/models/beta_user_service_set_metadata_entry.rb index c13887c6..295a838d 100644 --- a/lib/zitadel/client/models/beta_user_service_set_metadata_entry.rb +++ b/lib/zitadel/client/models/beta_user_service_set_metadata_entry.rb @@ -1,224 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetMetadataEntry - attr_accessor :key - - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'value' => :'value' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetMetadataEntry` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetMetadataEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, value].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetMetadataEntry. + class BetaUserServiceSetMetadataEntry < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + value: 'value' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + value: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + value: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_password.rb b/lib/zitadel/client/models/beta_user_service_set_password.rb index c26076c6..0aa96810 100644 --- a/lib/zitadel/client/models/beta_user_service_set_password.rb +++ b/lib/zitadel/client/models/beta_user_service_set_password.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetPassword - attr_accessor :hashed_password - - attr_accessor :password - - attr_accessor :current_password - - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'hashed_password' => :'hashedPassword', - :'password' => :'password', - :'current_password' => :'currentPassword', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'hashed_password' => :'BetaUserServiceHashedPassword', - :'password' => :'BetaUserServicePassword', - :'current_password' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetPassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'hashed_password') - self.hashed_password = attributes[:'hashed_password'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'current_password') - self.current_password = attributes[:'current_password'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - hashed_password == o.hashed_password && - password == o.password && - current_password == o.current_password && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [hashed_password, password, current_password, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetPassword. + class BetaUserServiceSetPassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + hashed_password: 'hashedPassword', + password: 'password', + current_password: 'currentPassword', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + hashed_password: 'BetaUserServiceHashedPassword', + password: 'BetaUserServicePassword', + current_password: 'String', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :hashed_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :current_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_password_request.rb b/lib/zitadel/client/models/beta_user_service_set_password_request.rb index b43db829..48c56d34 100644 --- a/lib/zitadel/client/models/beta_user_service_set_password_request.rb +++ b/lib/zitadel/client/models/beta_user_service_set_password_request.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetPasswordRequest - attr_accessor :user_id - - attr_accessor :new_password - - attr_accessor :current_password - - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'new_password' => :'newPassword', - :'current_password' => :'currentPassword', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'new_password' => :'BetaUserServicePassword', - :'current_password' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetPasswordRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetPasswordRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'new_password') - self.new_password = attributes[:'new_password'] - end - - if attributes.key?(:'current_password') - self.current_password = attributes[:'current_password'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - new_password == o.new_password && - current_password == o.current_password && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, new_password, current_password, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetPasswordRequest. + class BetaUserServiceSetPasswordRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + new_password: 'newPassword', + current_password: 'currentPassword', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + new_password: 'BetaUserServicePassword', + current_password: 'String', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :new_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :current_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_password_response.rb b/lib/zitadel/client/models/beta_user_service_set_password_response.rb index 1568595f..f673e0ad 100644 --- a/lib/zitadel/client/models/beta_user_service_set_password_response.rb +++ b/lib/zitadel/client/models/beta_user_service_set_password_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetPasswordResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetPasswordResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetPasswordResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetPasswordResponse. + class BetaUserServiceSetPasswordResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_phone_request.rb b/lib/zitadel/client/models/beta_user_service_set_phone_request.rb index d5943a55..2efbbb54 100644 --- a/lib/zitadel/client/models/beta_user_service_set_phone_request.rb +++ b/lib/zitadel/client/models/beta_user_service_set_phone_request.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetPhoneRequest - attr_accessor :user_id - - attr_accessor :phone - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'phone' => :'phone', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'phone' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetPhoneRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetPhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - phone == o.phone && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, phone, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetPhoneRequest. + class BetaUserServiceSetPhoneRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + phone: 'phone', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + phone: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_set_phone_response.rb b/lib/zitadel/client/models/beta_user_service_set_phone_response.rb index 24026f4e..5e871648 100644 --- a/lib/zitadel/client/models/beta_user_service_set_phone_response.rb +++ b/lib/zitadel/client/models/beta_user_service_set_phone_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceSetPhoneResponse - attr_accessor :details - - # in case the verification was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceSetPhoneResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceSetPhoneResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceSetPhoneResponse. + class BetaUserServiceSetPhoneResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the verification was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rb b/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rb index 367476a1..4a44fda2 100644 --- a/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rb +++ b/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceStartIdentityProviderIntentRequest - attr_accessor :idp_id - - attr_accessor :ldap - - attr_accessor :urls - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_id' => :'idpId', - :'ldap' => :'ldap', - :'urls' => :'urls' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_id' => :'String', - :'ldap' => :'BetaUserServiceLDAPCredentials', - :'urls' => :'BetaUserServiceRedirectURLs' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceStartIdentityProviderIntentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceStartIdentityProviderIntentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'ldap') - self.ldap = attributes[:'ldap'] - end - - if attributes.key?(:'urls') - self.urls = attributes[:'urls'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_id == o.idp_id && - ldap == o.ldap && - urls == o.urls - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_id, ldap, urls].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceStartIdentityProviderIntentRequest. + class BetaUserServiceStartIdentityProviderIntentRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_id: 'idpId', + ldap: 'ldap', + urls: 'urls' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_id: 'String', + ldap: 'BetaUserServiceLDAPCredentials', + urls: 'BetaUserServiceRedirectURLs' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :idp_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ldap, Types::Any.optional.meta(omittable: true) + # @example null + attribute :urls, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rb b/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rb index 98d9f166..eae13582 100644 --- a/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rb +++ b/lib/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rb @@ -1,253 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceStartIdentityProviderIntentResponse - attr_accessor :details - - # URL to which the client should redirect - attr_accessor :auth_url - - attr_accessor :form_data - - attr_accessor :idp_intent - - # POST call information Deprecated: Use form_data instead - attr_accessor :post_form - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'auth_url' => :'authUrl', - :'form_data' => :'formData', - :'idp_intent' => :'idpIntent', - :'post_form' => :'postForm' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'auth_url' => :'String', - :'form_data' => :'BetaUserServiceFormData', - :'idp_intent' => :'BetaUserServiceIDPIntent', - :'post_form' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceStartIdentityProviderIntentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceStartIdentityProviderIntentResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'auth_url') - self.auth_url = attributes[:'auth_url'] - end - - if attributes.key?(:'form_data') - self.form_data = attributes[:'form_data'] - end - - if attributes.key?(:'idp_intent') - self.idp_intent = attributes[:'idp_intent'] - end - - if attributes.key?(:'post_form') - self.post_form = attributes[:'post_form'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - auth_url == o.auth_url && - form_data == o.form_data && - idp_intent == o.idp_intent && - post_form == o.post_form - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, auth_url, form_data, idp_intent, post_form].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceStartIdentityProviderIntentResponse. + class BetaUserServiceStartIdentityProviderIntentResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + auth_url: 'authUrl', + form_data: 'formData', + idp_intent: 'idpIntent', + post_form: 'postForm' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + auth_url: 'String', + form_data: 'BetaUserServiceFormData', + idp_intent: 'BetaUserServiceIDPIntent', + post_form: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + post_form: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # URL to which the client should redirect + # @example null + attribute :auth_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :form_data, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_intent, Types::Any.optional.meta(omittable: true) + # POST call information Deprecated: Use form_data instead + # @example null + attribute :post_form, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_state_query.rb b/lib/zitadel/client/models/beta_user_service_state_query.rb index d235b2a0..b5eddf17 100644 --- a/lib/zitadel/client/models/beta_user_service_state_query.rb +++ b/lib/zitadel/client/models/beta_user_service_state_query.rb @@ -1,238 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific state. - class BetaUserServiceStateQuery - attr_accessor :state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'state' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'BetaUserServiceUserState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceStateQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceStateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific state. + class BetaUserServiceStateQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + state: 'state' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + state: 'BetaUserServiceUserState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_text_query_method.rb b/lib/zitadel/client/models/beta_user_service_text_query_method.rb index d91de898..12ec4dcb 100644 --- a/lib/zitadel/client/models/beta_user_service_text_query_method.rb +++ b/lib/zitadel/client/models/beta_user_service_text_query_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaUserServiceTextQueryMethod - TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS".freeze - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH".freeze - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS".freeze - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH".freeze - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaUserServiceTextQueryMethod. + class BetaUserServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' + TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' + TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaUserServiceTextQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceTextQueryMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaUserServiceTextQueryMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_user_service_type.rb b/lib/zitadel/client/models/beta_user_service_type.rb index d17d03b5..938410b6 100644 --- a/lib/zitadel/client/models/beta_user_service_type.rb +++ b/lib/zitadel/client/models/beta_user_service_type.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class BetaUserServiceType - TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED".freeze - TYPE_HUMAN = "TYPE_HUMAN".freeze - TYPE_MACHINE = "TYPE_MACHINE".freeze - - def self.all_vars - @all_vars ||= [TYPE_UNSPECIFIED, TYPE_HUMAN, TYPE_MACHINE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaUserServiceType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaUserServiceType. + class BetaUserServiceType + TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED' + TYPE_HUMAN = 'TYPE_HUMAN' + TYPE_MACHINE = 'TYPE_MACHINE' + + # Frozen set of all allowed values, used for validation. + VALUES = [TYPE_UNSPECIFIED, TYPE_HUMAN, TYPE_MACHINE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaUserServiceType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_user_service_type_query.rb b/lib/zitadel/client/models/beta_user_service_type_query.rb index b89e6cc1..202b8d54 100644 --- a/lib/zitadel/client/models/beta_user_service_type_query.rb +++ b/lib/zitadel/client/models/beta_user_service_type_query.rb @@ -1,238 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific type. - class BetaUserServiceTypeQuery - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'BetaUserServiceType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceTypeQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceTypeQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific type. + class BetaUserServiceTypeQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'BetaUserServiceType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_unlock_user_request.rb b/lib/zitadel/client/models/beta_user_service_unlock_user_request.rb index 4b5dd4b2..2abbaf1e 100644 --- a/lib/zitadel/client/models/beta_user_service_unlock_user_request.rb +++ b/lib/zitadel/client/models/beta_user_service_unlock_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceUnlockUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUnlockUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUnlockUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceUnlockUserRequest. + class BetaUserServiceUnlockUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_unlock_user_response.rb b/lib/zitadel/client/models/beta_user_service_unlock_user_response.rb index 3fe5c922..2d022ab9 100644 --- a/lib/zitadel/client/models/beta_user_service_unlock_user_response.rb +++ b/lib/zitadel/client/models/beta_user_service_unlock_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceUnlockUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUnlockUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUnlockUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceUnlockUserResponse. + class BetaUserServiceUnlockUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_update_human_user_request.rb b/lib/zitadel/client/models/beta_user_service_update_human_user_request.rb index 100ba32f..1d9a7e0d 100644 --- a/lib/zitadel/client/models/beta_user_service_update_human_user_request.rb +++ b/lib/zitadel/client/models/beta_user_service_update_human_user_request.rb @@ -1,261 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceUpdateHumanUserRequest - attr_accessor :user_id - - attr_accessor :username - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'username' => :'username', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'username' => :'String', - :'profile' => :'BetaUserServiceSetHumanProfile', - :'email' => :'BetaUserServiceSetHumanEmail', - :'phone' => :'BetaUserServiceSetHumanPhone', - :'password' => :'BetaUserServiceSetPassword' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'username', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUpdateHumanUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUpdateHumanUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - username == o.username && - profile == o.profile && - email == o.email && - phone == o.phone && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, username, profile, email, phone, password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceUpdateHumanUserRequest. + class BetaUserServiceUpdateHumanUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + username: 'username', + profile: 'profile', + email: 'email', + phone: 'phone', + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + username: 'String', + profile: 'BetaUserServiceSetHumanProfile', + email: 'BetaUserServiceSetHumanEmail', + phone: 'BetaUserServiceSetHumanPhone', + password: 'BetaUserServiceSetPassword' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :profile, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_update_human_user_response.rb b/lib/zitadel/client/models/beta_user_service_update_human_user_response.rb index 43bc56c0..c71f34d0 100644 --- a/lib/zitadel/client/models/beta_user_service_update_human_user_response.rb +++ b/lib/zitadel/client/models/beta_user_service_update_human_user_response.rb @@ -1,235 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceUpdateHumanUserResponse - attr_accessor :details - - attr_accessor :email_code - - attr_accessor :phone_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'email_code' => :'emailCode', - :'phone_code' => :'phoneCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails', - :'email_code' => :'String', - :'phone_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_code', - :'phone_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUpdateHumanUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUpdateHumanUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'email_code') - self.email_code = attributes[:'email_code'] - end - - if attributes.key?(:'phone_code') - self.phone_code = attributes[:'phone_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - email_code == o.email_code && - phone_code == o.phone_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, email_code, phone_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceUpdateHumanUserResponse. + class BetaUserServiceUpdateHumanUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + email_code: 'emailCode', + phone_code: 'phoneCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails', + email_code: 'String', + phone_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_user.rb b/lib/zitadel/client/models/beta_user_service_user.rb index 8c3de167..cdb6f417 100644 --- a/lib/zitadel/client/models/beta_user_service_user.rb +++ b/lib/zitadel/client/models/beta_user_service_user.rb @@ -1,302 +1,101 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceUser - attr_accessor :user_id - - attr_accessor :details - - attr_accessor :state - - attr_accessor :username - - attr_accessor :login_names - - attr_accessor :preferred_login_name - - attr_accessor :human - - attr_accessor :machine - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'details' => :'details', - :'state' => :'state', - :'username' => :'username', - :'login_names' => :'loginNames', - :'preferred_login_name' => :'preferredLoginName', - :'human' => :'human', - :'machine' => :'machine' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'details' => :'BetaUserServiceDetails', - :'state' => :'BetaUserServiceUserState', - :'username' => :'String', - :'login_names' => :'Array', - :'preferred_login_name' => :'String', - :'human' => :'BetaUserServiceHumanUser', - :'machine' => :'BetaUserServiceMachineUser' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'login_names') - if (value = attributes[:'login_names']).is_a?(Array) - self.login_names = value - end - end - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'human') - self.human = attributes[:'human'] - end - - if attributes.key?(:'machine') - self.machine = attributes[:'machine'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - details == o.details && - state == o.state && - username == o.username && - login_names == o.login_names && - preferred_login_name == o.preferred_login_name && - human == o.human && - machine == o.machine - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, details, state, username, login_names, preferred_login_name, human, machine].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceUser. + class BetaUserServiceUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + details: 'details', + state: 'state', + username: 'username', + login_names: 'loginNames', + preferred_login_name: 'preferredLoginName', + human: 'human', + machine: 'machine' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + details: 'BetaUserServiceDetails', + state: 'BetaUserServiceUserState', + username: 'String', + login_names: 'Array', + preferred_login_name: 'String', + human: 'BetaUserServiceHumanUser', + machine: 'BetaUserServiceMachineUser' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_names, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :human, Types::Any.optional.meta(omittable: true) + # @example null + attribute :machine, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_user_field_name.rb b/lib/zitadel/client/models/beta_user_service_user_field_name.rb index 18f0fc39..bdad7684 100644 --- a/lib/zitadel/client/models/beta_user_service_user_field_name.rb +++ b/lib/zitadel/client/models/beta_user_service_user_field_name.rb @@ -1,49 +1,69 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaUserServiceUserFieldName - USER_FIELD_NAME_UNSPECIFIED = "USER_FIELD_NAME_UNSPECIFIED".freeze - USER_FIELD_NAME_USER_NAME = "USER_FIELD_NAME_USER_NAME".freeze - USER_FIELD_NAME_FIRST_NAME = "USER_FIELD_NAME_FIRST_NAME".freeze - USER_FIELD_NAME_LAST_NAME = "USER_FIELD_NAME_LAST_NAME".freeze - USER_FIELD_NAME_NICK_NAME = "USER_FIELD_NAME_NICK_NAME".freeze - USER_FIELD_NAME_DISPLAY_NAME = "USER_FIELD_NAME_DISPLAY_NAME".freeze - USER_FIELD_NAME_EMAIL = "USER_FIELD_NAME_EMAIL".freeze - USER_FIELD_NAME_STATE = "USER_FIELD_NAME_STATE".freeze - USER_FIELD_NAME_TYPE = "USER_FIELD_NAME_TYPE".freeze - USER_FIELD_NAME_CREATION_DATE = "USER_FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [USER_FIELD_NAME_UNSPECIFIED, USER_FIELD_NAME_USER_NAME, USER_FIELD_NAME_FIRST_NAME, USER_FIELD_NAME_LAST_NAME, USER_FIELD_NAME_NICK_NAME, USER_FIELD_NAME_DISPLAY_NAME, USER_FIELD_NAME_EMAIL, USER_FIELD_NAME_STATE, USER_FIELD_NAME_TYPE, USER_FIELD_NAME_CREATION_DATE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaUserServiceUserFieldName. + class BetaUserServiceUserFieldName + USER_FIELD_NAME_UNSPECIFIED = 'USER_FIELD_NAME_UNSPECIFIED' + USER_FIELD_NAME_USER_NAME = 'USER_FIELD_NAME_USER_NAME' + USER_FIELD_NAME_FIRST_NAME = 'USER_FIELD_NAME_FIRST_NAME' + USER_FIELD_NAME_LAST_NAME = 'USER_FIELD_NAME_LAST_NAME' + USER_FIELD_NAME_NICK_NAME = 'USER_FIELD_NAME_NICK_NAME' + USER_FIELD_NAME_DISPLAY_NAME = 'USER_FIELD_NAME_DISPLAY_NAME' + USER_FIELD_NAME_EMAIL = 'USER_FIELD_NAME_EMAIL' + USER_FIELD_NAME_STATE = 'USER_FIELD_NAME_STATE' + USER_FIELD_NAME_TYPE = 'USER_FIELD_NAME_TYPE' + USER_FIELD_NAME_CREATION_DATE = 'USER_FIELD_NAME_CREATION_DATE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [USER_FIELD_NAME_UNSPECIFIED, USER_FIELD_NAME_USER_NAME, USER_FIELD_NAME_FIRST_NAME, USER_FIELD_NAME_LAST_NAME, USER_FIELD_NAME_NICK_NAME, USER_FIELD_NAME_DISPLAY_NAME, USER_FIELD_NAME_EMAIL, USER_FIELD_NAME_STATE, USER_FIELD_NAME_TYPE, USER_FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaUserServiceUserFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceUserFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaUserServiceUserFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_user_service_user_name_query.rb b/lib/zitadel/client/models/beta_user_service_user_name_query.rb index 2f516bad..9b2cdbca 100644 --- a/lib/zitadel/client/models/beta_user_service_user_name_query.rb +++ b/lib/zitadel/client/models/beta_user_service_user_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific user name. - class BetaUserServiceUserNameQuery - attr_accessor :user_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_name' => :'userName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_name' => :'String', - :'method' => :'BetaUserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceUserNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceUserNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_name == o.user_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific user name. + class BetaUserServiceUserNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_name: 'userName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_name: 'String', + method: 'BetaUserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_user_state.rb b/lib/zitadel/client/models/beta_user_service_user_state.rb index 084535ff..42807751 100644 --- a/lib/zitadel/client/models/beta_user_service_user_state.rb +++ b/lib/zitadel/client/models/beta_user_service_user_state.rb @@ -1,45 +1,65 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaUserServiceUserState - USER_STATE_UNSPECIFIED = "USER_STATE_UNSPECIFIED".freeze - USER_STATE_ACTIVE = "USER_STATE_ACTIVE".freeze - USER_STATE_INACTIVE = "USER_STATE_INACTIVE".freeze - USER_STATE_DELETED = "USER_STATE_DELETED".freeze - USER_STATE_LOCKED = "USER_STATE_LOCKED".freeze - USER_STATE_INITIAL = "USER_STATE_INITIAL".freeze - - def self.all_vars - @all_vars ||= [USER_STATE_UNSPECIFIED, USER_STATE_ACTIVE, USER_STATE_INACTIVE, USER_STATE_DELETED, USER_STATE_LOCKED, USER_STATE_INITIAL].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaUserServiceUserState. + class BetaUserServiceUserState + USER_STATE_UNSPECIFIED = 'USER_STATE_UNSPECIFIED' + USER_STATE_ACTIVE = 'USER_STATE_ACTIVE' + USER_STATE_INACTIVE = 'USER_STATE_INACTIVE' + USER_STATE_DELETED = 'USER_STATE_DELETED' + USER_STATE_LOCKED = 'USER_STATE_LOCKED' + USER_STATE_INITIAL = 'USER_STATE_INITIAL' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [USER_STATE_UNSPECIFIED, USER_STATE_ACTIVE, USER_STATE_INACTIVE, USER_STATE_DELETED, USER_STATE_LOCKED, USER_STATE_INITIAL].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaUserServiceUserState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaUserServiceUserState" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaUserServiceUserState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_user_service_verify_email_request.rb b/lib/zitadel/client/models/beta_user_service_verify_email_request.rb index a031648d..646246f4 100644 --- a/lib/zitadel/client/models/beta_user_service_verify_email_request.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_email_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyEmailRequest - attr_accessor :user_id - - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyEmailRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyEmailRequest. + class BetaUserServiceVerifyEmailRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_verify_email_response.rb b/lib/zitadel/client/models/beta_user_service_verify_email_response.rb index 4b2d1b6d..89605b12 100644 --- a/lib/zitadel/client/models/beta_user_service_verify_email_response.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_email_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyEmailResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyEmailResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyEmailResponse. + class BetaUserServiceVerifyEmailResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rb b/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rb index c31d1e2d..fedea025 100644 --- a/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rb @@ -1,245 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyPasskeyRegistrationRequest - attr_accessor :user_id - - attr_accessor :passkey_id - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :public_key_credential - - attr_accessor :passkey_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'passkey_id' => :'passkeyId', - :'public_key_credential' => :'publicKeyCredential', - :'passkey_name' => :'passkeyName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'passkey_id' => :'String', - :'public_key_credential' => :'Hash', - :'passkey_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyPasskeyRegistrationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyPasskeyRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'passkey_id') - self.passkey_id = attributes[:'passkey_id'] - end - - if attributes.key?(:'public_key_credential') - if (value = attributes[:'public_key_credential']).is_a?(Hash) - self.public_key_credential = value - end - end - - if attributes.key?(:'passkey_name') - self.passkey_name = attributes[:'passkey_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - passkey_id == o.passkey_id && - public_key_credential == o.public_key_credential && - passkey_name == o.passkey_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, passkey_id, public_key_credential, passkey_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyPasskeyRegistrationRequest. + class BetaUserServiceVerifyPasskeyRegistrationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + passkey_id: 'passkeyId', + public_key_credential: 'publicKeyCredential', + passkey_name: 'passkeyName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + passkey_id: 'String', + public_key_credential: 'Hash', + passkey_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :passkey_id, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :public_key_credential, Types::Any.optional.meta(omittable: true) + # @example null + attribute :passkey_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rb b/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rb index 2c6023d2..6034f5f0 100644 --- a/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyPasskeyRegistrationResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyPasskeyRegistrationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyPasskeyRegistrationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyPasskeyRegistrationResponse. + class BetaUserServiceVerifyPasskeyRegistrationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_verify_phone_request.rb b/lib/zitadel/client/models/beta_user_service_verify_phone_request.rb index 3b620a03..4b9e8e28 100644 --- a/lib/zitadel/client/models/beta_user_service_verify_phone_request.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_phone_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyPhoneRequest - attr_accessor :user_id - - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyPhoneRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyPhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyPhoneRequest. + class BetaUserServiceVerifyPhoneRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_verify_phone_response.rb b/lib/zitadel/client/models/beta_user_service_verify_phone_response.rb index 764ff8a0..9cafd2b2 100644 --- a/lib/zitadel/client/models/beta_user_service_verify_phone_response.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_phone_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyPhoneResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyPhoneResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyPhoneResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyPhoneResponse. + class BetaUserServiceVerifyPhoneResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_request.rb b/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_request.rb deleted file mode 100644 index d8ecf464..00000000 --- a/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_request.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyTOTPRegistrationRequest - attr_accessor :user_id - - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyTOTPRegistrationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyTOTPRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_response.rb b/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_response.rb deleted file mode 100644 index 5da8eb6d..00000000 --- a/lib/zitadel/client/models/beta_user_service_verify_t_o_t_p_registration_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyTOTPRegistrationResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyTOTPRegistrationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyTOTPRegistrationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_user_service_verify_totp_registration_request.rb b/lib/zitadel/client/models/beta_user_service_verify_totp_registration_request.rb new file mode 100644 index 00000000..383dc85c --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_totp_registration_request.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyTOTPRegistrationRequest. + class BetaUserServiceVerifyTOTPRegistrationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_verify_totp_registration_response.rb b/lib/zitadel/client/models/beta_user_service_verify_totp_registration_response.rb new file mode 100644 index 00000000..2758995a --- /dev/null +++ b/lib/zitadel/client/models/beta_user_service_verify_totp_registration_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyTOTPRegistrationResponse. + class BetaUserServiceVerifyTOTPRegistrationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rb b/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rb index 18b12d0c..76ac5db4 100644 --- a/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rb @@ -1,245 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyU2FRegistrationRequest - attr_accessor :user_id - - attr_accessor :u2f_id - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :public_key_credential - - attr_accessor :token_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'u2f_id' => :'u2fId', - :'public_key_credential' => :'publicKeyCredential', - :'token_name' => :'tokenName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'u2f_id' => :'String', - :'public_key_credential' => :'Hash', - :'token_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyU2FRegistrationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyU2FRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'u2f_id') - self.u2f_id = attributes[:'u2f_id'] - end - - if attributes.key?(:'public_key_credential') - if (value = attributes[:'public_key_credential']).is_a?(Hash) - self.public_key_credential = value - end - end - - if attributes.key?(:'token_name') - self.token_name = attributes[:'token_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - u2f_id == o.u2f_id && - public_key_credential == o.public_key_credential && - token_name == o.token_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, u2f_id, public_key_credential, token_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyU2FRegistrationRequest. + class BetaUserServiceVerifyU2FRegistrationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + u2f_id: 'u2fId', + public_key_credential: 'publicKeyCredential', + token_name: 'tokenName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + u2f_id: 'String', + public_key_credential: 'Hash', + token_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :u2f_id, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :public_key_credential, Types::Any.optional.meta(omittable: true) + # @example null + attribute :token_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rb b/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rb index 9addfff3..211d4da4 100644 --- a/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rb +++ b/lib/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaUserServiceVerifyU2FRegistrationResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'BetaUserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaUserServiceVerifyU2FRegistrationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaUserServiceVerifyU2FRegistrationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaUserServiceVerifyU2FRegistrationResponse. + class BetaUserServiceVerifyU2FRegistrationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'BetaUserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_activate_web_key_request.rb b/lib/zitadel/client/models/beta_web_key_service_activate_web_key_request.rb index 81f541ed..775f45cc 100644 --- a/lib/zitadel/client/models/beta_web_key_service_activate_web_key_request.rb +++ b/lib/zitadel/client/models/beta_web_key_service_activate_web_key_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceActivateWebKeyRequest - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceActivateWebKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceActivateWebKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceActivateWebKeyRequest. + class BetaWebKeyServiceActivateWebKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_activate_web_key_response.rb b/lib/zitadel/client/models/beta_web_key_service_activate_web_key_response.rb index 40577161..52825d8c 100644 --- a/lib/zitadel/client/models/beta_web_key_service_activate_web_key_response.rb +++ b/lib/zitadel/client/models/beta_web_key_service_activate_web_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceActivateWebKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceActivateWebKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceActivateWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceActivateWebKeyResponse. + class BetaWebKeyServiceActivateWebKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_any.rb b/lib/zitadel/client/models/beta_web_key_service_any.rb index f93ef26f..0d9ec99d 100644 --- a/lib/zitadel/client/models/beta_web_key_service_any.rb +++ b/lib/zitadel/client/models/beta_web_key_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class BetaWebKeyServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class BetaWebKeyServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_connect_error.rb b/lib/zitadel/client/models/beta_web_key_service_connect_error.rb index 3ccb4de9..198c1014 100644 --- a/lib/zitadel/client/models/beta_web_key_service_connect_error.rb +++ b/lib/zitadel/client/models/beta_web_key_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class BetaWebKeyServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class BetaWebKeyServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_create_web_key_request.rb b/lib/zitadel/client/models/beta_web_key_service_create_web_key_request.rb index 32298fe4..ec6d222a 100644 --- a/lib/zitadel/client/models/beta_web_key_service_create_web_key_request.rb +++ b/lib/zitadel/client/models/beta_web_key_service_create_web_key_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceCreateWebKeyRequest - attr_accessor :ecdsa - - attr_accessor :ed25519 - - attr_accessor :rsa - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ecdsa' => :'ecdsa', - :'ed25519' => :'ed25519', - :'rsa' => :'rsa' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ecdsa' => :'BetaWebKeyServiceECDSA', - :'ed25519' => :'Object', - :'rsa' => :'BetaWebKeyServiceRSA' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceCreateWebKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceCreateWebKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ecdsa') - self.ecdsa = attributes[:'ecdsa'] - end - - if attributes.key?(:'ed25519') - self.ed25519 = attributes[:'ed25519'] - end - - if attributes.key?(:'rsa') - self.rsa = attributes[:'rsa'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ecdsa == o.ecdsa && - ed25519 == o.ed25519 && - rsa == o.rsa - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ecdsa, ed25519, rsa].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceCreateWebKeyRequest. + class BetaWebKeyServiceCreateWebKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ecdsa: 'ecdsa', + ed25519: 'ed25519', + rsa: 'rsa' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ecdsa: 'BetaWebKeyServiceECDSA', + ed25519: 'Object', + rsa: 'BetaWebKeyServiceRSA' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ecdsa, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ed25519, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rsa, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_create_web_key_response.rb b/lib/zitadel/client/models/beta_web_key_service_create_web_key_response.rb index 69247079..0047da15 100644 --- a/lib/zitadel/client/models/beta_web_key_service_create_web_key_response.rb +++ b/lib/zitadel/client/models/beta_web_key_service_create_web_key_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceCreateWebKeyResponse - # The unique identifier of the newly created key. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceCreateWebKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceCreateWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceCreateWebKeyResponse. + class BetaWebKeyServiceCreateWebKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the newly created key. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_delete_web_key_request.rb b/lib/zitadel/client/models/beta_web_key_service_delete_web_key_request.rb index 14c7de1a..0604725d 100644 --- a/lib/zitadel/client/models/beta_web_key_service_delete_web_key_request.rb +++ b/lib/zitadel/client/models/beta_web_key_service_delete_web_key_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceDeleteWebKeyRequest - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceDeleteWebKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceDeleteWebKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceDeleteWebKeyRequest. + class BetaWebKeyServiceDeleteWebKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_delete_web_key_response.rb b/lib/zitadel/client/models/beta_web_key_service_delete_web_key_response.rb index afd2039f..06096738 100644 --- a/lib/zitadel/client/models/beta_web_key_service_delete_web_key_response.rb +++ b/lib/zitadel/client/models/beta_web_key_service_delete_web_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceDeleteWebKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceDeleteWebKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceDeleteWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceDeleteWebKeyResponse. + class BetaWebKeyServiceDeleteWebKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_e_c_d_s_a.rb b/lib/zitadel/client/models/beta_web_key_service_e_c_d_s_a.rb deleted file mode 100644 index 8deb4082..00000000 --- a/lib/zitadel/client/models/beta_web_key_service_e_c_d_s_a.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceECDSA - attr_accessor :curve - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'curve' => :'curve' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'curve' => :'BetaWebKeyServiceECDSACurve' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceECDSA` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceECDSA`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'curve') - self.curve = attributes[:'curve'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - curve == o.curve - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [curve].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_web_key_service_e_c_d_s_a_curve.rb b/lib/zitadel/client/models/beta_web_key_service_e_c_d_s_a_curve.rb deleted file mode 100644 index 7f7b71d9..00000000 --- a/lib/zitadel/client/models/beta_web_key_service_e_c_d_s_a_curve.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceECDSACurve - ECDSA_CURVE_UNSPECIFIED = "ECDSA_CURVE_UNSPECIFIED".freeze - ECDSA_CURVE_P256 = "ECDSA_CURVE_P256".freeze - ECDSA_CURVE_P384 = "ECDSA_CURVE_P384".freeze - ECDSA_CURVE_P512 = "ECDSA_CURVE_P512".freeze - - def self.all_vars - @all_vars ||= [ECDSA_CURVE_UNSPECIFIED, ECDSA_CURVE_P256, ECDSA_CURVE_P384, ECDSA_CURVE_P512].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaWebKeyServiceECDSACurve.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaWebKeyServiceECDSACurve" - end - end - -end diff --git a/lib/zitadel/client/models/beta_web_key_service_ecdsa.rb b/lib/zitadel/client/models/beta_web_key_service_ecdsa.rb new file mode 100644 index 00000000..1f56c080 --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_ecdsa.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceECDSA. + class BetaWebKeyServiceECDSA < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + curve: 'curve' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + curve: 'BetaWebKeyServiceECDSACurve' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :curve, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_web_key_service_ecdsa_curve.rb b/lib/zitadel/client/models/beta_web_key_service_ecdsa_curve.rb new file mode 100644 index 00000000..12389783 --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_ecdsa_curve.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaWebKeyServiceECDSACurve. + class BetaWebKeyServiceECDSACurve + ECDSA_CURVE_UNSPECIFIED = 'ECDSA_CURVE_UNSPECIFIED' + ECDSA_CURVE_P256 = 'ECDSA_CURVE_P256' + ECDSA_CURVE_P384 = 'ECDSA_CURVE_P384' + ECDSA_CURVE_P512 = 'ECDSA_CURVE_P512' + + # Frozen set of all allowed values, used for validation. + VALUES = [ECDSA_CURVE_UNSPECIFIED, ECDSA_CURVE_P256, ECDSA_CURVE_P384, ECDSA_CURVE_P512].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaWebKeyServiceECDSACurve: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_web_key_service_list_web_keys_response.rb b/lib/zitadel/client/models/beta_web_key_service_list_web_keys_response.rb index a8b76b68..d9d446c0 100644 --- a/lib/zitadel/client/models/beta_web_key_service_list_web_keys_response.rb +++ b/lib/zitadel/client/models/beta_web_key_service_list_web_keys_response.rb @@ -1,217 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceListWebKeysResponse - attr_accessor :web_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'web_keys' => :'webKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'web_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceListWebKeysResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceListWebKeysResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'web_keys') - if (value = attributes[:'web_keys']).is_a?(Array) - self.web_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - web_keys == o.web_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [web_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceListWebKeysResponse. + class BetaWebKeyServiceListWebKeysResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + web_keys: 'webKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + web_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :web_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_r_s_a.rb b/lib/zitadel/client/models/beta_web_key_service_r_s_a.rb deleted file mode 100644 index 33c21a4f..00000000 --- a/lib/zitadel/client/models/beta_web_key_service_r_s_a.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceRSA - attr_accessor :bits - - attr_accessor :hasher - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bits' => :'bits', - :'hasher' => :'hasher' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bits' => :'BetaWebKeyServiceRSABits', - :'hasher' => :'BetaWebKeyServiceRSAHasher' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceRSA` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceRSA`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bits') - self.bits = attributes[:'bits'] - end - - if attributes.key?(:'hasher') - self.hasher = attributes[:'hasher'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bits == o.bits && - hasher == o.hasher - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bits, hasher].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/beta_web_key_service_r_s_a_bits.rb b/lib/zitadel/client/models/beta_web_key_service_r_s_a_bits.rb deleted file mode 100644 index 723f42bc..00000000 --- a/lib/zitadel/client/models/beta_web_key_service_r_s_a_bits.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceRSABits - RSA_BITS_UNSPECIFIED = "RSA_BITS_UNSPECIFIED".freeze - RSA_BITS_2048 = "RSA_BITS_2048".freeze - RSA_BITS_3072 = "RSA_BITS_3072".freeze - RSA_BITS_4096 = "RSA_BITS_4096".freeze - - def self.all_vars - @all_vars ||= [RSA_BITS_UNSPECIFIED, RSA_BITS_2048, RSA_BITS_3072, RSA_BITS_4096].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaWebKeyServiceRSABits.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaWebKeyServiceRSABits" - end - end - -end diff --git a/lib/zitadel/client/models/beta_web_key_service_r_s_a_hasher.rb b/lib/zitadel/client/models/beta_web_key_service_r_s_a_hasher.rb deleted file mode 100644 index f8ac78aa..00000000 --- a/lib/zitadel/client/models/beta_web_key_service_r_s_a_hasher.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceRSAHasher - RSA_HASHER_UNSPECIFIED = "RSA_HASHER_UNSPECIFIED".freeze - RSA_HASHER_SHA256 = "RSA_HASHER_SHA256".freeze - RSA_HASHER_SHA384 = "RSA_HASHER_SHA384".freeze - RSA_HASHER_SHA512 = "RSA_HASHER_SHA512".freeze - - def self.all_vars - @all_vars ||= [RSA_HASHER_UNSPECIFIED, RSA_HASHER_SHA256, RSA_HASHER_SHA384, RSA_HASHER_SHA512].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaWebKeyServiceRSAHasher.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaWebKeyServiceRSAHasher" - end - end - -end diff --git a/lib/zitadel/client/models/beta_web_key_service_rsa.rb b/lib/zitadel/client/models/beta_web_key_service_rsa.rb new file mode 100644 index 00000000..084e7bf5 --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_rsa.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceRSA. + class BetaWebKeyServiceRSA < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + bits: 'bits', + hasher: 'hasher' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + bits: 'BetaWebKeyServiceRSABits', + hasher: 'BetaWebKeyServiceRSAHasher' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :bits, Types::Any.optional.meta(omittable: true) + # @example null + attribute :hasher, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/beta_web_key_service_rsa_bits.rb b/lib/zitadel/client/models/beta_web_key_service_rsa_bits.rb new file mode 100644 index 00000000..335e6adc --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_rsa_bits.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaWebKeyServiceRSABits. + class BetaWebKeyServiceRSABits + RSA_BITS_UNSPECIFIED = 'RSA_BITS_UNSPECIFIED' + RSA_BITS_2048 = 'RSA_BITS_2048' + RSA_BITS_3072 = 'RSA_BITS_3072' + RSA_BITS_4096 = 'RSA_BITS_4096' + + # Frozen set of all allowed values, used for validation. + VALUES = [RSA_BITS_UNSPECIFIED, RSA_BITS_2048, RSA_BITS_3072, RSA_BITS_4096].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaWebKeyServiceRSABits: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_web_key_service_rsa_hasher.rb b/lib/zitadel/client/models/beta_web_key_service_rsa_hasher.rb new file mode 100644 index 00000000..6af46382 --- /dev/null +++ b/lib/zitadel/client/models/beta_web_key_service_rsa_hasher.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaWebKeyServiceRSAHasher. + class BetaWebKeyServiceRSAHasher + RSA_HASHER_UNSPECIFIED = 'RSA_HASHER_UNSPECIFIED' + RSA_HASHER_SHA256 = 'RSA_HASHER_SHA256' + RSA_HASHER_SHA384 = 'RSA_HASHER_SHA384' + RSA_HASHER_SHA512 = 'RSA_HASHER_SHA512' + + # Frozen set of all allowed values, used for validation. + VALUES = [RSA_HASHER_UNSPECIFIED, RSA_HASHER_SHA256, RSA_HASHER_SHA384, RSA_HASHER_SHA512].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaWebKeyServiceRSAHasher: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/beta_web_key_service_state.rb b/lib/zitadel/client/models/beta_web_key_service_state.rb index 1992a0dd..6be2ca6f 100644 --- a/lib/zitadel/client/models/beta_web_key_service_state.rb +++ b/lib/zitadel/client/models/beta_web_key_service_state.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class BetaWebKeyServiceState - STATE_UNSPECIFIED = "STATE_UNSPECIFIED".freeze - STATE_INITIAL = "STATE_INITIAL".freeze - STATE_ACTIVE = "STATE_ACTIVE".freeze - STATE_INACTIVE = "STATE_INACTIVE".freeze - STATE_REMOVED = "STATE_REMOVED".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for BetaWebKeyServiceState. + class BetaWebKeyServiceState + STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' + STATE_INITIAL = 'STATE_INITIAL' + STATE_ACTIVE = 'STATE_ACTIVE' + STATE_INACTIVE = 'STATE_INACTIVE' + STATE_REMOVED = 'STATE_REMOVED' - def self.all_vars - @all_vars ||= [STATE_UNSPECIFIED, STATE_INITIAL, STATE_ACTIVE, STATE_INACTIVE, STATE_REMOVED].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [STATE_UNSPECIFIED, STATE_INITIAL, STATE_ACTIVE, STATE_INACTIVE, STATE_REMOVED].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if BetaWebKeyServiceState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::BetaWebKeyServiceState" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for BetaWebKeyServiceState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/beta_web_key_service_web_key.rb b/lib/zitadel/client/models/beta_web_key_service_web_key.rb index d6c4811d..402d8351 100644 --- a/lib/zitadel/client/models/beta_web_key_service_web_key.rb +++ b/lib/zitadel/client/models/beta_web_key_service_web_key.rb @@ -1,294 +1,100 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class BetaWebKeyServiceWebKey - # The unique identifier of the key. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :state - - attr_accessor :ecdsa - - attr_accessor :ed25519 - - attr_accessor :rsa - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'state' => :'state', - :'ecdsa' => :'ecdsa', - :'ed25519' => :'ed25519', - :'rsa' => :'rsa' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'state' => :'BetaWebKeyServiceState', - :'ecdsa' => :'BetaWebKeyServiceECDSA', - :'ed25519' => :'Object', - :'rsa' => :'BetaWebKeyServiceRSA' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::BetaWebKeyServiceWebKey` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::BetaWebKeyServiceWebKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'ecdsa') - self.ecdsa = attributes[:'ecdsa'] - end - - if attributes.key?(:'ed25519') - self.ed25519 = attributes[:'ed25519'] - end - - if attributes.key?(:'rsa') - self.rsa = attributes[:'rsa'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - change_date == o.change_date && - state == o.state && - ecdsa == o.ecdsa && - ed25519 == o.ed25519 && - rsa == o.rsa - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, change_date, state, ecdsa, ed25519, rsa].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for BetaWebKeyServiceWebKey. + class BetaWebKeyServiceWebKey < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + change_date: 'changeDate', + state: 'state', + ecdsa: 'ecdsa', + ed25519: 'ed25519', + rsa: 'rsa' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + change_date: 'Time', + state: 'BetaWebKeyServiceState', + ecdsa: 'BetaWebKeyServiceECDSA', + ed25519: 'Object', + rsa: 'BetaWebKeyServiceRSA' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the key. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ecdsa, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ed25519, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rsa, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_any.rb b/lib/zitadel/client/models/feature_service_any.rb index b6f8581c..351d150e 100644 --- a/lib/zitadel/client/models/feature_service_any.rb +++ b/lib/zitadel/client/models/feature_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class FeatureServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class FeatureServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_connect_error.rb b/lib/zitadel/client/models/feature_service_connect_error.rb index 7331e7e0..7694bb2b 100644 --- a/lib/zitadel/client/models/feature_service_connect_error.rb +++ b/lib/zitadel/client/models/feature_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class FeatureServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class FeatureServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_details.rb b/lib/zitadel/client/models/feature_service_details.rb index 6556d08d..d39d8299 100644 --- a/lib/zitadel/client/models/feature_service_details.rb +++ b/lib/zitadel/client/models/feature_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceDetails. + class FeatureServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_feature_flag.rb b/lib/zitadel/client/models/feature_service_feature_flag.rb index 2c77899f..f044d0f1 100644 --- a/lib/zitadel/client/models/feature_service_feature_flag.rb +++ b/lib/zitadel/client/models/feature_service_feature_flag.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # FeatureFlag is a simple boolean Feature setting, without further payload. - class FeatureServiceFeatureFlag - attr_accessor :enabled - - attr_accessor :source - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enabled' => :'enabled', - :'source' => :'source' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'enabled' => :'Boolean', - :'source' => :'FeatureServiceSource' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceFeatureFlag` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceFeatureFlag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enabled') - self.enabled = attributes[:'enabled'] - end - - if attributes.key?(:'source') - self.source = attributes[:'source'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enabled == o.enabled && - source == o.source - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enabled, source].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # FeatureFlag is a simple boolean Feature setting, without further payload. + class FeatureServiceFeatureFlag < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + enabled: 'enabled', + source: 'source' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + enabled: 'Boolean', + source: 'FeatureServiceSource' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :enabled, Types::Any.optional.meta(omittable: true) + # @example null + attribute :source, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_get_instance_features_request.rb b/lib/zitadel/client/models/feature_service_get_instance_features_request.rb index 9df4288e..7c626b8f 100644 --- a/lib/zitadel/client/models/feature_service_get_instance_features_request.rb +++ b/lib/zitadel/client/models/feature_service_get_instance_features_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceGetInstanceFeaturesRequest - attr_accessor :inheritance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'inheritance' => :'inheritance' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'inheritance' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetInstanceFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetInstanceFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'inheritance') - self.inheritance = attributes[:'inheritance'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - inheritance == o.inheritance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [inheritance].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceGetInstanceFeaturesRequest. + class FeatureServiceGetInstanceFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + inheritance: 'inheritance' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + inheritance: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :inheritance, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_get_instance_features_response.rb b/lib/zitadel/client/models/feature_service_get_instance_features_response.rb index 0e4a9b81..716b2266 100644 --- a/lib/zitadel/client/models/feature_service_get_instance_features_response.rb +++ b/lib/zitadel/client/models/feature_service_get_instance_features_response.rb @@ -1,305 +1,113 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceGetInstanceFeaturesResponse - attr_accessor :details - - attr_accessor :login_default_org - - attr_accessor :user_schema - - attr_accessor :oidc_token_exchange - - attr_accessor :improved_performance - - attr_accessor :debug_oidc_parent_error - - attr_accessor :oidc_single_v1_session_termination - - attr_accessor :enable_back_channel_logout - - attr_accessor :login_v2 - - attr_accessor :permission_check_v2 - - attr_accessor :console_use_v2_user_api - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'login_default_org' => :'loginDefaultOrg', - :'user_schema' => :'userSchema', - :'oidc_token_exchange' => :'oidcTokenExchange', - :'improved_performance' => :'improvedPerformance', - :'debug_oidc_parent_error' => :'debugOidcParentError', - :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination', - :'enable_back_channel_logout' => :'enableBackChannelLogout', - :'login_v2' => :'loginV2', - :'permission_check_v2' => :'permissionCheckV2', - :'console_use_v2_user_api' => :'consoleUseV2UserApi' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails', - :'login_default_org' => :'FeatureServiceFeatureFlag', - :'user_schema' => :'FeatureServiceFeatureFlag', - :'oidc_token_exchange' => :'FeatureServiceFeatureFlag', - :'improved_performance' => :'FeatureServiceImprovedPerformanceFeatureFlag', - :'debug_oidc_parent_error' => :'FeatureServiceFeatureFlag', - :'oidc_single_v1_session_termination' => :'FeatureServiceFeatureFlag', - :'enable_back_channel_logout' => :'FeatureServiceFeatureFlag', - :'login_v2' => :'FeatureServiceLoginV2FeatureFlag', - :'permission_check_v2' => :'FeatureServiceFeatureFlag', - :'console_use_v2_user_api' => :'FeatureServiceFeatureFlag' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetInstanceFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetInstanceFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'login_default_org') - self.login_default_org = attributes[:'login_default_org'] - end - - if attributes.key?(:'user_schema') - self.user_schema = attributes[:'user_schema'] - end - - if attributes.key?(:'oidc_token_exchange') - self.oidc_token_exchange = attributes[:'oidc_token_exchange'] - end - - if attributes.key?(:'improved_performance') - self.improved_performance = attributes[:'improved_performance'] - end - - if attributes.key?(:'debug_oidc_parent_error') - self.debug_oidc_parent_error = attributes[:'debug_oidc_parent_error'] - end - - if attributes.key?(:'oidc_single_v1_session_termination') - self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] - end - - if attributes.key?(:'enable_back_channel_logout') - self.enable_back_channel_logout = attributes[:'enable_back_channel_logout'] - end - - if attributes.key?(:'login_v2') - self.login_v2 = attributes[:'login_v2'] - end - - if attributes.key?(:'permission_check_v2') - self.permission_check_v2 = attributes[:'permission_check_v2'] - end - - if attributes.key?(:'console_use_v2_user_api') - self.console_use_v2_user_api = attributes[:'console_use_v2_user_api'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - login_default_org == o.login_default_org && - user_schema == o.user_schema && - oidc_token_exchange == o.oidc_token_exchange && - improved_performance == o.improved_performance && - debug_oidc_parent_error == o.debug_oidc_parent_error && - oidc_single_v1_session_termination == o.oidc_single_v1_session_termination && - enable_back_channel_logout == o.enable_back_channel_logout && - login_v2 == o.login_v2 && - permission_check_v2 == o.permission_check_v2 && - console_use_v2_user_api == o.console_use_v2_user_api - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, login_default_org, user_schema, oidc_token_exchange, improved_performance, debug_oidc_parent_error, oidc_single_v1_session_termination, enable_back_channel_logout, login_v2, permission_check_v2, console_use_v2_user_api].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceGetInstanceFeaturesResponse. + class FeatureServiceGetInstanceFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + login_default_org: 'loginDefaultOrg', + user_schema: 'userSchema', + oidc_token_exchange: 'oidcTokenExchange', + improved_performance: 'improvedPerformance', + debug_oidc_parent_error: 'debugOidcParentError', + oidc_single_v1_session_termination: 'oidcSingleV1SessionTermination', + enable_back_channel_logout: 'enableBackChannelLogout', + login_v2: 'loginV2', + permission_check_v2: 'permissionCheckV2', + console_use_v2_user_api: 'consoleUseV2UserApi' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails', + login_default_org: 'FeatureServiceFeatureFlag', + user_schema: 'FeatureServiceFeatureFlag', + oidc_token_exchange: 'FeatureServiceFeatureFlag', + improved_performance: 'FeatureServiceImprovedPerformanceFeatureFlag', + debug_oidc_parent_error: 'FeatureServiceFeatureFlag', + oidc_single_v1_session_termination: 'FeatureServiceFeatureFlag', + enable_back_channel_logout: 'FeatureServiceFeatureFlag', + login_v2: 'FeatureServiceLoginV2FeatureFlag', + permission_check_v2: 'FeatureServiceFeatureFlag', + console_use_v2_user_api: 'FeatureServiceFeatureFlag' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_default_org, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_schema, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_token_exchange, Types::Any.optional.meta(omittable: true) + # @example null + attribute :improved_performance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :debug_oidc_parent_error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_single_v1_session_termination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :enable_back_channel_logout, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_v2, Types::Any.optional.meta(omittable: true) + # @example null + attribute :permission_check_v2, Types::Any.optional.meta(omittable: true) + # @example null + attribute :console_use_v2_user_api, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_get_organization_features_request.rb b/lib/zitadel/client/models/feature_service_get_organization_features_request.rb index 0b05ec16..30ff4225 100644 --- a/lib/zitadel/client/models/feature_service_get_organization_features_request.rb +++ b/lib/zitadel/client/models/feature_service_get_organization_features_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceGetOrganizationFeaturesRequest - attr_accessor :organization_id - - attr_accessor :inheritance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'inheritance' => :'inheritance' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'inheritance' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetOrganizationFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'inheritance') - self.inheritance = attributes[:'inheritance'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - inheritance == o.inheritance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, inheritance].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceGetOrganizationFeaturesRequest. + class FeatureServiceGetOrganizationFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + inheritance: 'inheritance' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + inheritance: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :inheritance, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_get_organization_features_response.rb b/lib/zitadel/client/models/feature_service_get_organization_features_response.rb index a456b0a8..cf41674f 100644 --- a/lib/zitadel/client/models/feature_service_get_organization_features_response.rb +++ b/lib/zitadel/client/models/feature_service_get_organization_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceGetOrganizationFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetOrganizationFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetOrganizationFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceGetOrganizationFeaturesResponse. + class FeatureServiceGetOrganizationFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_get_system_features_response.rb b/lib/zitadel/client/models/feature_service_get_system_features_response.rb index 1d130b10..5da82a9d 100644 --- a/lib/zitadel/client/models/feature_service_get_system_features_response.rb +++ b/lib/zitadel/client/models/feature_service_get_system_features_response.rb @@ -1,287 +1,105 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceGetSystemFeaturesResponse - attr_accessor :details - - attr_accessor :login_default_org - - attr_accessor :user_schema - - attr_accessor :oidc_token_exchange - - attr_accessor :improved_performance - - attr_accessor :oidc_single_v1_session_termination - - attr_accessor :enable_back_channel_logout - - attr_accessor :login_v2 - - attr_accessor :permission_check_v2 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'login_default_org' => :'loginDefaultOrg', - :'user_schema' => :'userSchema', - :'oidc_token_exchange' => :'oidcTokenExchange', - :'improved_performance' => :'improvedPerformance', - :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination', - :'enable_back_channel_logout' => :'enableBackChannelLogout', - :'login_v2' => :'loginV2', - :'permission_check_v2' => :'permissionCheckV2' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails', - :'login_default_org' => :'FeatureServiceFeatureFlag', - :'user_schema' => :'FeatureServiceFeatureFlag', - :'oidc_token_exchange' => :'FeatureServiceFeatureFlag', - :'improved_performance' => :'FeatureServiceImprovedPerformanceFeatureFlag', - :'oidc_single_v1_session_termination' => :'FeatureServiceFeatureFlag', - :'enable_back_channel_logout' => :'FeatureServiceFeatureFlag', - :'login_v2' => :'FeatureServiceLoginV2FeatureFlag', - :'permission_check_v2' => :'FeatureServiceFeatureFlag' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetSystemFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetSystemFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'login_default_org') - self.login_default_org = attributes[:'login_default_org'] - end - - if attributes.key?(:'user_schema') - self.user_schema = attributes[:'user_schema'] - end - - if attributes.key?(:'oidc_token_exchange') - self.oidc_token_exchange = attributes[:'oidc_token_exchange'] - end - - if attributes.key?(:'improved_performance') - self.improved_performance = attributes[:'improved_performance'] - end - - if attributes.key?(:'oidc_single_v1_session_termination') - self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] - end - - if attributes.key?(:'enable_back_channel_logout') - self.enable_back_channel_logout = attributes[:'enable_back_channel_logout'] - end - - if attributes.key?(:'login_v2') - self.login_v2 = attributes[:'login_v2'] - end - - if attributes.key?(:'permission_check_v2') - self.permission_check_v2 = attributes[:'permission_check_v2'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - login_default_org == o.login_default_org && - user_schema == o.user_schema && - oidc_token_exchange == o.oidc_token_exchange && - improved_performance == o.improved_performance && - oidc_single_v1_session_termination == o.oidc_single_v1_session_termination && - enable_back_channel_logout == o.enable_back_channel_logout && - login_v2 == o.login_v2 && - permission_check_v2 == o.permission_check_v2 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, login_default_org, user_schema, oidc_token_exchange, improved_performance, oidc_single_v1_session_termination, enable_back_channel_logout, login_v2, permission_check_v2].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceGetSystemFeaturesResponse. + class FeatureServiceGetSystemFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + login_default_org: 'loginDefaultOrg', + user_schema: 'userSchema', + oidc_token_exchange: 'oidcTokenExchange', + improved_performance: 'improvedPerformance', + oidc_single_v1_session_termination: 'oidcSingleV1SessionTermination', + enable_back_channel_logout: 'enableBackChannelLogout', + login_v2: 'loginV2', + permission_check_v2: 'permissionCheckV2' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails', + login_default_org: 'FeatureServiceFeatureFlag', + user_schema: 'FeatureServiceFeatureFlag', + oidc_token_exchange: 'FeatureServiceFeatureFlag', + improved_performance: 'FeatureServiceImprovedPerformanceFeatureFlag', + oidc_single_v1_session_termination: 'FeatureServiceFeatureFlag', + enable_back_channel_logout: 'FeatureServiceFeatureFlag', + login_v2: 'FeatureServiceLoginV2FeatureFlag', + permission_check_v2: 'FeatureServiceFeatureFlag' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_default_org, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_schema, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_token_exchange, Types::Any.optional.meta(omittable: true) + # @example null + attribute :improved_performance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_single_v1_session_termination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :enable_back_channel_logout, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_v2, Types::Any.optional.meta(omittable: true) + # @example null + attribute :permission_check_v2, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_get_user_features_request.rb b/lib/zitadel/client/models/feature_service_get_user_features_request.rb index 7c897bfa..81bc5175 100644 --- a/lib/zitadel/client/models/feature_service_get_user_features_request.rb +++ b/lib/zitadel/client/models/feature_service_get_user_features_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceGetUserFeaturesRequest - attr_accessor :user_id - - attr_accessor :inheritance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'inheritance' => :'inheritance' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'inheritance' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetUserFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetUserFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'inheritance') - self.inheritance = attributes[:'inheritance'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - inheritance == o.inheritance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, inheritance].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceGetUserFeaturesRequest. + class FeatureServiceGetUserFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + inheritance: 'inheritance' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + inheritance: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :inheritance, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_get_user_features_response.rb b/lib/zitadel/client/models/feature_service_get_user_features_response.rb index b2f2cff7..276abee8 100644 --- a/lib/zitadel/client/models/feature_service_get_user_features_response.rb +++ b/lib/zitadel/client/models/feature_service_get_user_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceGetUserFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceGetUserFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceGetUserFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceGetUserFeaturesResponse. + class FeatureServiceGetUserFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_improved_performance.rb b/lib/zitadel/client/models/feature_service_improved_performance.rb index 79685f51..5376f9b7 100644 --- a/lib/zitadel/client/models/feature_service_improved_performance.rb +++ b/lib/zitadel/client/models/feature_service_improved_performance.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class FeatureServiceImprovedPerformance - IMPROVED_PERFORMANCE_UNSPECIFIED = "IMPROVED_PERFORMANCE_UNSPECIFIED".freeze - IMPROVED_PERFORMANCE_PROJECT_GRANT = "IMPROVED_PERFORMANCE_PROJECT_GRANT".freeze - IMPROVED_PERFORMANCE_PROJECT = "IMPROVED_PERFORMANCE_PROJECT".freeze - IMPROVED_PERFORMANCE_USER_GRANT = "IMPROVED_PERFORMANCE_USER_GRANT".freeze - IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED = "IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for FeatureServiceImprovedPerformance. + class FeatureServiceImprovedPerformance + IMPROVED_PERFORMANCE_UNSPECIFIED = 'IMPROVED_PERFORMANCE_UNSPECIFIED' + IMPROVED_PERFORMANCE_PROJECT_GRANT = 'IMPROVED_PERFORMANCE_PROJECT_GRANT' + IMPROVED_PERFORMANCE_PROJECT = 'IMPROVED_PERFORMANCE_PROJECT' + IMPROVED_PERFORMANCE_USER_GRANT = 'IMPROVED_PERFORMANCE_USER_GRANT' + IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED = 'IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED' - def self.all_vars - @all_vars ||= [IMPROVED_PERFORMANCE_UNSPECIFIED, IMPROVED_PERFORMANCE_PROJECT_GRANT, IMPROVED_PERFORMANCE_PROJECT, IMPROVED_PERFORMANCE_USER_GRANT, IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [IMPROVED_PERFORMANCE_UNSPECIFIED, IMPROVED_PERFORMANCE_PROJECT_GRANT, IMPROVED_PERFORMANCE_PROJECT, IMPROVED_PERFORMANCE_USER_GRANT, IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if FeatureServiceImprovedPerformance.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::FeatureServiceImprovedPerformance" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for FeatureServiceImprovedPerformance: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/feature_service_improved_performance_feature_flag.rb b/lib/zitadel/client/models/feature_service_improved_performance_feature_flag.rb index f6bfa809..518c277e 100644 --- a/lib/zitadel/client/models/feature_service_improved_performance_feature_flag.rb +++ b/lib/zitadel/client/models/feature_service_improved_performance_feature_flag.rb @@ -1,248 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceImprovedPerformanceFeatureFlag - attr_accessor :execution_paths - - attr_accessor :source - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'execution_paths' => :'executionPaths', - :'source' => :'source' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'execution_paths' => :'Array', - :'source' => :'FeatureServiceSource' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceImprovedPerformanceFeatureFlag` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceImprovedPerformanceFeatureFlag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'execution_paths') - if (value = attributes[:'execution_paths']).is_a?(Array) - self.execution_paths = value - end - end - - if attributes.key?(:'source') - self.source = attributes[:'source'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - execution_paths == o.execution_paths && - source == o.source - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [execution_paths, source].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceImprovedPerformanceFeatureFlag. + class FeatureServiceImprovedPerformanceFeatureFlag < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + execution_paths: 'executionPaths', + source: 'source' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + execution_paths: 'Array', + source: 'FeatureServiceSource' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :execution_paths, Types::Any.optional.meta(omittable: true) + # @example null + attribute :source, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_login_v2.rb b/lib/zitadel/client/models/feature_service_login_v2.rb index 11ff5232..0ea737db 100644 --- a/lib/zitadel/client/models/feature_service_login_v2.rb +++ b/lib/zitadel/client/models/feature_service_login_v2.rb @@ -1,227 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceLoginV2 - # Require that all users must use the new login UI. If enabled, all users will be redirected to the login V2 regardless of the application's preference. - attr_accessor :required - - # Optionally specify a base uri of the login UI. If unspecified the default URI will be used. - attr_accessor :base_uri - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'required' => :'required', - :'base_uri' => :'baseUri' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'required' => :'Boolean', - :'base_uri' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'base_uri' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceLoginV2` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceLoginV2`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'required') - self.required = attributes[:'required'] - end - - if attributes.key?(:'base_uri') - self.base_uri = attributes[:'base_uri'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - required == o.required && - base_uri == o.base_uri - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [required, base_uri].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceLoginV2. + class FeatureServiceLoginV2 < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + required: 'required', + base_uri: 'baseUri' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + required: 'Boolean', + base_uri: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Require that all users must use the new login UI. If enabled, all users will be redirected to the login V2 regardless of the application's preference. + # @example null + attribute :required, Types::Any.optional.meta(omittable: true) + # Optionally specify a base uri of the login UI. If unspecified the default URI will be used. + # @example null + attribute :base_uri, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_login_v2_feature_flag.rb b/lib/zitadel/client/models/feature_service_login_v2_feature_flag.rb index f59bde08..b50f07bb 100644 --- a/lib/zitadel/client/models/feature_service_login_v2_feature_flag.rb +++ b/lib/zitadel/client/models/feature_service_login_v2_feature_flag.rb @@ -1,256 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceLoginV2FeatureFlag - attr_accessor :required - - attr_accessor :base_uri - - attr_accessor :source - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'required' => :'required', - :'base_uri' => :'baseUri', - :'source' => :'source' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'required' => :'Boolean', - :'base_uri' => :'String', - :'source' => :'FeatureServiceSource' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'base_uri', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceLoginV2FeatureFlag` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceLoginV2FeatureFlag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'required') - self.required = attributes[:'required'] - end - - if attributes.key?(:'base_uri') - self.base_uri = attributes[:'base_uri'] - end - - if attributes.key?(:'source') - self.source = attributes[:'source'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - required == o.required && - base_uri == o.base_uri && - source == o.source - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [required, base_uri, source].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceLoginV2FeatureFlag. + class FeatureServiceLoginV2FeatureFlag < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + required: 'required', + base_uri: 'baseUri', + source: 'source' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + required: 'Boolean', + base_uri: 'String', + source: 'FeatureServiceSource' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :required, Types::Any.optional.meta(omittable: true) + # @example null + attribute :base_uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :source, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_reset_instance_features_response.rb b/lib/zitadel/client/models/feature_service_reset_instance_features_response.rb index 720ae01b..0479634b 100644 --- a/lib/zitadel/client/models/feature_service_reset_instance_features_response.rb +++ b/lib/zitadel/client/models/feature_service_reset_instance_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceResetInstanceFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceResetInstanceFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceResetInstanceFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceResetInstanceFeaturesResponse. + class FeatureServiceResetInstanceFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_reset_organization_features_request.rb b/lib/zitadel/client/models/feature_service_reset_organization_features_request.rb index ccb00981..a1b8a87e 100644 --- a/lib/zitadel/client/models/feature_service_reset_organization_features_request.rb +++ b/lib/zitadel/client/models/feature_service_reset_organization_features_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceResetOrganizationFeaturesRequest - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceResetOrganizationFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceResetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceResetOrganizationFeaturesRequest. + class FeatureServiceResetOrganizationFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_reset_organization_features_response.rb b/lib/zitadel/client/models/feature_service_reset_organization_features_response.rb index 80fd6765..3af434ff 100644 --- a/lib/zitadel/client/models/feature_service_reset_organization_features_response.rb +++ b/lib/zitadel/client/models/feature_service_reset_organization_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceResetOrganizationFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceResetOrganizationFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceResetOrganizationFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceResetOrganizationFeaturesResponse. + class FeatureServiceResetOrganizationFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_reset_system_features_response.rb b/lib/zitadel/client/models/feature_service_reset_system_features_response.rb index f81e14ec..856f7dd8 100644 --- a/lib/zitadel/client/models/feature_service_reset_system_features_response.rb +++ b/lib/zitadel/client/models/feature_service_reset_system_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceResetSystemFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceResetSystemFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceResetSystemFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceResetSystemFeaturesResponse. + class FeatureServiceResetSystemFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_reset_user_features_request.rb b/lib/zitadel/client/models/feature_service_reset_user_features_request.rb index c919ff8c..95413ae2 100644 --- a/lib/zitadel/client/models/feature_service_reset_user_features_request.rb +++ b/lib/zitadel/client/models/feature_service_reset_user_features_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceResetUserFeaturesRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceResetUserFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceResetUserFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceResetUserFeaturesRequest. + class FeatureServiceResetUserFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_reset_user_features_response.rb b/lib/zitadel/client/models/feature_service_reset_user_features_response.rb index ada64c03..12cddb12 100644 --- a/lib/zitadel/client/models/feature_service_reset_user_features_response.rb +++ b/lib/zitadel/client/models/feature_service_reset_user_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceResetUserFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceResetUserFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceResetUserFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceResetUserFeaturesResponse. + class FeatureServiceResetUserFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_set_instance_features_request.rb b/lib/zitadel/client/models/feature_service_set_instance_features_request.rb index 24a3247c..1aa8d1d8 100644 --- a/lib/zitadel/client/models/feature_service_set_instance_features_request.rb +++ b/lib/zitadel/client/models/feature_service_set_instance_features_request.rb @@ -1,308 +1,113 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceSetInstanceFeaturesRequest - attr_accessor :login_default_org - - attr_accessor :user_schema - - # Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. - attr_accessor :oidc_token_exchange - - attr_accessor :improved_performance - - attr_accessor :debug_oidc_parent_error - - attr_accessor :oidc_single_v1_session_termination - - # Deprecated: the flag has been removed and OIDC Back-Channel Logout is always enabled. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. - attr_accessor :enable_back_channel_logout - - attr_accessor :login_v2 - - attr_accessor :permission_check_v2 - - attr_accessor :console_use_v2_user_api - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_default_org' => :'loginDefaultOrg', - :'user_schema' => :'userSchema', - :'oidc_token_exchange' => :'oidcTokenExchange', - :'improved_performance' => :'improvedPerformance', - :'debug_oidc_parent_error' => :'debugOidcParentError', - :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination', - :'enable_back_channel_logout' => :'enableBackChannelLogout', - :'login_v2' => :'loginV2', - :'permission_check_v2' => :'permissionCheckV2', - :'console_use_v2_user_api' => :'consoleUseV2UserApi' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_default_org' => :'Boolean', - :'user_schema' => :'Boolean', - :'oidc_token_exchange' => :'Boolean', - :'improved_performance' => :'Array', - :'debug_oidc_parent_error' => :'Boolean', - :'oidc_single_v1_session_termination' => :'Boolean', - :'enable_back_channel_logout' => :'Boolean', - :'login_v2' => :'FeatureServiceLoginV2', - :'permission_check_v2' => :'Boolean', - :'console_use_v2_user_api' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'login_default_org', - :'user_schema', - :'oidc_token_exchange', - :'debug_oidc_parent_error', - :'oidc_single_v1_session_termination', - :'enable_back_channel_logout', - :'permission_check_v2', - :'console_use_v2_user_api' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetInstanceFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetInstanceFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_default_org') - self.login_default_org = attributes[:'login_default_org'] - end - - if attributes.key?(:'user_schema') - self.user_schema = attributes[:'user_schema'] - end - - if attributes.key?(:'oidc_token_exchange') - self.oidc_token_exchange = attributes[:'oidc_token_exchange'] - end - - if attributes.key?(:'improved_performance') - if (value = attributes[:'improved_performance']).is_a?(Array) - self.improved_performance = value - end - end - - if attributes.key?(:'debug_oidc_parent_error') - self.debug_oidc_parent_error = attributes[:'debug_oidc_parent_error'] - end - - if attributes.key?(:'oidc_single_v1_session_termination') - self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] - end - - if attributes.key?(:'enable_back_channel_logout') - self.enable_back_channel_logout = attributes[:'enable_back_channel_logout'] - end - - if attributes.key?(:'login_v2') - self.login_v2 = attributes[:'login_v2'] - end - - if attributes.key?(:'permission_check_v2') - self.permission_check_v2 = attributes[:'permission_check_v2'] - end - - if attributes.key?(:'console_use_v2_user_api') - self.console_use_v2_user_api = attributes[:'console_use_v2_user_api'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_default_org == o.login_default_org && - user_schema == o.user_schema && - oidc_token_exchange == o.oidc_token_exchange && - improved_performance == o.improved_performance && - debug_oidc_parent_error == o.debug_oidc_parent_error && - oidc_single_v1_session_termination == o.oidc_single_v1_session_termination && - enable_back_channel_logout == o.enable_back_channel_logout && - login_v2 == o.login_v2 && - permission_check_v2 == o.permission_check_v2 && - console_use_v2_user_api == o.console_use_v2_user_api - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_default_org, user_schema, oidc_token_exchange, improved_performance, debug_oidc_parent_error, oidc_single_v1_session_termination, enable_back_channel_logout, login_v2, permission_check_v2, console_use_v2_user_api].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceSetInstanceFeaturesRequest. + class FeatureServiceSetInstanceFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_default_org: 'loginDefaultOrg', + user_schema: 'userSchema', + oidc_token_exchange: 'oidcTokenExchange', + improved_performance: 'improvedPerformance', + debug_oidc_parent_error: 'debugOidcParentError', + oidc_single_v1_session_termination: 'oidcSingleV1SessionTermination', + enable_back_channel_logout: 'enableBackChannelLogout', + login_v2: 'loginV2', + permission_check_v2: 'permissionCheckV2', + console_use_v2_user_api: 'consoleUseV2UserApi' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_default_org: 'Boolean', + user_schema: 'Boolean', + oidc_token_exchange: 'Boolean', + improved_performance: 'Array', + debug_oidc_parent_error: 'Boolean', + oidc_single_v1_session_termination: 'Boolean', + enable_back_channel_logout: 'Boolean', + login_v2: 'FeatureServiceLoginV2', + permission_check_v2: 'Boolean', + console_use_v2_user_api: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_default_org, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_schema, Types::Any.optional.meta(omittable: true) + # Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. + # @example null + # @deprecated This property is deprecated. + attribute :oidc_token_exchange, Types::Any.optional.meta(omittable: true) + # @example null + attribute :improved_performance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :debug_oidc_parent_error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_single_v1_session_termination, Types::Any.optional.meta(omittable: true) + # Deprecated: the flag has been removed and OIDC Back-Channel Logout is always enabled. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. + # @example null + # @deprecated This property is deprecated. + attribute :enable_back_channel_logout, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_v2, Types::Any.optional.meta(omittable: true) + # @example null + attribute :permission_check_v2, Types::Any.optional.meta(omittable: true) + # @example null + attribute :console_use_v2_user_api, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_set_instance_features_response.rb b/lib/zitadel/client/models/feature_service_set_instance_features_response.rb index 832bae23..f134d38d 100644 --- a/lib/zitadel/client/models/feature_service_set_instance_features_response.rb +++ b/lib/zitadel/client/models/feature_service_set_instance_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceSetInstanceFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetInstanceFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetInstanceFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceSetInstanceFeaturesResponse. + class FeatureServiceSetInstanceFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_set_organization_features_request.rb b/lib/zitadel/client/models/feature_service_set_organization_features_request.rb index cae3b7c5..21a547c2 100644 --- a/lib/zitadel/client/models/feature_service_set_organization_features_request.rb +++ b/lib/zitadel/client/models/feature_service_set_organization_features_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceSetOrganizationFeaturesRequest - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetOrganizationFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetOrganizationFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceSetOrganizationFeaturesRequest. + class FeatureServiceSetOrganizationFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_set_organization_features_response.rb b/lib/zitadel/client/models/feature_service_set_organization_features_response.rb index 4256ae30..90b81ad2 100644 --- a/lib/zitadel/client/models/feature_service_set_organization_features_response.rb +++ b/lib/zitadel/client/models/feature_service_set_organization_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceSetOrganizationFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetOrganizationFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetOrganizationFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceSetOrganizationFeaturesResponse. + class FeatureServiceSetOrganizationFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_set_system_features_request.rb b/lib/zitadel/client/models/feature_service_set_system_features_request.rb index 8ec054cb..099d3757 100644 --- a/lib/zitadel/client/models/feature_service_set_system_features_request.rb +++ b/lib/zitadel/client/models/feature_service_set_system_features_request.rb @@ -1,288 +1,105 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceSetSystemFeaturesRequest - attr_accessor :login_default_org - - attr_accessor :user_schema - - # Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. - attr_accessor :oidc_token_exchange - - attr_accessor :improved_performance - - attr_accessor :oidc_single_v1_session_termination - - # Deprecated: the flag has been removed and OIDC Back-Channel Logout is always enabled. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. - attr_accessor :enable_back_channel_logout - - attr_accessor :login_v2 - - attr_accessor :permission_check_v2 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_default_org' => :'loginDefaultOrg', - :'user_schema' => :'userSchema', - :'oidc_token_exchange' => :'oidcTokenExchange', - :'improved_performance' => :'improvedPerformance', - :'oidc_single_v1_session_termination' => :'oidcSingleV1SessionTermination', - :'enable_back_channel_logout' => :'enableBackChannelLogout', - :'login_v2' => :'loginV2', - :'permission_check_v2' => :'permissionCheckV2' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_default_org' => :'Boolean', - :'user_schema' => :'Boolean', - :'oidc_token_exchange' => :'Boolean', - :'improved_performance' => :'Array', - :'oidc_single_v1_session_termination' => :'Boolean', - :'enable_back_channel_logout' => :'Boolean', - :'login_v2' => :'FeatureServiceLoginV2', - :'permission_check_v2' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'login_default_org', - :'user_schema', - :'oidc_token_exchange', - :'oidc_single_v1_session_termination', - :'enable_back_channel_logout', - :'permission_check_v2' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetSystemFeaturesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetSystemFeaturesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_default_org') - self.login_default_org = attributes[:'login_default_org'] - end - - if attributes.key?(:'user_schema') - self.user_schema = attributes[:'user_schema'] - end - - if attributes.key?(:'oidc_token_exchange') - self.oidc_token_exchange = attributes[:'oidc_token_exchange'] - end - - if attributes.key?(:'improved_performance') - if (value = attributes[:'improved_performance']).is_a?(Array) - self.improved_performance = value - end - end - - if attributes.key?(:'oidc_single_v1_session_termination') - self.oidc_single_v1_session_termination = attributes[:'oidc_single_v1_session_termination'] - end - - if attributes.key?(:'enable_back_channel_logout') - self.enable_back_channel_logout = attributes[:'enable_back_channel_logout'] - end - - if attributes.key?(:'login_v2') - self.login_v2 = attributes[:'login_v2'] - end - - if attributes.key?(:'permission_check_v2') - self.permission_check_v2 = attributes[:'permission_check_v2'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_default_org == o.login_default_org && - user_schema == o.user_schema && - oidc_token_exchange == o.oidc_token_exchange && - improved_performance == o.improved_performance && - oidc_single_v1_session_termination == o.oidc_single_v1_session_termination && - enable_back_channel_logout == o.enable_back_channel_logout && - login_v2 == o.login_v2 && - permission_check_v2 == o.permission_check_v2 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_default_org, user_schema, oidc_token_exchange, improved_performance, oidc_single_v1_session_termination, enable_back_channel_logout, login_v2, permission_check_v2].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceSetSystemFeaturesRequest. + class FeatureServiceSetSystemFeaturesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_default_org: 'loginDefaultOrg', + user_schema: 'userSchema', + oidc_token_exchange: 'oidcTokenExchange', + improved_performance: 'improvedPerformance', + oidc_single_v1_session_termination: 'oidcSingleV1SessionTermination', + enable_back_channel_logout: 'enableBackChannelLogout', + login_v2: 'loginV2', + permission_check_v2: 'permissionCheckV2' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_default_org: 'Boolean', + user_schema: 'Boolean', + oidc_token_exchange: 'Boolean', + improved_performance: 'Array', + oidc_single_v1_session_termination: 'Boolean', + enable_back_channel_logout: 'Boolean', + login_v2: 'FeatureServiceLoginV2', + permission_check_v2: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_default_org, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_schema, Types::Any.optional.meta(omittable: true) + # Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. + # @example null + # @deprecated This property is deprecated. + attribute :oidc_token_exchange, Types::Any.optional.meta(omittable: true) + # @example null + attribute :improved_performance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc_single_v1_session_termination, Types::Any.optional.meta(omittable: true) + # Deprecated: the flag has been removed and OIDC Back-Channel Logout is always enabled. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect. + # @example null + # @deprecated This property is deprecated. + attribute :enable_back_channel_logout, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_v2, Types::Any.optional.meta(omittable: true) + # @example null + attribute :permission_check_v2, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/feature_service_set_system_features_response.rb b/lib/zitadel/client/models/feature_service_set_system_features_response.rb index d90e55db..22bda464 100644 --- a/lib/zitadel/client/models/feature_service_set_system_features_response.rb +++ b/lib/zitadel/client/models/feature_service_set_system_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceSetSystemFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetSystemFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetSystemFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceSetSystemFeaturesResponse. + class FeatureServiceSetSystemFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_set_user_feature_request.rb b/lib/zitadel/client/models/feature_service_set_user_feature_request.rb index f0ce1b07..7d5b6107 100644 --- a/lib/zitadel/client/models/feature_service_set_user_feature_request.rb +++ b/lib/zitadel/client/models/feature_service_set_user_feature_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceSetUserFeatureRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetUserFeatureRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetUserFeatureRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceSetUserFeatureRequest. + class FeatureServiceSetUserFeatureRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_set_user_features_response.rb b/lib/zitadel/client/models/feature_service_set_user_features_response.rb index f42aa0ac..d791ea8d 100644 --- a/lib/zitadel/client/models/feature_service_set_user_features_response.rb +++ b/lib/zitadel/client/models/feature_service_set_user_features_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class FeatureServiceSetUserFeaturesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'FeatureServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::FeatureServiceSetUserFeaturesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::FeatureServiceSetUserFeaturesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for FeatureServiceSetUserFeaturesResponse. + class FeatureServiceSetUserFeaturesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'FeatureServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/feature_service_source.rb b/lib/zitadel/client/models/feature_service_source.rb index f7acb199..761efdc2 100644 --- a/lib/zitadel/client/models/feature_service_source.rb +++ b/lib/zitadel/client/models/feature_service_source.rb @@ -1,46 +1,66 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class FeatureServiceSource - SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED".freeze - SOURCE_SYSTEM = "SOURCE_SYSTEM".freeze - SOURCE_INSTANCE = "SOURCE_INSTANCE".freeze - SOURCE_ORGANIZATION = "SOURCE_ORGANIZATION".freeze - SOURCE_PROJECT = "SOURCE_PROJECT".freeze - SOURCE_APP = "SOURCE_APP".freeze - SOURCE_USER = "SOURCE_USER".freeze - - def self.all_vars - @all_vars ||= [SOURCE_UNSPECIFIED, SOURCE_SYSTEM, SOURCE_INSTANCE, SOURCE_ORGANIZATION, SOURCE_PROJECT, SOURCE_APP, SOURCE_USER].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for FeatureServiceSource. + class FeatureServiceSource + SOURCE_UNSPECIFIED = 'SOURCE_UNSPECIFIED' + SOURCE_SYSTEM = 'SOURCE_SYSTEM' + SOURCE_INSTANCE = 'SOURCE_INSTANCE' + SOURCE_ORGANIZATION = 'SOURCE_ORGANIZATION' + SOURCE_PROJECT = 'SOURCE_PROJECT' + SOURCE_APP = 'SOURCE_APP' + SOURCE_USER = 'SOURCE_USER' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [SOURCE_UNSPECIFIED, SOURCE_SYSTEM, SOURCE_INSTANCE, SOURCE_ORGANIZATION, SOURCE_PROJECT, SOURCE_APP, SOURCE_USER].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if FeatureServiceSource.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::FeatureServiceSource" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for FeatureServiceSource: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/identity_provider_service_any.rb b/lib/zitadel/client/models/identity_provider_service_any.rb index 63b22820..3899fcaa 100644 --- a/lib/zitadel/client/models/identity_provider_service_any.rb +++ b/lib/zitadel/client/models/identity_provider_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class IdentityProviderServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class IdentityProviderServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_apple_config.rb b/lib/zitadel/client/models/identity_provider_service_apple_config.rb index 66e1c76e..160fc307 100644 --- a/lib/zitadel/client/models/identity_provider_service_apple_config.rb +++ b/lib/zitadel/client/models/identity_provider_service_apple_config.rb @@ -1,248 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceAppleConfig - # Client id (App ID or Service ID) provided by Apple. - attr_accessor :client_id - - # Team ID provided by Apple. - attr_accessor :team_id - - # ID of the private key generated by Apple. - attr_accessor :key_id - - # The scopes requested by ZITADEL during the request to Apple. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'team_id' => :'teamId', - :'key_id' => :'keyId', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'team_id' => :'String', - :'key_id' => :'String', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceAppleConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceAppleConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'team_id') - self.team_id = attributes[:'team_id'] - end - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - team_id == o.team_id && - key_id == o.key_id && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, team_id, key_id, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceAppleConfig. + class IdentityProviderServiceAppleConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + team_id: 'teamId', + key_id: 'keyId', + scopes: 'scopes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + team_id: 'String', + key_id: 'String', + scopes: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Client id (App ID or Service ID) provided by Apple. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # Team ID provided by Apple. + # @example null + attribute :team_id, Types::Any.optional.meta(omittable: true) + # ID of the private key generated by Apple. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) + # The scopes requested by ZITADEL during the request to Apple. + # @example null + attribute :scopes, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_auto_linking_option.rb b/lib/zitadel/client/models/identity_provider_service_auto_linking_option.rb index 5c7ebf88..b19670bd 100644 --- a/lib/zitadel/client/models/identity_provider_service_auto_linking_option.rb +++ b/lib/zitadel/client/models/identity_provider_service_auto_linking_option.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class IdentityProviderServiceAutoLinkingOption - AUTO_LINKING_OPTION_UNSPECIFIED = "AUTO_LINKING_OPTION_UNSPECIFIED".freeze - AUTO_LINKING_OPTION_USERNAME = "AUTO_LINKING_OPTION_USERNAME".freeze - AUTO_LINKING_OPTION_EMAIL = "AUTO_LINKING_OPTION_EMAIL".freeze - - def self.all_vars - @all_vars ||= [AUTO_LINKING_OPTION_UNSPECIFIED, AUTO_LINKING_OPTION_USERNAME, AUTO_LINKING_OPTION_EMAIL].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if IdentityProviderServiceAutoLinkingOption.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceAutoLinkingOption" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for IdentityProviderServiceAutoLinkingOption. + class IdentityProviderServiceAutoLinkingOption + AUTO_LINKING_OPTION_UNSPECIFIED = 'AUTO_LINKING_OPTION_UNSPECIFIED' + AUTO_LINKING_OPTION_USERNAME = 'AUTO_LINKING_OPTION_USERNAME' + AUTO_LINKING_OPTION_EMAIL = 'AUTO_LINKING_OPTION_EMAIL' + + # Frozen set of all allowed values, used for validation. + VALUES = [AUTO_LINKING_OPTION_UNSPECIFIED, AUTO_LINKING_OPTION_USERNAME, AUTO_LINKING_OPTION_EMAIL].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for IdentityProviderServiceAutoLinkingOption: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/identity_provider_service_azure_a_d_config.rb b/lib/zitadel/client/models/identity_provider_service_azure_a_d_config.rb deleted file mode 100644 index 47054f88..00000000 --- a/lib/zitadel/client/models/identity_provider_service_azure_a_d_config.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceAzureADConfig - # Client id of the Azure AD application - attr_accessor :client_id - - attr_accessor :tenant - - # Azure AD doesn't send if the email has been verified. Enable this if the user email should always be added verified in ZITADEL (no verification emails will be sent). - attr_accessor :email_verified - - # The scopes requested by ZITADEL during the request to Azure AD. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'tenant' => :'tenant', - :'email_verified' => :'emailVerified', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'tenant' => :'IdentityProviderServiceAzureADTenant', - :'email_verified' => :'Boolean', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceAzureADConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceAzureADConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'tenant') - self.tenant = attributes[:'tenant'] - end - - if attributes.key?(:'email_verified') - self.email_verified = attributes[:'email_verified'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - tenant == o.tenant && - email_verified == o.email_verified && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, tenant, email_verified, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant.rb b/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant.rb deleted file mode 100644 index 5ad2977d..00000000 --- a/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceAzureADTenant - attr_accessor :tenant_id - - attr_accessor :tenant_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tenant_id' => :'tenantId', - :'tenant_type' => :'tenantType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'tenant_id' => :'String', - :'tenant_type' => :'IdentityProviderServiceAzureADTenantType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceAzureADTenant` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceAzureADTenant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tenant_id') - self.tenant_id = attributes[:'tenant_id'] - end - - if attributes.key?(:'tenant_type') - self.tenant_type = attributes[:'tenant_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tenant_id == o.tenant_id && - tenant_type == o.tenant_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tenant_id, tenant_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant_type.rb b/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant_type.rb deleted file mode 100644 index 9d663058..00000000 --- a/lib/zitadel/client/models/identity_provider_service_azure_a_d_tenant_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceAzureADTenantType - AZURE_AD_TENANT_TYPE_COMMON = "AZURE_AD_TENANT_TYPE_COMMON".freeze - AZURE_AD_TENANT_TYPE_ORGANISATIONS = "AZURE_AD_TENANT_TYPE_ORGANISATIONS".freeze - AZURE_AD_TENANT_TYPE_CONSUMERS = "AZURE_AD_TENANT_TYPE_CONSUMERS".freeze - - def self.all_vars - @all_vars ||= [AZURE_AD_TENANT_TYPE_COMMON, AZURE_AD_TENANT_TYPE_ORGANISATIONS, AZURE_AD_TENANT_TYPE_CONSUMERS].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if IdentityProviderServiceAzureADTenantType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceAzureADTenantType" - end - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_azure_ad_config.rb b/lib/zitadel/client/models/identity_provider_service_azure_ad_config.rb new file mode 100644 index 00000000..4146e6d8 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_azure_ad_config.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceAzureADConfig. + class IdentityProviderServiceAzureADConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + tenant: 'tenant', + email_verified: 'emailVerified', + scopes: 'scopes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + tenant: 'IdentityProviderServiceAzureADTenant', + email_verified: 'Boolean', + scopes: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Client id of the Azure AD application + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :tenant, Types::Any.optional.meta(omittable: true) + # Azure AD doesn't send if the email has been verified. Enable this if the user email should always be added verified in ZITADEL (no verification emails will be sent). + # @example null + attribute :email_verified, Types::Any.optional.meta(omittable: true) + # The scopes requested by ZITADEL during the request to Azure AD. + # @example null + attribute :scopes, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_azure_ad_tenant.rb b/lib/zitadel/client/models/identity_provider_service_azure_ad_tenant.rb new file mode 100644 index 00000000..f71d6484 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_azure_ad_tenant.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceAzureADTenant. + class IdentityProviderServiceAzureADTenant < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + tenant_id: 'tenantId', + tenant_type: 'tenantType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + tenant_id: 'String', + tenant_type: 'IdentityProviderServiceAzureADTenantType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :tenant_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :tenant_type, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_azure_ad_tenant_type.rb b/lib/zitadel/client/models/identity_provider_service_azure_ad_tenant_type.rb new file mode 100644 index 00000000..b6d24332 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_azure_ad_tenant_type.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for IdentityProviderServiceAzureADTenantType. + class IdentityProviderServiceAzureADTenantType + AZURE_AD_TENANT_TYPE_COMMON = 'AZURE_AD_TENANT_TYPE_COMMON' + AZURE_AD_TENANT_TYPE_ORGANISATIONS = 'AZURE_AD_TENANT_TYPE_ORGANISATIONS' + AZURE_AD_TENANT_TYPE_CONSUMERS = 'AZURE_AD_TENANT_TYPE_CONSUMERS' + + # Frozen set of all allowed values, used for validation. + VALUES = [AZURE_AD_TENANT_TYPE_COMMON, AZURE_AD_TENANT_TYPE_ORGANISATIONS, AZURE_AD_TENANT_TYPE_CONSUMERS].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for IdentityProviderServiceAzureADTenantType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_connect_error.rb b/lib/zitadel/client/models/identity_provider_service_connect_error.rb index d5561c83..1cb4ad37 100644 --- a/lib/zitadel/client/models/identity_provider_service_connect_error.rb +++ b/lib/zitadel/client/models/identity_provider_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class IdentityProviderServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class IdentityProviderServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_details.rb b/lib/zitadel/client/models/identity_provider_service_details.rb index 24d9415e..15930aa1 100644 --- a/lib/zitadel/client/models/identity_provider_service_details.rb +++ b/lib/zitadel/client/models/identity_provider_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceDetails. + class IdentityProviderServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_generic_o_i_d_c_config.rb b/lib/zitadel/client/models/identity_provider_service_generic_o_i_d_c_config.rb deleted file mode 100644 index b632620f..00000000 --- a/lib/zitadel/client/models/identity_provider_service_generic_o_i_d_c_config.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGenericOIDCConfig - # The OIDC issuer of the identity provider. - attr_accessor :issuer - - # Client id generated by the identity provider. - attr_accessor :client_id - - # The scopes requested by ZITADEL during the request on the identity provider. - attr_accessor :scopes - - # If true, provider information get mapped from the id token, not from the userinfo endpoint. - attr_accessor :is_id_token_mapping - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'issuer' => :'issuer', - :'client_id' => :'clientId', - :'scopes' => :'scopes', - :'is_id_token_mapping' => :'isIdTokenMapping' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'issuer' => :'String', - :'client_id' => :'String', - :'scopes' => :'Array', - :'is_id_token_mapping' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGenericOIDCConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGenericOIDCConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'issuer') - self.issuer = attributes[:'issuer'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - - if attributes.key?(:'is_id_token_mapping') - self.is_id_token_mapping = attributes[:'is_id_token_mapping'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - issuer == o.issuer && - client_id == o.client_id && - scopes == o.scopes && - is_id_token_mapping == o.is_id_token_mapping - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [issuer, client_id, scopes, is_id_token_mapping].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_generic_oidc_config.rb b/lib/zitadel/client/models/identity_provider_service_generic_oidc_config.rb new file mode 100644 index 00000000..58a21de9 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_generic_oidc_config.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceGenericOIDCConfig. + class IdentityProviderServiceGenericOIDCConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + issuer: 'issuer', + client_id: 'clientId', + scopes: 'scopes', + is_id_token_mapping: 'isIdTokenMapping' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + issuer: 'String', + client_id: 'String', + scopes: 'Array', + is_id_token_mapping: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The OIDC issuer of the identity provider. + # @example null + attribute :issuer, Types::Any.optional.meta(omittable: true) + # Client id generated by the identity provider. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # The scopes requested by ZITADEL during the request on the identity provider. + # @example null + attribute :scopes, Types::Any.optional.meta(omittable: true) + # If true, provider information get mapped from the id token, not from the userinfo endpoint. + # @example null + attribute :is_id_token_mapping, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_get_i_d_p_by_i_d_request.rb b/lib/zitadel/client/models/identity_provider_service_get_i_d_p_by_i_d_request.rb deleted file mode 100644 index 43ee7201..00000000 --- a/lib/zitadel/client/models/identity_provider_service_get_i_d_p_by_i_d_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGetIDPByIDRequest - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGetIDPByIDRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGetIDPByIDRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_get_i_d_p_by_i_d_response.rb b/lib/zitadel/client/models/identity_provider_service_get_i_d_p_by_i_d_response.rb deleted file mode 100644 index a93e8d67..00000000 --- a/lib/zitadel/client/models/identity_provider_service_get_i_d_p_by_i_d_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGetIDPByIDResponse - attr_accessor :idp - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp' => :'idp' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp' => :'IdentityProviderServiceIDP' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGetIDPByIDResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGetIDPByIDResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp') - self.idp = attributes[:'idp'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp == o.idp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_get_idpby_id_request.rb b/lib/zitadel/client/models/identity_provider_service_get_idpby_id_request.rb new file mode 100644 index 00000000..5e78bb79 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_get_idpby_id_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceGetIDPByIDRequest. + class IdentityProviderServiceGetIDPByIDRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_get_idpby_id_response.rb b/lib/zitadel/client/models/identity_provider_service_get_idpby_id_response.rb new file mode 100644 index 00000000..2a29ee8a --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_get_idpby_id_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceGetIDPByIDResponse. + class IdentityProviderServiceGetIDPByIDResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp: 'idp' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp: 'IdentityProviderServiceIDP' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_git_hub_config.rb b/lib/zitadel/client/models/identity_provider_service_git_hub_config.rb index b87fa58c..fa75a4e6 100644 --- a/lib/zitadel/client/models/identity_provider_service_git_hub_config.rb +++ b/lib/zitadel/client/models/identity_provider_service_git_hub_config.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGitHubConfig - # The client ID of the GitHub App. - attr_accessor :client_id - - # The scopes requested by ZITADEL during the request to GitHub. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGitHubConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGitHubConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceGitHubConfig. + class IdentityProviderServiceGitHubConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + scopes: 'scopes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + scopes: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The client ID of the GitHub App. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # The scopes requested by ZITADEL during the request to GitHub. + # @example null + attribute :scopes, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rb b/lib/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rb index 9689fb83..e9568ed8 100644 --- a/lib/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rb +++ b/lib/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rb @@ -1,255 +1,91 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGitHubEnterpriseServerConfig - # The client ID of the GitHub App. - attr_accessor :client_id - - attr_accessor :authorization_endpoint - - attr_accessor :token_endpoint - - attr_accessor :user_endpoint - - # The scopes requested by ZITADEL during the request to GitHub. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'authorization_endpoint' => :'authorizationEndpoint', - :'token_endpoint' => :'tokenEndpoint', - :'user_endpoint' => :'userEndpoint', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'authorization_endpoint' => :'String', - :'token_endpoint' => :'String', - :'user_endpoint' => :'String', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGitHubEnterpriseServerConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGitHubEnterpriseServerConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'authorization_endpoint') - self.authorization_endpoint = attributes[:'authorization_endpoint'] - end - - if attributes.key?(:'token_endpoint') - self.token_endpoint = attributes[:'token_endpoint'] - end - - if attributes.key?(:'user_endpoint') - self.user_endpoint = attributes[:'user_endpoint'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - authorization_endpoint == o.authorization_endpoint && - token_endpoint == o.token_endpoint && - user_endpoint == o.user_endpoint && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, authorization_endpoint, token_endpoint, user_endpoint, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceGitHubEnterpriseServerConfig. + class IdentityProviderServiceGitHubEnterpriseServerConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + authorization_endpoint: 'authorizationEndpoint', + token_endpoint: 'tokenEndpoint', + user_endpoint: 'userEndpoint', + scopes: 'scopes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + authorization_endpoint: 'String', + token_endpoint: 'String', + user_endpoint: 'String', + scopes: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The client ID of the GitHub App. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :authorization_endpoint, Types::Any.optional.meta(omittable: true) + # @example null + attribute :token_endpoint, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_endpoint, Types::Any.optional.meta(omittable: true) + # The scopes requested by ZITADEL during the request to GitHub. + # @example null + attribute :scopes, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_git_lab_config.rb b/lib/zitadel/client/models/identity_provider_service_git_lab_config.rb index e48d2e19..b3827786 100644 --- a/lib/zitadel/client/models/identity_provider_service_git_lab_config.rb +++ b/lib/zitadel/client/models/identity_provider_service_git_lab_config.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGitLabConfig - # Client id of the GitLab application. - attr_accessor :client_id - - # The scopes requested by ZITADEL during the request to GitLab. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGitLabConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGitLabConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceGitLabConfig. + class IdentityProviderServiceGitLabConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + scopes: 'scopes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + scopes: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Client id of the GitLab application. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # The scopes requested by ZITADEL during the request to GitLab. + # @example null + attribute :scopes, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rb b/lib/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rb index 4f739745..4659cfcd 100644 --- a/lib/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rb +++ b/lib/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rb @@ -1,237 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGitLabSelfHostedConfig - attr_accessor :issuer - - # Client id of the GitLab application. - attr_accessor :client_id - - # The scopes requested by ZITADEL during the request to GitLab. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'issuer' => :'issuer', - :'client_id' => :'clientId', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'issuer' => :'String', - :'client_id' => :'String', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGitLabSelfHostedConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGitLabSelfHostedConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'issuer') - self.issuer = attributes[:'issuer'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - issuer == o.issuer && - client_id == o.client_id && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [issuer, client_id, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceGitLabSelfHostedConfig. + class IdentityProviderServiceGitLabSelfHostedConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + issuer: 'issuer', + client_id: 'clientId', + scopes: 'scopes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + issuer: 'String', + client_id: 'String', + scopes: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :issuer, Types::Any.optional.meta(omittable: true) + # Client id of the GitLab application. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # The scopes requested by ZITADEL during the request to GitLab. + # @example null + attribute :scopes, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_google_config.rb b/lib/zitadel/client/models/identity_provider_service_google_config.rb index 769b6b32..84b1db6d 100644 --- a/lib/zitadel/client/models/identity_provider_service_google_config.rb +++ b/lib/zitadel/client/models/identity_provider_service_google_config.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceGoogleConfig - # Client id of the Google application. - attr_accessor :client_id - - # The scopes requested by ZITADEL during the request to Google. - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'scopes' => :'scopes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceGoogleConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceGoogleConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, scopes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceGoogleConfig. + class IdentityProviderServiceGoogleConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + scopes: 'scopes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + scopes: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Client id of the Google application. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # The scopes requested by ZITADEL during the request to Google. + # @example null + attribute :scopes, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_i_d_p.rb b/lib/zitadel/client/models/identity_provider_service_i_d_p.rb deleted file mode 100644 index a7e78837..00000000 --- a/lib/zitadel/client/models/identity_provider_service_i_d_p.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceIDP - # Unique identifier for the identity provider. - attr_accessor :id - - attr_accessor :details - - attr_accessor :state - - attr_accessor :name - - attr_accessor :type - - attr_accessor :config - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'details' => :'details', - :'state' => :'state', - :'name' => :'name', - :'type' => :'type', - :'config' => :'config' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'details' => :'IdentityProviderServiceDetails', - :'state' => :'IdentityProviderServiceIDPState', - :'name' => :'String', - :'type' => :'IdentityProviderServiceIDPType', - :'config' => :'IdentityProviderServiceIDPConfig' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceIDP` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceIDP`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'config') - self.config = attributes[:'config'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - details == o.details && - state == o.state && - name == o.name && - type == o.type && - config == o.config - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, details, state, name, type, config].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_i_d_p_config.rb b/lib/zitadel/client/models/identity_provider_service_i_d_p_config.rb deleted file mode 100644 index 26f7d0ee..00000000 --- a/lib/zitadel/client/models/identity_provider_service_i_d_p_config.rb +++ /dev/null @@ -1,323 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceIDPConfig - attr_accessor :options - - attr_accessor :apple - - attr_accessor :azure_ad - - attr_accessor :github - - attr_accessor :github_es - - attr_accessor :gitlab - - attr_accessor :gitlab_self_hosted - - attr_accessor :google - - attr_accessor :jwt - - attr_accessor :ldap - - attr_accessor :oauth - - attr_accessor :oidc - - attr_accessor :saml - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'options' => :'options', - :'apple' => :'apple', - :'azure_ad' => :'azureAd', - :'github' => :'github', - :'github_es' => :'githubEs', - :'gitlab' => :'gitlab', - :'gitlab_self_hosted' => :'gitlabSelfHosted', - :'google' => :'google', - :'jwt' => :'jwt', - :'ldap' => :'ldap', - :'oauth' => :'oauth', - :'oidc' => :'oidc', - :'saml' => :'saml' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'options' => :'IdentityProviderServiceOptions', - :'apple' => :'IdentityProviderServiceAppleConfig', - :'azure_ad' => :'IdentityProviderServiceAzureADConfig', - :'github' => :'IdentityProviderServiceGitHubConfig', - :'github_es' => :'IdentityProviderServiceGitHubEnterpriseServerConfig', - :'gitlab' => :'IdentityProviderServiceGitLabConfig', - :'gitlab_self_hosted' => :'IdentityProviderServiceGitLabSelfHostedConfig', - :'google' => :'IdentityProviderServiceGoogleConfig', - :'jwt' => :'IdentityProviderServiceJWTConfig', - :'ldap' => :'IdentityProviderServiceLDAPConfig', - :'oauth' => :'IdentityProviderServiceOAuthConfig', - :'oidc' => :'IdentityProviderServiceGenericOIDCConfig', - :'saml' => :'IdentityProviderServiceSAMLConfig' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceIDPConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceIDPConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - - if attributes.key?(:'apple') - self.apple = attributes[:'apple'] - end - - if attributes.key?(:'azure_ad') - self.azure_ad = attributes[:'azure_ad'] - end - - if attributes.key?(:'github') - self.github = attributes[:'github'] - end - - if attributes.key?(:'github_es') - self.github_es = attributes[:'github_es'] - end - - if attributes.key?(:'gitlab') - self.gitlab = attributes[:'gitlab'] - end - - if attributes.key?(:'gitlab_self_hosted') - self.gitlab_self_hosted = attributes[:'gitlab_self_hosted'] - end - - if attributes.key?(:'google') - self.google = attributes[:'google'] - end - - if attributes.key?(:'jwt') - self.jwt = attributes[:'jwt'] - end - - if attributes.key?(:'ldap') - self.ldap = attributes[:'ldap'] - end - - if attributes.key?(:'oauth') - self.oauth = attributes[:'oauth'] - end - - if attributes.key?(:'oidc') - self.oidc = attributes[:'oidc'] - end - - if attributes.key?(:'saml') - self.saml = attributes[:'saml'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - options == o.options && - apple == o.apple && - azure_ad == o.azure_ad && - github == o.github && - github_es == o.github_es && - gitlab == o.gitlab && - gitlab_self_hosted == o.gitlab_self_hosted && - google == o.google && - jwt == o.jwt && - ldap == o.ldap && - oauth == o.oauth && - oidc == o.oidc && - saml == o.saml - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [options, apple, azure_ad, github, github_es, gitlab, gitlab_self_hosted, google, jwt, ldap, oauth, oidc, saml].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_i_d_p_state.rb b/lib/zitadel/client/models/identity_provider_service_i_d_p_state.rb deleted file mode 100644 index 9d8b1d3d..00000000 --- a/lib/zitadel/client/models/identity_provider_service_i_d_p_state.rb +++ /dev/null @@ -1,44 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceIDPState - IDP_STATE_UNSPECIFIED = "IDP_STATE_UNSPECIFIED".freeze - IDP_STATE_ACTIVE = "IDP_STATE_ACTIVE".freeze - IDP_STATE_INACTIVE = "IDP_STATE_INACTIVE".freeze - IDP_STATE_REMOVED = "IDP_STATE_REMOVED".freeze - IDP_STATE_MIGRATED = "IDP_STATE_MIGRATED".freeze - - def self.all_vars - @all_vars ||= [IDP_STATE_UNSPECIFIED, IDP_STATE_ACTIVE, IDP_STATE_INACTIVE, IDP_STATE_REMOVED, IDP_STATE_MIGRATED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if IdentityProviderServiceIDPState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceIDPState" - end - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_i_d_p_type.rb b/lib/zitadel/client/models/identity_provider_service_i_d_p_type.rb deleted file mode 100644 index c73b1484..00000000 --- a/lib/zitadel/client/models/identity_provider_service_i_d_p_type.rb +++ /dev/null @@ -1,52 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceIDPType - IDP_TYPE_UNSPECIFIED = "IDP_TYPE_UNSPECIFIED".freeze - IDP_TYPE_OIDC = "IDP_TYPE_OIDC".freeze - IDP_TYPE_JWT = "IDP_TYPE_JWT".freeze - IDP_TYPE_LDAP = "IDP_TYPE_LDAP".freeze - IDP_TYPE_OAUTH = "IDP_TYPE_OAUTH".freeze - IDP_TYPE_AZURE_AD = "IDP_TYPE_AZURE_AD".freeze - IDP_TYPE_GITHUB = "IDP_TYPE_GITHUB".freeze - IDP_TYPE_GITHUB_ES = "IDP_TYPE_GITHUB_ES".freeze - IDP_TYPE_GITLAB = "IDP_TYPE_GITLAB".freeze - IDP_TYPE_GITLAB_SELF_HOSTED = "IDP_TYPE_GITLAB_SELF_HOSTED".freeze - IDP_TYPE_GOOGLE = "IDP_TYPE_GOOGLE".freeze - IDP_TYPE_APPLE = "IDP_TYPE_APPLE".freeze - IDP_TYPE_SAML = "IDP_TYPE_SAML".freeze - - def self.all_vars - @all_vars ||= [IDP_TYPE_UNSPECIFIED, IDP_TYPE_OIDC, IDP_TYPE_JWT, IDP_TYPE_LDAP, IDP_TYPE_OAUTH, IDP_TYPE_AZURE_AD, IDP_TYPE_GITHUB, IDP_TYPE_GITHUB_ES, IDP_TYPE_GITLAB, IDP_TYPE_GITLAB_SELF_HOSTED, IDP_TYPE_GOOGLE, IDP_TYPE_APPLE, IDP_TYPE_SAML].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if IdentityProviderServiceIDPType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceIDPType" - end - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_idp.rb b/lib/zitadel/client/models/identity_provider_service_idp.rb new file mode 100644 index 00000000..bdd9faa1 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_idp.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceIDP. + class IdentityProviderServiceIDP < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + details: 'details', + state: 'state', + name: 'name', + type: 'type', + config: 'config' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + details: 'IdentityProviderServiceDetails', + state: 'IdentityProviderServiceIDPState', + name: 'String', + type: 'IdentityProviderServiceIDPType', + config: 'IdentityProviderServiceIDPConfig' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Unique identifier for the identity provider. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :config, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_idp_config.rb b/lib/zitadel/client/models/identity_provider_service_idp_config.rb new file mode 100644 index 00000000..c20512a1 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_idp_config.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceIDPConfig. + class IdentityProviderServiceIDPConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + options: 'options', + apple: 'apple', + azure_ad: 'azureAd', + github: 'github', + github_es: 'githubEs', + gitlab: 'gitlab', + gitlab_self_hosted: 'gitlabSelfHosted', + google: 'google', + jwt: 'jwt', + ldap: 'ldap', + oauth: 'oauth', + oidc: 'oidc', + saml: 'saml' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + options: 'IdentityProviderServiceOptions', + apple: 'IdentityProviderServiceAppleConfig', + azure_ad: 'IdentityProviderServiceAzureADConfig', + github: 'IdentityProviderServiceGitHubConfig', + github_es: 'IdentityProviderServiceGitHubEnterpriseServerConfig', + gitlab: 'IdentityProviderServiceGitLabConfig', + gitlab_self_hosted: 'IdentityProviderServiceGitLabSelfHostedConfig', + google: 'IdentityProviderServiceGoogleConfig', + jwt: 'IdentityProviderServiceJWTConfig', + ldap: 'IdentityProviderServiceLDAPConfig', + oauth: 'IdentityProviderServiceOAuthConfig', + oidc: 'IdentityProviderServiceGenericOIDCConfig', + saml: 'IdentityProviderServiceSAMLConfig' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :options, Types::Any.optional.meta(omittable: true) + # @example null + attribute :apple, Types::Any.optional.meta(omittable: true) + # @example null + attribute :azure_ad, Types::Any.optional.meta(omittable: true) + # @example null + attribute :github, Types::Any.optional.meta(omittable: true) + # @example null + attribute :github_es, Types::Any.optional.meta(omittable: true) + # @example null + attribute :gitlab, Types::Any.optional.meta(omittable: true) + # @example null + attribute :gitlab_self_hosted, Types::Any.optional.meta(omittable: true) + # @example null + attribute :google, Types::Any.optional.meta(omittable: true) + # @example null + attribute :jwt, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ldap, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oauth, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oidc, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_idp_state.rb b/lib/zitadel/client/models/identity_provider_service_idp_state.rb new file mode 100644 index 00000000..cb843a13 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_idp_state.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for IdentityProviderServiceIDPState. + class IdentityProviderServiceIDPState + IDP_STATE_UNSPECIFIED = 'IDP_STATE_UNSPECIFIED' + IDP_STATE_ACTIVE = 'IDP_STATE_ACTIVE' + IDP_STATE_INACTIVE = 'IDP_STATE_INACTIVE' + IDP_STATE_REMOVED = 'IDP_STATE_REMOVED' + IDP_STATE_MIGRATED = 'IDP_STATE_MIGRATED' + + # Frozen set of all allowed values, used for validation. + VALUES = [IDP_STATE_UNSPECIFIED, IDP_STATE_ACTIVE, IDP_STATE_INACTIVE, IDP_STATE_REMOVED, IDP_STATE_MIGRATED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for IdentityProviderServiceIDPState: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_idp_type.rb b/lib/zitadel/client/models/identity_provider_service_idp_type.rb new file mode 100644 index 00000000..912e0075 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_idp_type.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for IdentityProviderServiceIDPType. + class IdentityProviderServiceIDPType + IDP_TYPE_UNSPECIFIED = 'IDP_TYPE_UNSPECIFIED' + IDP_TYPE_OIDC = 'IDP_TYPE_OIDC' + IDP_TYPE_JWT = 'IDP_TYPE_JWT' + IDP_TYPE_LDAP = 'IDP_TYPE_LDAP' + IDP_TYPE_OAUTH = 'IDP_TYPE_OAUTH' + IDP_TYPE_AZURE_AD = 'IDP_TYPE_AZURE_AD' + IDP_TYPE_GITHUB = 'IDP_TYPE_GITHUB' + IDP_TYPE_GITHUB_ES = 'IDP_TYPE_GITHUB_ES' + IDP_TYPE_GITLAB = 'IDP_TYPE_GITLAB' + IDP_TYPE_GITLAB_SELF_HOSTED = 'IDP_TYPE_GITLAB_SELF_HOSTED' + IDP_TYPE_GOOGLE = 'IDP_TYPE_GOOGLE' + IDP_TYPE_APPLE = 'IDP_TYPE_APPLE' + IDP_TYPE_SAML = 'IDP_TYPE_SAML' + + # Frozen set of all allowed values, used for validation. + VALUES = [IDP_TYPE_UNSPECIFIED, IDP_TYPE_OIDC, IDP_TYPE_JWT, IDP_TYPE_LDAP, IDP_TYPE_OAUTH, IDP_TYPE_AZURE_AD, IDP_TYPE_GITHUB, IDP_TYPE_GITHUB_ES, IDP_TYPE_GITLAB, IDP_TYPE_GITLAB_SELF_HOSTED, IDP_TYPE_GOOGLE, IDP_TYPE_APPLE, IDP_TYPE_SAML].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for IdentityProviderServiceIDPType: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_j_w_t_config.rb b/lib/zitadel/client/models/identity_provider_service_j_w_t_config.rb deleted file mode 100644 index 82cfe830..00000000 --- a/lib/zitadel/client/models/identity_provider_service_j_w_t_config.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceJWTConfig - # The endpoint where the JWT can be extracted. - attr_accessor :jwt_endpoint - - # The issuer of the JWT (for validation). - attr_accessor :issuer - - # The endpoint to the key (JWK) which is used to sign the JWT with. - attr_accessor :keys_endpoint - - # The name of the header where the JWT is sent in, default is authorization. - attr_accessor :header_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'jwt_endpoint' => :'jwtEndpoint', - :'issuer' => :'issuer', - :'keys_endpoint' => :'keysEndpoint', - :'header_name' => :'headerName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'jwt_endpoint' => :'String', - :'issuer' => :'String', - :'keys_endpoint' => :'String', - :'header_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceJWTConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceJWTConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'jwt_endpoint') - self.jwt_endpoint = attributes[:'jwt_endpoint'] - end - - if attributes.key?(:'issuer') - self.issuer = attributes[:'issuer'] - end - - if attributes.key?(:'keys_endpoint') - self.keys_endpoint = attributes[:'keys_endpoint'] - end - - if attributes.key?(:'header_name') - self.header_name = attributes[:'header_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - jwt_endpoint == o.jwt_endpoint && - issuer == o.issuer && - keys_endpoint == o.keys_endpoint && - header_name == o.header_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [jwt_endpoint, issuer, keys_endpoint, header_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_jwt_config.rb b/lib/zitadel/client/models/identity_provider_service_jwt_config.rb new file mode 100644 index 00000000..7932a5e9 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_jwt_config.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceJWTConfig. + class IdentityProviderServiceJWTConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + jwt_endpoint: 'jwtEndpoint', + issuer: 'issuer', + keys_endpoint: 'keysEndpoint', + header_name: 'headerName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + jwt_endpoint: 'String', + issuer: 'String', + keys_endpoint: 'String', + header_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The endpoint where the JWT can be extracted. + # @example null + attribute :jwt_endpoint, Types::Any.optional.meta(omittable: true) + # The issuer of the JWT (for validation). + # @example null + attribute :issuer, Types::Any.optional.meta(omittable: true) + # The endpoint to the key (JWK) which is used to sign the JWT with. + # @example null + attribute :keys_endpoint, Types::Any.optional.meta(omittable: true) + # The name of the header where the JWT is sent in, default is authorization. + # @example null + attribute :header_name, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_l_d_a_p_attributes.rb b/lib/zitadel/client/models/identity_provider_service_l_d_a_p_attributes.rb deleted file mode 100644 index d3f0abfe..00000000 --- a/lib/zitadel/client/models/identity_provider_service_l_d_a_p_attributes.rb +++ /dev/null @@ -1,332 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceLDAPAttributes - attr_accessor :id_attribute - - attr_accessor :first_name_attribute - - attr_accessor :last_name_attribute - - attr_accessor :display_name_attribute - - attr_accessor :nick_name_attribute - - attr_accessor :preferred_username_attribute - - attr_accessor :email_attribute - - attr_accessor :email_verified_attribute - - attr_accessor :phone_attribute - - attr_accessor :phone_verified_attribute - - attr_accessor :preferred_language_attribute - - attr_accessor :avatar_url_attribute - - attr_accessor :profile_attribute - - attr_accessor :root_ca - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id_attribute' => :'idAttribute', - :'first_name_attribute' => :'firstNameAttribute', - :'last_name_attribute' => :'lastNameAttribute', - :'display_name_attribute' => :'displayNameAttribute', - :'nick_name_attribute' => :'nickNameAttribute', - :'preferred_username_attribute' => :'preferredUsernameAttribute', - :'email_attribute' => :'emailAttribute', - :'email_verified_attribute' => :'emailVerifiedAttribute', - :'phone_attribute' => :'phoneAttribute', - :'phone_verified_attribute' => :'phoneVerifiedAttribute', - :'preferred_language_attribute' => :'preferredLanguageAttribute', - :'avatar_url_attribute' => :'avatarUrlAttribute', - :'profile_attribute' => :'profileAttribute', - :'root_ca' => :'rootCa' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id_attribute' => :'String', - :'first_name_attribute' => :'String', - :'last_name_attribute' => :'String', - :'display_name_attribute' => :'String', - :'nick_name_attribute' => :'String', - :'preferred_username_attribute' => :'String', - :'email_attribute' => :'String', - :'email_verified_attribute' => :'String', - :'phone_attribute' => :'String', - :'phone_verified_attribute' => :'String', - :'preferred_language_attribute' => :'String', - :'avatar_url_attribute' => :'String', - :'profile_attribute' => :'String', - :'root_ca' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceLDAPAttributes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceLDAPAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id_attribute') - self.id_attribute = attributes[:'id_attribute'] - end - - if attributes.key?(:'first_name_attribute') - self.first_name_attribute = attributes[:'first_name_attribute'] - end - - if attributes.key?(:'last_name_attribute') - self.last_name_attribute = attributes[:'last_name_attribute'] - end - - if attributes.key?(:'display_name_attribute') - self.display_name_attribute = attributes[:'display_name_attribute'] - end - - if attributes.key?(:'nick_name_attribute') - self.nick_name_attribute = attributes[:'nick_name_attribute'] - end - - if attributes.key?(:'preferred_username_attribute') - self.preferred_username_attribute = attributes[:'preferred_username_attribute'] - end - - if attributes.key?(:'email_attribute') - self.email_attribute = attributes[:'email_attribute'] - end - - if attributes.key?(:'email_verified_attribute') - self.email_verified_attribute = attributes[:'email_verified_attribute'] - end - - if attributes.key?(:'phone_attribute') - self.phone_attribute = attributes[:'phone_attribute'] - end - - if attributes.key?(:'phone_verified_attribute') - self.phone_verified_attribute = attributes[:'phone_verified_attribute'] - end - - if attributes.key?(:'preferred_language_attribute') - self.preferred_language_attribute = attributes[:'preferred_language_attribute'] - end - - if attributes.key?(:'avatar_url_attribute') - self.avatar_url_attribute = attributes[:'avatar_url_attribute'] - end - - if attributes.key?(:'profile_attribute') - self.profile_attribute = attributes[:'profile_attribute'] - end - - if attributes.key?(:'root_ca') - self.root_ca = attributes[:'root_ca'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id_attribute == o.id_attribute && - first_name_attribute == o.first_name_attribute && - last_name_attribute == o.last_name_attribute && - display_name_attribute == o.display_name_attribute && - nick_name_attribute == o.nick_name_attribute && - preferred_username_attribute == o.preferred_username_attribute && - email_attribute == o.email_attribute && - email_verified_attribute == o.email_verified_attribute && - phone_attribute == o.phone_attribute && - phone_verified_attribute == o.phone_verified_attribute && - preferred_language_attribute == o.preferred_language_attribute && - avatar_url_attribute == o.avatar_url_attribute && - profile_attribute == o.profile_attribute && - root_ca == o.root_ca - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id_attribute, first_name_attribute, last_name_attribute, display_name_attribute, nick_name_attribute, preferred_username_attribute, email_attribute, email_verified_attribute, phone_attribute, phone_verified_attribute, preferred_language_attribute, avatar_url_attribute, profile_attribute, root_ca].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_l_d_a_p_config.rb b/lib/zitadel/client/models/identity_provider_service_l_d_a_p_config.rb deleted file mode 100644 index 97a3a91c..00000000 --- a/lib/zitadel/client/models/identity_provider_service_l_d_a_p_config.rb +++ /dev/null @@ -1,303 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceLDAPConfig - attr_accessor :servers - - attr_accessor :start_tls - - attr_accessor :base_dn - - attr_accessor :bind_dn - - attr_accessor :user_base - - attr_accessor :user_object_classes - - attr_accessor :user_filters - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :timeout - - attr_accessor :attributes - - attr_accessor :root_ca - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'servers' => :'servers', - :'start_tls' => :'startTls', - :'base_dn' => :'baseDn', - :'bind_dn' => :'bindDn', - :'user_base' => :'userBase', - :'user_object_classes' => :'userObjectClasses', - :'user_filters' => :'userFilters', - :'timeout' => :'timeout', - :'attributes' => :'attributes', - :'root_ca' => :'rootCa' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'servers' => :'Array', - :'start_tls' => :'Boolean', - :'base_dn' => :'String', - :'bind_dn' => :'String', - :'user_base' => :'String', - :'user_object_classes' => :'Array', - :'user_filters' => :'Array', - :'timeout' => :'String', - :'attributes' => :'IdentityProviderServiceLDAPAttributes', - :'root_ca' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceLDAPConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceLDAPConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'servers') - if (value = attributes[:'servers']).is_a?(Array) - self.servers = value - end - end - - if attributes.key?(:'start_tls') - self.start_tls = attributes[:'start_tls'] - end - - if attributes.key?(:'base_dn') - self.base_dn = attributes[:'base_dn'] - end - - if attributes.key?(:'bind_dn') - self.bind_dn = attributes[:'bind_dn'] - end - - if attributes.key?(:'user_base') - self.user_base = attributes[:'user_base'] - end - - if attributes.key?(:'user_object_classes') - if (value = attributes[:'user_object_classes']).is_a?(Array) - self.user_object_classes = value - end - end - - if attributes.key?(:'user_filters') - if (value = attributes[:'user_filters']).is_a?(Array) - self.user_filters = value - end - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - - if attributes.key?(:'root_ca') - self.root_ca = attributes[:'root_ca'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - servers == o.servers && - start_tls == o.start_tls && - base_dn == o.base_dn && - bind_dn == o.bind_dn && - user_base == o.user_base && - user_object_classes == o.user_object_classes && - user_filters == o.user_filters && - timeout == o.timeout && - attributes == o.attributes && - root_ca == o.root_ca - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [servers, start_tls, base_dn, bind_dn, user_base, user_object_classes, user_filters, timeout, attributes, root_ca].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_ldap_attributes.rb b/lib/zitadel/client/models/identity_provider_service_ldap_attributes.rb new file mode 100644 index 00000000..b83811d0 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_ldap_attributes.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceLDAPAttributes. + class IdentityProviderServiceLDAPAttributes < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id_attribute: 'idAttribute', + first_name_attribute: 'firstNameAttribute', + last_name_attribute: 'lastNameAttribute', + display_name_attribute: 'displayNameAttribute', + nick_name_attribute: 'nickNameAttribute', + preferred_username_attribute: 'preferredUsernameAttribute', + email_attribute: 'emailAttribute', + email_verified_attribute: 'emailVerifiedAttribute', + phone_attribute: 'phoneAttribute', + phone_verified_attribute: 'phoneVerifiedAttribute', + preferred_language_attribute: 'preferredLanguageAttribute', + avatar_url_attribute: 'avatarUrlAttribute', + profile_attribute: 'profileAttribute', + root_ca: 'rootCa' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id_attribute: 'String', + first_name_attribute: 'String', + last_name_attribute: 'String', + display_name_attribute: 'String', + nick_name_attribute: 'String', + preferred_username_attribute: 'String', + email_attribute: 'String', + email_verified_attribute: 'String', + phone_attribute: 'String', + phone_verified_attribute: 'String', + preferred_language_attribute: 'String', + avatar_url_attribute: 'String', + profile_attribute: 'String', + root_ca: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :id_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :first_name_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :last_name_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :nick_name_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_username_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_verified_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_verified_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_language_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :avatar_url_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :profile_attribute, Types::Any.optional.meta(omittable: true) + # @example null + attribute :root_ca, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_ldap_config.rb b/lib/zitadel/client/models/identity_provider_service_ldap_config.rb new file mode 100644 index 00000000..bf4c7487 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_ldap_config.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceLDAPConfig. + class IdentityProviderServiceLDAPConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + servers: 'servers', + start_tls: 'startTls', + base_dn: 'baseDn', + bind_dn: 'bindDn', + user_base: 'userBase', + user_object_classes: 'userObjectClasses', + user_filters: 'userFilters', + timeout: 'timeout', + attributes: 'attributes', + root_ca: 'rootCa' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + servers: 'Array', + start_tls: 'Boolean', + base_dn: 'String', + bind_dn: 'String', + user_base: 'String', + user_object_classes: 'Array', + user_filters: 'Array', + timeout: 'ISO8601::Duration', + attributes: 'IdentityProviderServiceLDAPAttributes', + root_ca: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + root_ca: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :servers, Types::Any.optional.meta(omittable: true) + # @example null + attribute :start_tls, Types::Any.optional.meta(omittable: true) + # @example null + attribute :base_dn, Types::Any.optional.meta(omittable: true) + # @example null + attribute :bind_dn, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_base, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_object_classes, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_filters, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :timeout, Types::Any.optional.meta(omittable: true) + # @example null + attribute :attributes, Types::Any.optional.meta(omittable: true) + # @example null + attribute :root_ca, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_o_auth_config.rb b/lib/zitadel/client/models/identity_provider_service_o_auth_config.rb index b93a581b..66337e29 100644 --- a/lib/zitadel/client/models/identity_provider_service_o_auth_config.rb +++ b/lib/zitadel/client/models/identity_provider_service_o_auth_config.rb @@ -1,268 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceOAuthConfig - # Client id generated by the identity provider. - attr_accessor :client_id - - # The endpoint where ZITADEL send the user to authenticate. - attr_accessor :authorization_endpoint - - # The endpoint where ZITADEL can get the token. - attr_accessor :token_endpoint - - # The endpoint where ZITADEL can get the user information. - attr_accessor :user_endpoint - - # The scopes requested by ZITADEL during the request on the identity provider. - attr_accessor :scopes - - # Defines how the attribute is called where ZITADEL can get the id of the user. - attr_accessor :id_attribute - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'clientId', - :'authorization_endpoint' => :'authorizationEndpoint', - :'token_endpoint' => :'tokenEndpoint', - :'user_endpoint' => :'userEndpoint', - :'scopes' => :'scopes', - :'id_attribute' => :'idAttribute' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'authorization_endpoint' => :'String', - :'token_endpoint' => :'String', - :'user_endpoint' => :'String', - :'scopes' => :'Array', - :'id_attribute' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceOAuthConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceOAuthConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'authorization_endpoint') - self.authorization_endpoint = attributes[:'authorization_endpoint'] - end - - if attributes.key?(:'token_endpoint') - self.token_endpoint = attributes[:'token_endpoint'] - end - - if attributes.key?(:'user_endpoint') - self.user_endpoint = attributes[:'user_endpoint'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - - if attributes.key?(:'id_attribute') - self.id_attribute = attributes[:'id_attribute'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - authorization_endpoint == o.authorization_endpoint && - token_endpoint == o.token_endpoint && - user_endpoint == o.user_endpoint && - scopes == o.scopes && - id_attribute == o.id_attribute - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, authorization_endpoint, token_endpoint, user_endpoint, scopes, id_attribute].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceOAuthConfig. + class IdentityProviderServiceOAuthConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + client_id: 'clientId', + authorization_endpoint: 'authorizationEndpoint', + token_endpoint: 'tokenEndpoint', + user_endpoint: 'userEndpoint', + scopes: 'scopes', + id_attribute: 'idAttribute' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + client_id: 'String', + authorization_endpoint: 'String', + token_endpoint: 'String', + user_endpoint: 'String', + scopes: 'Array', + id_attribute: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Client id generated by the identity provider. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # The endpoint where ZITADEL send the user to authenticate. + # @example null + attribute :authorization_endpoint, Types::Any.optional.meta(omittable: true) + # The endpoint where ZITADEL can get the token. + # @example null + attribute :token_endpoint, Types::Any.optional.meta(omittable: true) + # The endpoint where ZITADEL can get the user information. + # @example null + attribute :user_endpoint, Types::Any.optional.meta(omittable: true) + # The scopes requested by ZITADEL during the request on the identity provider. + # @example null + attribute :scopes, Types::Any.optional.meta(omittable: true) + # Defines how the attribute is called where ZITADEL can get the id of the user. + # @example null + attribute :id_attribute, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_options.rb b/lib/zitadel/client/models/identity_provider_service_options.rb index 4e14e850..68380623 100644 --- a/lib/zitadel/client/models/identity_provider_service_options.rb +++ b/lib/zitadel/client/models/identity_provider_service_options.rb @@ -1,277 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceOptions - # Enable if users should be able to link an existing ZITADEL user with an external account. - attr_accessor :is_linking_allowed - - # Enable if users should be able to create a new account in ZITADEL when using an external account. - attr_accessor :is_creation_allowed - - # Enable if a new account in ZITADEL should be created automatically when login with an external account. - attr_accessor :is_auto_creation - - # Enable if a the ZITADEL account fields should be updated automatically on each login. - attr_accessor :is_auto_update - - attr_accessor :auto_linking - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_linking_allowed' => :'isLinkingAllowed', - :'is_creation_allowed' => :'isCreationAllowed', - :'is_auto_creation' => :'isAutoCreation', - :'is_auto_update' => :'isAutoUpdate', - :'auto_linking' => :'autoLinking' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_linking_allowed' => :'Boolean', - :'is_creation_allowed' => :'Boolean', - :'is_auto_creation' => :'Boolean', - :'is_auto_update' => :'Boolean', - :'auto_linking' => :'IdentityProviderServiceAutoLinkingOption' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceOptions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_linking_allowed') - self.is_linking_allowed = attributes[:'is_linking_allowed'] - end - - if attributes.key?(:'is_creation_allowed') - self.is_creation_allowed = attributes[:'is_creation_allowed'] - end - - if attributes.key?(:'is_auto_creation') - self.is_auto_creation = attributes[:'is_auto_creation'] - end - - if attributes.key?(:'is_auto_update') - self.is_auto_update = attributes[:'is_auto_update'] - end - - if attributes.key?(:'auto_linking') - self.auto_linking = attributes[:'auto_linking'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_linking_allowed == o.is_linking_allowed && - is_creation_allowed == o.is_creation_allowed && - is_auto_creation == o.is_auto_creation && - is_auto_update == o.is_auto_update && - auto_linking == o.auto_linking - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_linking_allowed, is_creation_allowed, is_auto_creation, is_auto_update, auto_linking].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceOptions. + class IdentityProviderServiceOptions < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + is_linking_allowed: 'isLinkingAllowed', + is_creation_allowed: 'isCreationAllowed', + is_auto_creation: 'isAutoCreation', + is_auto_update: 'isAutoUpdate', + auto_linking: 'autoLinking' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + is_linking_allowed: 'Boolean', + is_creation_allowed: 'Boolean', + is_auto_creation: 'Boolean', + is_auto_update: 'Boolean', + auto_linking: 'IdentityProviderServiceAutoLinkingOption' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Enable if users should be able to link an existing ZITADEL user with an external account. + # @example null + attribute :is_linking_allowed, Types::Any.optional.meta(omittable: true) + # Enable if users should be able to create a new account in ZITADEL when using an external account. + # @example null + attribute :is_creation_allowed, Types::Any.optional.meta(omittable: true) + # Enable if a new account in ZITADEL should be created automatically when login with an external account. + # @example null + attribute :is_auto_creation, Types::Any.optional.meta(omittable: true) + # Enable if a the ZITADEL account fields should be updated automatically on each login. + # @example null + attribute :is_auto_update, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auto_linking, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_binding.rb b/lib/zitadel/client/models/identity_provider_service_s_a_m_l_binding.rb deleted file mode 100644 index 2fa8e78e..00000000 --- a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_binding.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceSAMLBinding - SAML_BINDING_UNSPECIFIED = "SAML_BINDING_UNSPECIFIED".freeze - SAML_BINDING_POST = "SAML_BINDING_POST".freeze - SAML_BINDING_REDIRECT = "SAML_BINDING_REDIRECT".freeze - SAML_BINDING_ARTIFACT = "SAML_BINDING_ARTIFACT".freeze - - def self.all_vars - @all_vars ||= [SAML_BINDING_UNSPECIFIED, SAML_BINDING_POST, SAML_BINDING_REDIRECT, SAML_BINDING_ARTIFACT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if IdentityProviderServiceSAMLBinding.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceSAMLBinding" - end - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_config.rb b/lib/zitadel/client/models/identity_provider_service_s_a_m_l_config.rb deleted file mode 100644 index 76a2b0bc..00000000 --- a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_config.rb +++ /dev/null @@ -1,297 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceSAMLConfig - # Metadata of the SAML identity provider. - attr_accessor :metadata_xml - - attr_accessor :binding - - # Boolean which defines if the authentication requests are signed. - attr_accessor :with_signed_request - - attr_accessor :name_id_format - - # Optional name of the attribute, which will be used to map the user in case the nameid-format returned is `urn:oasis:names:tc:SAML:2.0:nameid-format:transient`. - attr_accessor :transient_mapping_attribute_name - - # Boolean weather federated logout is enabled. If enabled, ZITADEL will send a logout request to the identity provider, if the user terminates the session in ZITADEL. Be sure to provide a SLO endpoint as part of the metadata. - attr_accessor :federated_logout_enabled - - attr_accessor :signature_algorithm - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'metadata_xml' => :'metadataXml', - :'binding' => :'binding', - :'with_signed_request' => :'withSignedRequest', - :'name_id_format' => :'nameIdFormat', - :'transient_mapping_attribute_name' => :'transientMappingAttributeName', - :'federated_logout_enabled' => :'federatedLogoutEnabled', - :'signature_algorithm' => :'signatureAlgorithm' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'metadata_xml' => :'String', - :'binding' => :'IdentityProviderServiceSAMLBinding', - :'with_signed_request' => :'Boolean', - :'name_id_format' => :'IdentityProviderServiceSAMLNameIDFormat', - :'transient_mapping_attribute_name' => :'String', - :'federated_logout_enabled' => :'Boolean', - :'signature_algorithm' => :'IdentityProviderServiceSAMLSignatureAlgorithm' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'transient_mapping_attribute_name', - :'federated_logout_enabled', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::IdentityProviderServiceSAMLConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::IdentityProviderServiceSAMLConfig`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'metadata_xml') - self.metadata_xml = attributes[:'metadata_xml'] - end - - if attributes.key?(:'binding') - self.binding = attributes[:'binding'] - end - - if attributes.key?(:'with_signed_request') - self.with_signed_request = attributes[:'with_signed_request'] - end - - if attributes.key?(:'name_id_format') - self.name_id_format = attributes[:'name_id_format'] - end - - if attributes.key?(:'transient_mapping_attribute_name') - self.transient_mapping_attribute_name = attributes[:'transient_mapping_attribute_name'] - end - - if attributes.key?(:'federated_logout_enabled') - self.federated_logout_enabled = attributes[:'federated_logout_enabled'] - end - - if attributes.key?(:'signature_algorithm') - self.signature_algorithm = attributes[:'signature_algorithm'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - metadata_xml == o.metadata_xml && - binding == o.binding && - with_signed_request == o.with_signed_request && - name_id_format == o.name_id_format && - transient_mapping_attribute_name == o.transient_mapping_attribute_name && - federated_logout_enabled == o.federated_logout_enabled && - signature_algorithm == o.signature_algorithm - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [metadata_xml, binding, with_signed_request, name_id_format, transient_mapping_attribute_name, federated_logout_enabled, signature_algorithm].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_name_i_d_format.rb b/lib/zitadel/client/models/identity_provider_service_s_a_m_l_name_i_d_format.rb deleted file mode 100644 index 23395b12..00000000 --- a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_name_i_d_format.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceSAMLNameIDFormat - SAML_NAME_ID_FORMAT_UNSPECIFIED = "SAML_NAME_ID_FORMAT_UNSPECIFIED".freeze - SAML_NAME_ID_FORMAT_EMAIL_ADDRESS = "SAML_NAME_ID_FORMAT_EMAIL_ADDRESS".freeze - SAML_NAME_ID_FORMAT_PERSISTENT = "SAML_NAME_ID_FORMAT_PERSISTENT".freeze - SAML_NAME_ID_FORMAT_TRANSIENT = "SAML_NAME_ID_FORMAT_TRANSIENT".freeze - - def self.all_vars - @all_vars ||= [SAML_NAME_ID_FORMAT_UNSPECIFIED, SAML_NAME_ID_FORMAT_EMAIL_ADDRESS, SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_TRANSIENT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if IdentityProviderServiceSAMLNameIDFormat.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceSAMLNameIDFormat" - end - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_signature_algorithm.rb b/lib/zitadel/client/models/identity_provider_service_s_a_m_l_signature_algorithm.rb deleted file mode 100644 index caad9e08..00000000 --- a/lib/zitadel/client/models/identity_provider_service_s_a_m_l_signature_algorithm.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class IdentityProviderServiceSAMLSignatureAlgorithm - SAML_SIGNATURE_UNSPECIFIED = "SAML_SIGNATURE_UNSPECIFIED".freeze - SAML_SIGNATURE_RSA_SHA1 = "SAML_SIGNATURE_RSA_SHA1".freeze - SAML_SIGNATURE_RSA_SHA256 = "SAML_SIGNATURE_RSA_SHA256".freeze - SAML_SIGNATURE_RSA_SHA512 = "SAML_SIGNATURE_RSA_SHA512".freeze - - def self.all_vars - @all_vars ||= [SAML_SIGNATURE_UNSPECIFIED, SAML_SIGNATURE_RSA_SHA1, SAML_SIGNATURE_RSA_SHA256, SAML_SIGNATURE_RSA_SHA512].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if IdentityProviderServiceSAMLSignatureAlgorithm.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::IdentityProviderServiceSAMLSignatureAlgorithm" - end - end - -end diff --git a/lib/zitadel/client/models/identity_provider_service_saml_binding.rb b/lib/zitadel/client/models/identity_provider_service_saml_binding.rb new file mode 100644 index 00000000..9a68aa7e --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_saml_binding.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for IdentityProviderServiceSAMLBinding. + class IdentityProviderServiceSAMLBinding + SAML_BINDING_UNSPECIFIED = 'SAML_BINDING_UNSPECIFIED' + SAML_BINDING_POST = 'SAML_BINDING_POST' + SAML_BINDING_REDIRECT = 'SAML_BINDING_REDIRECT' + SAML_BINDING_ARTIFACT = 'SAML_BINDING_ARTIFACT' + + # Frozen set of all allowed values, used for validation. + VALUES = [SAML_BINDING_UNSPECIFIED, SAML_BINDING_POST, SAML_BINDING_REDIRECT, SAML_BINDING_ARTIFACT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for IdentityProviderServiceSAMLBinding: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_saml_config.rb b/lib/zitadel/client/models/identity_provider_service_saml_config.rb new file mode 100644 index 00000000..dc738dc7 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_saml_config.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for IdentityProviderServiceSAMLConfig. + class IdentityProviderServiceSAMLConfig < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + metadata_xml: 'metadataXml', + binding: 'binding', + with_signed_request: 'withSignedRequest', + name_id_format: 'nameIdFormat', + transient_mapping_attribute_name: 'transientMappingAttributeName', + federated_logout_enabled: 'federatedLogoutEnabled', + signature_algorithm: 'signatureAlgorithm' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + metadata_xml: 'String', + binding: 'IdentityProviderServiceSAMLBinding', + with_signed_request: 'Boolean', + name_id_format: 'IdentityProviderServiceSAMLNameIDFormat', + transient_mapping_attribute_name: 'String', + federated_logout_enabled: 'Boolean', + signature_algorithm: 'IdentityProviderServiceSAMLSignatureAlgorithm' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + metadata_xml: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Metadata of the SAML identity provider. + # @example null + attribute :metadata_xml, Types::Any.optional.meta(omittable: true) + # @example null + attribute :binding, Types::Any.optional.meta(omittable: true) + # Boolean which defines if the authentication requests are signed. + # @example null + attribute :with_signed_request, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name_id_format, Types::Any.optional.meta(omittable: true) + # Optional name of the attribute, which will be used to map the user in case the nameid-format returned is `urn:oasis:names:tc:SAML:2.0:nameid-format:transient`. + # @example null + attribute :transient_mapping_attribute_name, Types::Any.optional.meta(omittable: true) + # Boolean weather federated logout is enabled. If enabled, ZITADEL will send a logout request to the identity provider, if the user terminates the session in ZITADEL. Be sure to provide a SLO endpoint as part of the metadata. + # @example null + attribute :federated_logout_enabled, Types::Any.optional.meta(omittable: true) + # @example null + attribute :signature_algorithm, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_saml_name_id_format.rb b/lib/zitadel/client/models/identity_provider_service_saml_name_id_format.rb new file mode 100644 index 00000000..926b5a31 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_saml_name_id_format.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for IdentityProviderServiceSAMLNameIDFormat. + class IdentityProviderServiceSAMLNameIDFormat + SAML_NAME_ID_FORMAT_UNSPECIFIED = 'SAML_NAME_ID_FORMAT_UNSPECIFIED' + SAML_NAME_ID_FORMAT_EMAIL_ADDRESS = 'SAML_NAME_ID_FORMAT_EMAIL_ADDRESS' + SAML_NAME_ID_FORMAT_PERSISTENT = 'SAML_NAME_ID_FORMAT_PERSISTENT' + SAML_NAME_ID_FORMAT_TRANSIENT = 'SAML_NAME_ID_FORMAT_TRANSIENT' + + # Frozen set of all allowed values, used for validation. + VALUES = [SAML_NAME_ID_FORMAT_UNSPECIFIED, SAML_NAME_ID_FORMAT_EMAIL_ADDRESS, SAML_NAME_ID_FORMAT_PERSISTENT, SAML_NAME_ID_FORMAT_TRANSIENT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for IdentityProviderServiceSAMLNameIDFormat: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/identity_provider_service_saml_signature_algorithm.rb b/lib/zitadel/client/models/identity_provider_service_saml_signature_algorithm.rb new file mode 100644 index 00000000..163850e5 --- /dev/null +++ b/lib/zitadel/client/models/identity_provider_service_saml_signature_algorithm.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for IdentityProviderServiceSAMLSignatureAlgorithm. + class IdentityProviderServiceSAMLSignatureAlgorithm + SAML_SIGNATURE_UNSPECIFIED = 'SAML_SIGNATURE_UNSPECIFIED' + SAML_SIGNATURE_RSA_SHA1 = 'SAML_SIGNATURE_RSA_SHA1' + SAML_SIGNATURE_RSA_SHA256 = 'SAML_SIGNATURE_RSA_SHA256' + SAML_SIGNATURE_RSA_SHA512 = 'SAML_SIGNATURE_RSA_SHA512' + + # Frozen set of all allowed values, used for validation. + VALUES = [SAML_SIGNATURE_UNSPECIFIED, SAML_SIGNATURE_RSA_SHA1, SAML_SIGNATURE_RSA_SHA256, SAML_SIGNATURE_RSA_SHA512].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for IdentityProviderServiceSAMLSignatureAlgorithm: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/instance_service_add_custom_domain_request.rb b/lib/zitadel/client/models/instance_service_add_custom_domain_request.rb index 2ff5769c..494235ac 100644 --- a/lib/zitadel/client/models/instance_service_add_custom_domain_request.rb +++ b/lib/zitadel/client/models/instance_service_add_custom_domain_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceAddCustomDomainRequest - # InstanceID is the unique ID of the instance to which the domain will be added. - attr_accessor :instance_id - - # Custom domain to add to the instance. Must be a valid domain name. Once the domain is added, it will be used to route requests to this instance. - attr_accessor :custom_domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'custom_domain' => :'customDomain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'custom_domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceAddCustomDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceAddCustomDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'custom_domain') - self.custom_domain = attributes[:'custom_domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - custom_domain == o.custom_domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, custom_domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceAddCustomDomainRequest. + class InstanceServiceAddCustomDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + custom_domain: 'customDomain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + custom_domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique ID of the instance to which the domain will be added. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # Custom domain to add to the instance. Must be a valid domain name. Once the domain is added, it will be used to route requests to this instance. + # @example null + attribute :custom_domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_add_custom_domain_response.rb b/lib/zitadel/client/models/instance_service_add_custom_domain_response.rb index a99f7b56..295e008c 100644 --- a/lib/zitadel/client/models/instance_service_add_custom_domain_response.rb +++ b/lib/zitadel/client/models/instance_service_add_custom_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceAddCustomDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceAddCustomDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceAddCustomDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceAddCustomDomainResponse. + class InstanceServiceAddCustomDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_add_trusted_domain_request.rb b/lib/zitadel/client/models/instance_service_add_trusted_domain_request.rb index 1d8bed70..d97d1174 100644 --- a/lib/zitadel/client/models/instance_service_add_trusted_domain_request.rb +++ b/lib/zitadel/client/models/instance_service_add_trusted_domain_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceAddTrustedDomainRequest - # InstanceID is the unique ID of the instance to which the trusted domain will be added. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions. - attr_accessor :instance_id - - # Trusted domain to be added to the instance. Must be a valid domain name. Once the domain is added, it can be used in API responses like OIDC discovery, email templates, and more. This can be used in cases where the API is accessed through a different domain than the instance domain, e.g. proxy setups and custom login UIs. Unlike custom domains, trusted domains are not used to route requests to this instance and therefore do not need to be uniquely assigned to an instance. - attr_accessor :trusted_domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'trusted_domain' => :'trustedDomain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'trusted_domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceAddTrustedDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceAddTrustedDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'trusted_domain') - self.trusted_domain = attributes[:'trusted_domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - trusted_domain == o.trusted_domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, trusted_domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceAddTrustedDomainRequest. + class InstanceServiceAddTrustedDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + trusted_domain: 'trustedDomain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + trusted_domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique ID of the instance to which the trusted domain will be added. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # Trusted domain to be added to the instance. Must be a valid domain name. Once the domain is added, it can be used in API responses like OIDC discovery, email templates, and more. This can be used in cases where the API is accessed through a different domain than the instance domain, e.g. proxy setups and custom login UIs. Unlike custom domains, trusted domains are not used to route requests to this instance and therefore do not need to be uniquely assigned to an instance. + # @example null + attribute :trusted_domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_add_trusted_domain_response.rb b/lib/zitadel/client/models/instance_service_add_trusted_domain_response.rb index 838f0ef4..e1eb70c8 100644 --- a/lib/zitadel/client/models/instance_service_add_trusted_domain_response.rb +++ b/lib/zitadel/client/models/instance_service_add_trusted_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceAddTrustedDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceAddTrustedDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceAddTrustedDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceAddTrustedDomainResponse. + class InstanceServiceAddTrustedDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_any.rb b/lib/zitadel/client/models/instance_service_any.rb index 9e11964e..9c437829 100644 --- a/lib/zitadel/client/models/instance_service_any.rb +++ b/lib/zitadel/client/models/instance_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class InstanceServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class InstanceServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_connect_error.rb b/lib/zitadel/client/models/instance_service_connect_error.rb index 845de194..c562b273 100644 --- a/lib/zitadel/client/models/instance_service_connect_error.rb +++ b/lib/zitadel/client/models/instance_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class InstanceServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class InstanceServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_custom_domain.rb b/lib/zitadel/client/models/instance_service_custom_domain.rb index 8678ccfa..9ffeb3be 100644 --- a/lib/zitadel/client/models/instance_service_custom_domain.rb +++ b/lib/zitadel/client/models/instance_service_custom_domain.rb @@ -1,256 +1,94 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceCustomDomain - # InstanceID is the unique identifier of the instance the domain belongs to. - attr_accessor :instance_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Domain is the fully qualified domain name. It must be unique across all instances in the system. - attr_accessor :domain - - # Primary states whether this domain is the primary domain of the instance. Each instance must have exactly one primary domain. The primary domain is used for various purposes and acts as fallback in those cases, e.g if no explicit domain is specified. - attr_accessor :primary - - # Generate states whether this domain was auto-generated by the system. Auto-generated domains follow a specific pattern and are created when a new instance is created. They cannot be deleted, but the primary domain can be changed to a manually added domain. - attr_accessor :generated - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'creation_date' => :'creationDate', - :'domain' => :'domain', - :'primary' => :'primary', - :'generated' => :'generated' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'creation_date' => :'Time', - :'domain' => :'String', - :'primary' => :'Boolean', - :'generated' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceCustomDomain` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceCustomDomain`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'primary') - self.primary = attributes[:'primary'] - end - - if attributes.key?(:'generated') - self.generated = attributes[:'generated'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - creation_date == o.creation_date && - domain == o.domain && - primary == o.primary && - generated == o.generated - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, creation_date, domain, primary, generated].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceCustomDomain. + class InstanceServiceCustomDomain < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + creation_date: 'creationDate', + domain: 'domain', + primary: 'primary', + generated: 'generated' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + creation_date: 'Time', + domain: 'String', + primary: 'Boolean', + generated: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique identifier of the instance the domain belongs to. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # Domain is the fully qualified domain name. It must be unique across all instances in the system. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # Primary states whether this domain is the primary domain of the instance. Each instance must have exactly one primary domain. The primary domain is used for various purposes and acts as fallback in those cases, e.g if no explicit domain is specified. + # @example null + attribute :primary, Types::Any.optional.meta(omittable: true) + # Generate states whether this domain was auto-generated by the system. Auto-generated domains follow a specific pattern and are created when a new instance is created. They cannot be deleted, but the primary domain can be changed to a manually added domain. + # @example null + attribute :generated, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_custom_domain_filter.rb b/lib/zitadel/client/models/instance_service_custom_domain_filter.rb index 41064a85..71c00f15 100644 --- a/lib/zitadel/client/models/instance_service_custom_domain_filter.rb +++ b/lib/zitadel/client/models/instance_service_custom_domain_filter.rb @@ -1,235 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceCustomDomainFilter - attr_accessor :domain_filter - - # Filter whether the domain is auto-generated. - attr_accessor :generated_filter - - # Filter whether the domain is the primary domain of the instance. - attr_accessor :primary_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain_filter' => :'domainFilter', - :'generated_filter' => :'generatedFilter', - :'primary_filter' => :'primaryFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain_filter' => :'InstanceServiceDomainFilter', - :'generated_filter' => :'Boolean', - :'primary_filter' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceCustomDomainFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceCustomDomainFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain_filter') - self.domain_filter = attributes[:'domain_filter'] - end - - if attributes.key?(:'generated_filter') - self.generated_filter = attributes[:'generated_filter'] - end - - if attributes.key?(:'primary_filter') - self.primary_filter = attributes[:'primary_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain_filter == o.domain_filter && - generated_filter == o.generated_filter && - primary_filter == o.primary_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain_filter, generated_filter, primary_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceCustomDomainFilter. + class InstanceServiceCustomDomainFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain_filter: 'domainFilter', + generated_filter: 'generatedFilter', + primary_filter: 'primaryFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain_filter: 'InstanceServiceDomainFilter', + generated_filter: 'Boolean', + primary_filter: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain_filter, Types::Any.optional.meta(omittable: true) + # Filter whether the domain is auto-generated. + # @example null + attribute :generated_filter, Types::Any.optional.meta(omittable: true) + # Filter whether the domain is the primary domain of the instance. + # @example null + attribute :primary_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_custom_domains_filter.rb b/lib/zitadel/client/models/instance_service_custom_domains_filter.rb index 1e6fb860..b7cf2731 100644 --- a/lib/zitadel/client/models/instance_service_custom_domains_filter.rb +++ b/lib/zitadel/client/models/instance_service_custom_domains_filter.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceCustomDomainsFilter - # The domains to query for. All instances that have at least one of the specified domains will be returned. A maximum of 20 domains can be specified. - attr_accessor :domains - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domains' => :'domains' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domains' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceCustomDomainsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceCustomDomainsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domains') - if (value = attributes[:'domains']).is_a?(Array) - self.domains = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domains == o.domains - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domains].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceCustomDomainsFilter. + class InstanceServiceCustomDomainsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domains: 'domains' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domains: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The domains to query for. All instances that have at least one of the specified domains will be returned. A maximum of 20 domains can be specified. + # @example null + attribute :domains, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_delete_instance_request.rb b/lib/zitadel/client/models/instance_service_delete_instance_request.rb index 3c246adb..f9a7870e 100644 --- a/lib/zitadel/client/models/instance_service_delete_instance_request.rb +++ b/lib/zitadel/client/models/instance_service_delete_instance_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceDeleteInstanceRequest - # InstanceID is the unique ID of the instance to be deleted. - attr_accessor :instance_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceDeleteInstanceRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceDeleteInstanceRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceDeleteInstanceRequest. + class InstanceServiceDeleteInstanceRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique ID of the instance to be deleted. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_delete_instance_response.rb b/lib/zitadel/client/models/instance_service_delete_instance_response.rb index e40ed6ff..48b46579 100644 --- a/lib/zitadel/client/models/instance_service_delete_instance_response.rb +++ b/lib/zitadel/client/models/instance_service_delete_instance_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceDeleteInstanceResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceDeleteInstanceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceDeleteInstanceResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceDeleteInstanceResponse. + class InstanceServiceDeleteInstanceResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_domain_field_name.rb b/lib/zitadel/client/models/instance_service_domain_field_name.rb index 64853799..2ead147a 100644 --- a/lib/zitadel/client/models/instance_service_domain_field_name.rb +++ b/lib/zitadel/client/models/instance_service_domain_field_name.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class InstanceServiceDomainFieldName - DOMAIN_FIELD_NAME_UNSPECIFIED = "DOMAIN_FIELD_NAME_UNSPECIFIED".freeze - DOMAIN_FIELD_NAME_DOMAIN = "DOMAIN_FIELD_NAME_DOMAIN".freeze - DOMAIN_FIELD_NAME_PRIMARY = "DOMAIN_FIELD_NAME_PRIMARY".freeze - DOMAIN_FIELD_NAME_GENERATED = "DOMAIN_FIELD_NAME_GENERATED".freeze - DOMAIN_FIELD_NAME_CREATION_DATE = "DOMAIN_FIELD_NAME_CREATION_DATE".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for InstanceServiceDomainFieldName. + class InstanceServiceDomainFieldName + DOMAIN_FIELD_NAME_UNSPECIFIED = 'DOMAIN_FIELD_NAME_UNSPECIFIED' + DOMAIN_FIELD_NAME_DOMAIN = 'DOMAIN_FIELD_NAME_DOMAIN' + DOMAIN_FIELD_NAME_PRIMARY = 'DOMAIN_FIELD_NAME_PRIMARY' + DOMAIN_FIELD_NAME_GENERATED = 'DOMAIN_FIELD_NAME_GENERATED' + DOMAIN_FIELD_NAME_CREATION_DATE = 'DOMAIN_FIELD_NAME_CREATION_DATE' - def self.all_vars - @all_vars ||= [DOMAIN_FIELD_NAME_UNSPECIFIED, DOMAIN_FIELD_NAME_DOMAIN, DOMAIN_FIELD_NAME_PRIMARY, DOMAIN_FIELD_NAME_GENERATED, DOMAIN_FIELD_NAME_CREATION_DATE].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [DOMAIN_FIELD_NAME_UNSPECIFIED, DOMAIN_FIELD_NAME_DOMAIN, DOMAIN_FIELD_NAME_PRIMARY, DOMAIN_FIELD_NAME_GENERATED, DOMAIN_FIELD_NAME_CREATION_DATE].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if InstanceServiceDomainFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::InstanceServiceDomainFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for InstanceServiceDomainFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/instance_service_domain_filter.rb b/lib/zitadel/client/models/instance_service_domain_filter.rb index 1920e3b7..860972ba 100644 --- a/lib/zitadel/client/models/instance_service_domain_filter.rb +++ b/lib/zitadel/client/models/instance_service_domain_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceDomainFilter - # The domain to filter for. - attr_accessor :domain - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain' => :'domain', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain' => :'String', - :'method' => :'InstanceServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceDomainFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceDomainFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain == o.domain && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceDomainFilter. + class InstanceServiceDomainFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain: 'domain', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain: 'String', + method: 'InstanceServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The domain to filter for. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_field_name.rb b/lib/zitadel/client/models/instance_service_field_name.rb index f3eb8199..b3065b6a 100644 --- a/lib/zitadel/client/models/instance_service_field_name.rb +++ b/lib/zitadel/client/models/instance_service_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class InstanceServiceFieldName - FIELD_NAME_UNSPECIFIED = "FIELD_NAME_UNSPECIFIED".freeze - FIELD_NAME_ID = "FIELD_NAME_ID".freeze - FIELD_NAME_NAME = "FIELD_NAME_NAME".freeze - FIELD_NAME_CREATION_DATE = "FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [FIELD_NAME_UNSPECIFIED, FIELD_NAME_ID, FIELD_NAME_NAME, FIELD_NAME_CREATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if InstanceServiceFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::InstanceServiceFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for InstanceServiceFieldName. + class InstanceServiceFieldName + FIELD_NAME_UNSPECIFIED = 'FIELD_NAME_UNSPECIFIED' + FIELD_NAME_ID = 'FIELD_NAME_ID' + FIELD_NAME_NAME = 'FIELD_NAME_NAME' + FIELD_NAME_CREATION_DATE = 'FIELD_NAME_CREATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [FIELD_NAME_UNSPECIFIED, FIELD_NAME_ID, FIELD_NAME_NAME, FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for InstanceServiceFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/instance_service_filter.rb b/lib/zitadel/client/models/instance_service_filter.rb index 6844ed53..091d84a3 100644 --- a/lib/zitadel/client/models/instance_service_filter.rb +++ b/lib/zitadel/client/models/instance_service_filter.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceFilter - attr_accessor :custom_domains_filter - - attr_accessor :in_ids_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'custom_domains_filter' => :'customDomainsFilter', - :'in_ids_filter' => :'inIdsFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'custom_domains_filter' => :'InstanceServiceCustomDomainsFilter', - :'in_ids_filter' => :'InstanceServiceInIDsFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'custom_domains_filter') - self.custom_domains_filter = attributes[:'custom_domains_filter'] - end - - if attributes.key?(:'in_ids_filter') - self.in_ids_filter = attributes[:'in_ids_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - custom_domains_filter == o.custom_domains_filter && - in_ids_filter == o.in_ids_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [custom_domains_filter, in_ids_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceFilter. + class InstanceServiceFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + custom_domains_filter: 'customDomainsFilter', + in_ids_filter: 'inIdsFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + custom_domains_filter: 'InstanceServiceCustomDomainsFilter', + in_ids_filter: 'InstanceServiceInIDsFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :custom_domains_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_ids_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_get_instance_request.rb b/lib/zitadel/client/models/instance_service_get_instance_request.rb index 263ef95a..7f29bbf9 100644 --- a/lib/zitadel/client/models/instance_service_get_instance_request.rb +++ b/lib/zitadel/client/models/instance_service_get_instance_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceGetInstanceRequest - # InstanceID is the unique ID of the instance to be retrieved. If not set, the instance in the current context (e.g. identified by the host header) will be returned. If an ID is set, the caller must have additional permissions. - attr_accessor :instance_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceGetInstanceRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceGetInstanceRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceGetInstanceRequest. + class InstanceServiceGetInstanceRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique ID of the instance to be retrieved. If not set, the instance in the current context (e.g. identified by the host header) will be returned. If an ID is set, the caller must have additional permissions. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_get_instance_response.rb b/lib/zitadel/client/models/instance_service_get_instance_response.rb index 0936ad65..d1ca07d6 100644 --- a/lib/zitadel/client/models/instance_service_get_instance_response.rb +++ b/lib/zitadel/client/models/instance_service_get_instance_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceGetInstanceResponse - attr_accessor :instance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance' => :'instance' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance' => :'InstanceServiceInstance' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceGetInstanceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceGetInstanceResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance == o.instance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceGetInstanceResponse. + class InstanceServiceGetInstanceResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance: 'instance' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance: 'InstanceServiceInstance' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_in_i_ds_filter.rb b/lib/zitadel/client/models/instance_service_in_i_ds_filter.rb deleted file mode 100644 index 77391bb0..00000000 --- a/lib/zitadel/client/models/instance_service_in_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class InstanceServiceInIDsFilter - # Defines the ids to query for. - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceInIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceInIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/instance_service_in_ids_filter.rb b/lib/zitadel/client/models/instance_service_in_ids_filter.rb new file mode 100644 index 00000000..75156117 --- /dev/null +++ b/lib/zitadel/client/models/instance_service_in_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceInIDsFilter. + class InstanceServiceInIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/instance_service_instance.rb b/lib/zitadel/client/models/instance_service_instance.rb index 33939054..8f365929 100644 --- a/lib/zitadel/client/models/instance_service_instance.rb +++ b/lib/zitadel/client/models/instance_service_instance.rb @@ -1,299 +1,103 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceInstance - # ID is the unique identifier of the instance. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :state - - # Name is the display name of the instance. This can be changed by the instance administrator. - attr_accessor :name - - # Version of the system the instance is running on. This is managed by the system and cannot be changed by the instance administrator. - attr_accessor :version - - # CustomDomains are the domains that are assigned to the instance. The list includes auto-generated and manually added domains. They are all unique across all instances in the system. They're used to route requests to the correct instance. - attr_accessor :custom_domains - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'change_date' => :'changeDate', - :'creation_date' => :'creationDate', - :'state' => :'state', - :'name' => :'name', - :'version' => :'version', - :'custom_domains' => :'customDomains' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'change_date' => :'Time', - :'creation_date' => :'Time', - :'state' => :'InstanceServiceState', - :'name' => :'String', - :'version' => :'String', - :'custom_domains' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceInstance` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceInstance`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'custom_domains') - if (value = attributes[:'custom_domains']).is_a?(Array) - self.custom_domains = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - change_date == o.change_date && - creation_date == o.creation_date && - state == o.state && - name == o.name && - version == o.version && - custom_domains == o.custom_domains - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, change_date, creation_date, state, name, version, custom_domains].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceInstance. + class InstanceServiceInstance < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + change_date: 'changeDate', + creation_date: 'creationDate', + state: 'state', + name: 'name', + version: 'version', + custom_domains: 'customDomains' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + change_date: 'Time', + creation_date: 'Time', + state: 'InstanceServiceState', + name: 'String', + version: 'String', + custom_domains: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the instance. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # Name is the display name of the instance. This can be changed by the instance administrator. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # Version of the system the instance is running on. This is managed by the system and cannot be changed by the instance administrator. + # @example null + attribute :version, Types::Any.optional.meta(omittable: true) + # CustomDomains are the domains that are assigned to the instance. The list includes auto-generated and manually added domains. They are all unique across all instances in the system. They're used to route requests to the correct instance. + # @example null + attribute :custom_domains, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_list_custom_domains_request.rb b/lib/zitadel/client/models/instance_service_list_custom_domains_request.rb index 47a61d44..69e8d8b0 100644 --- a/lib/zitadel/client/models/instance_service_list_custom_domains_request.rb +++ b/lib/zitadel/client/models/instance_service_list_custom_domains_request.rb @@ -1,268 +1,87 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceListCustomDomainsRequest - # InstanceID is the unique ID of the instance whose domains will be listed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions. - attr_accessor :instance_id - - attr_accessor :pagination - - attr_accessor :sorting_column - - # Filter the domains to be returned. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'pagination' => :'InstanceServicePaginationRequest', - :'sorting_column' => :'InstanceServiceDomainFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceListCustomDomainsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceListCustomDomainsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceListCustomDomainsRequest. + class InstanceServiceListCustomDomainsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + pagination: 'InstanceServicePaginationRequest', + sorting_column: 'InstanceServiceDomainFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique ID of the instance whose domains will be listed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Filter the domains to be returned. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_list_custom_domains_response.rb b/lib/zitadel/client/models/instance_service_list_custom_domains_response.rb index 821a38a8..11c48cb4 100644 --- a/lib/zitadel/client/models/instance_service_list_custom_domains_response.rb +++ b/lib/zitadel/client/models/instance_service_list_custom_domains_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceListCustomDomainsResponse - # The list of custom domains matching the query. - attr_accessor :domains - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domains' => :'domains', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domains' => :'Array', - :'pagination' => :'InstanceServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceListCustomDomainsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceListCustomDomainsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domains') - if (value = attributes[:'domains']).is_a?(Array) - self.domains = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domains == o.domains && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domains, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceListCustomDomainsResponse. + class InstanceServiceListCustomDomainsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domains: 'domains', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domains: 'Array', + pagination: 'InstanceServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The list of custom domains matching the query. + # @example null + attribute :domains, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_list_instances_request.rb b/lib/zitadel/client/models/instance_service_list_instances_request.rb index c233fb1a..0bc0c453 100644 --- a/lib/zitadel/client/models/instance_service_list_instances_request.rb +++ b/lib/zitadel/client/models/instance_service_list_instances_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceListInstancesRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Filter the instances to be returned. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'InstanceServicePaginationRequest', - :'sorting_column' => :'InstanceServiceFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceListInstancesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceListInstancesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceListInstancesRequest. + class InstanceServiceListInstancesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'InstanceServicePaginationRequest', + sorting_column: 'InstanceServiceFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Filter the instances to be returned. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_list_instances_response.rb b/lib/zitadel/client/models/instance_service_list_instances_response.rb index e7970a56..74b11949 100644 --- a/lib/zitadel/client/models/instance_service_list_instances_response.rb +++ b/lib/zitadel/client/models/instance_service_list_instances_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceListInstancesResponse - # The instances matching the query. - attr_accessor :instances - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instances' => :'instances', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instances' => :'Array', - :'pagination' => :'InstanceServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceListInstancesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceListInstancesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instances') - if (value = attributes[:'instances']).is_a?(Array) - self.instances = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instances == o.instances && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instances, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceListInstancesResponse. + class InstanceServiceListInstancesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instances: 'instances', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instances: 'Array', + pagination: 'InstanceServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The instances matching the query. + # @example null + attribute :instances, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_list_trusted_domains_request.rb b/lib/zitadel/client/models/instance_service_list_trusted_domains_request.rb index cd47ea70..e1f266f6 100644 --- a/lib/zitadel/client/models/instance_service_list_trusted_domains_request.rb +++ b/lib/zitadel/client/models/instance_service_list_trusted_domains_request.rb @@ -1,268 +1,87 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceListTrustedDomainsRequest - # InstanceID is the unique ID of the instance whose trusted domains will be listed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions. - attr_accessor :instance_id - - attr_accessor :pagination - - attr_accessor :sorting_column - - # Filter the domains to be returned. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'pagination' => :'InstanceServicePaginationRequest', - :'sorting_column' => :'InstanceServiceTrustedDomainFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceListTrustedDomainsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceListTrustedDomainsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceListTrustedDomainsRequest. + class InstanceServiceListTrustedDomainsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + pagination: 'InstanceServicePaginationRequest', + sorting_column: 'InstanceServiceTrustedDomainFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique ID of the instance whose trusted domains will be listed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Filter the domains to be returned. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_list_trusted_domains_response.rb b/lib/zitadel/client/models/instance_service_list_trusted_domains_response.rb index fdada7c3..bd6ed0c1 100644 --- a/lib/zitadel/client/models/instance_service_list_trusted_domains_response.rb +++ b/lib/zitadel/client/models/instance_service_list_trusted_domains_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceListTrustedDomainsResponse - # The list of trusted domains matching the query. - attr_accessor :trusted_domain - - attr_accessor :pagination - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'trusted_domain' => :'trustedDomain', - :'pagination' => :'pagination' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'trusted_domain' => :'Array', - :'pagination' => :'InstanceServicePaginationResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceListTrustedDomainsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceListTrustedDomainsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'trusted_domain') - if (value = attributes[:'trusted_domain']).is_a?(Array) - self.trusted_domain = value - end - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - trusted_domain == o.trusted_domain && - pagination == o.pagination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [trusted_domain, pagination].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceListTrustedDomainsResponse. + class InstanceServiceListTrustedDomainsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + trusted_domain: 'trustedDomain', + pagination: 'pagination' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + trusted_domain: 'Array', + pagination: 'InstanceServicePaginationResponse' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The list of trusted domains matching the query. + # @example null + attribute :trusted_domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_pagination_request.rb b/lib/zitadel/client/models/instance_service_pagination_request.rb index 671de470..78ea6d2d 100644 --- a/lib/zitadel/client/models/instance_service_pagination_request.rb +++ b/lib/zitadel/client/models/instance_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServicePaginationRequest. + class InstanceServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_pagination_response.rb b/lib/zitadel/client/models/instance_service_pagination_response.rb index ddb0e0c9..c2bbbc57 100644 --- a/lib/zitadel/client/models/instance_service_pagination_response.rb +++ b/lib/zitadel/client/models/instance_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServicePaginationResponse. + class InstanceServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_remove_custom_domain_request.rb b/lib/zitadel/client/models/instance_service_remove_custom_domain_request.rb index 508e652f..ea43c86d 100644 --- a/lib/zitadel/client/models/instance_service_remove_custom_domain_request.rb +++ b/lib/zitadel/client/models/instance_service_remove_custom_domain_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceRemoveCustomDomainRequest - # InstanceID is the unique ID of the instance from which the domain will be removed. - attr_accessor :instance_id - - # CustomDomain is the the domain to remove from the instance. - attr_accessor :custom_domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'custom_domain' => :'customDomain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'custom_domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceRemoveCustomDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceRemoveCustomDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'custom_domain') - self.custom_domain = attributes[:'custom_domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - custom_domain == o.custom_domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, custom_domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceRemoveCustomDomainRequest. + class InstanceServiceRemoveCustomDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + custom_domain: 'customDomain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + custom_domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique ID of the instance from which the domain will be removed. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # CustomDomain is the the domain to remove from the instance. + # @example null + attribute :custom_domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_remove_custom_domain_response.rb b/lib/zitadel/client/models/instance_service_remove_custom_domain_response.rb index 2b9e5de7..c851b9ea 100644 --- a/lib/zitadel/client/models/instance_service_remove_custom_domain_response.rb +++ b/lib/zitadel/client/models/instance_service_remove_custom_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceRemoveCustomDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceRemoveCustomDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceRemoveCustomDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceRemoveCustomDomainResponse. + class InstanceServiceRemoveCustomDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_remove_trusted_domain_request.rb b/lib/zitadel/client/models/instance_service_remove_trusted_domain_request.rb index 5629c4ec..2ee509c6 100644 --- a/lib/zitadel/client/models/instance_service_remove_trusted_domain_request.rb +++ b/lib/zitadel/client/models/instance_service_remove_trusted_domain_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceRemoveTrustedDomainRequest - # InstanceID is the unique ID of the instance from which the trusted domain will be removed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions. - attr_accessor :instance_id - - # The trusted domain to remove from the instance. - attr_accessor :trusted_domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'trusted_domain' => :'trustedDomain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'trusted_domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceRemoveTrustedDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceRemoveTrustedDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'trusted_domain') - self.trusted_domain = attributes[:'trusted_domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - trusted_domain == o.trusted_domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, trusted_domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceRemoveTrustedDomainRequest. + class InstanceServiceRemoveTrustedDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + trusted_domain: 'trustedDomain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + trusted_domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique ID of the instance from which the trusted domain will be removed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # The trusted domain to remove from the instance. + # @example null + attribute :trusted_domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_remove_trusted_domain_response.rb b/lib/zitadel/client/models/instance_service_remove_trusted_domain_response.rb index 4230186c..a8c08a75 100644 --- a/lib/zitadel/client/models/instance_service_remove_trusted_domain_response.rb +++ b/lib/zitadel/client/models/instance_service_remove_trusted_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceRemoveTrustedDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceRemoveTrustedDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceRemoveTrustedDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceRemoveTrustedDomainResponse. + class InstanceServiceRemoveTrustedDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_state.rb b/lib/zitadel/client/models/instance_service_state.rb index cb671669..31dff28b 100644 --- a/lib/zitadel/client/models/instance_service_state.rb +++ b/lib/zitadel/client/models/instance_service_state.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class InstanceServiceState - STATE_UNSPECIFIED = "STATE_UNSPECIFIED".freeze - STATE_CREATING = "STATE_CREATING".freeze - STATE_RUNNING = "STATE_RUNNING".freeze - STATE_STOPPING = "STATE_STOPPING".freeze - STATE_STOPPED = "STATE_STOPPED".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for InstanceServiceState. + class InstanceServiceState + STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' + STATE_CREATING = 'STATE_CREATING' + STATE_RUNNING = 'STATE_RUNNING' + STATE_STOPPING = 'STATE_STOPPING' + STATE_STOPPED = 'STATE_STOPPED' - def self.all_vars - @all_vars ||= [STATE_UNSPECIFIED, STATE_CREATING, STATE_RUNNING, STATE_STOPPING, STATE_STOPPED].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [STATE_UNSPECIFIED, STATE_CREATING, STATE_RUNNING, STATE_STOPPING, STATE_STOPPED].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if InstanceServiceState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::InstanceServiceState" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for InstanceServiceState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/instance_service_text_query_method.rb b/lib/zitadel/client/models/instance_service_text_query_method.rb index 40fdf4c8..fdf54a74 100644 --- a/lib/zitadel/client/models/instance_service_text_query_method.rb +++ b/lib/zitadel/client/models/instance_service_text_query_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class InstanceServiceTextQueryMethod - TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS".freeze - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH".freeze - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS".freeze - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH".freeze - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for InstanceServiceTextQueryMethod. + class InstanceServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' + TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' + TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if InstanceServiceTextQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::InstanceServiceTextQueryMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for InstanceServiceTextQueryMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/instance_service_trusted_domain.rb b/lib/zitadel/client/models/instance_service_trusted_domain.rb index 3bf4aa01..5f5e1041 100644 --- a/lib/zitadel/client/models/instance_service_trusted_domain.rb +++ b/lib/zitadel/client/models/instance_service_trusted_domain.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceTrustedDomain - # InstanceID is the unique identifier of the instance the domain belongs to. - attr_accessor :instance_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Domain is the fully qualified domain name. - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'creation_date' => :'creationDate', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'creation_date' => :'Time', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceTrustedDomain` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceTrustedDomain`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - creation_date == o.creation_date && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, creation_date, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceTrustedDomain. + class InstanceServiceTrustedDomain < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + creation_date: 'creationDate', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + creation_date: 'Time', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique identifier of the instance the domain belongs to. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # Domain is the fully qualified domain name. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/instance_service_trusted_domain_field_name.rb b/lib/zitadel/client/models/instance_service_trusted_domain_field_name.rb index 88f5051e..9b58da40 100644 --- a/lib/zitadel/client/models/instance_service_trusted_domain_field_name.rb +++ b/lib/zitadel/client/models/instance_service_trusted_domain_field_name.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class InstanceServiceTrustedDomainFieldName - TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED = "TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED".freeze - TRUSTED_DOMAIN_FIELD_NAME_DOMAIN = "TRUSTED_DOMAIN_FIELD_NAME_DOMAIN".freeze - TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE = "TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED, TRUSTED_DOMAIN_FIELD_NAME_DOMAIN, TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if InstanceServiceTrustedDomainFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::InstanceServiceTrustedDomainFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for InstanceServiceTrustedDomainFieldName. + class InstanceServiceTrustedDomainFieldName + TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED = 'TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED' + TRUSTED_DOMAIN_FIELD_NAME_DOMAIN = 'TRUSTED_DOMAIN_FIELD_NAME_DOMAIN' + TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE = 'TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED, TRUSTED_DOMAIN_FIELD_NAME_DOMAIN, TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for InstanceServiceTrustedDomainFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/instance_service_trusted_domain_filter.rb b/lib/zitadel/client/models/instance_service_trusted_domain_filter.rb index fc3902c1..7398b4a7 100644 --- a/lib/zitadel/client/models/instance_service_trusted_domain_filter.rb +++ b/lib/zitadel/client/models/instance_service_trusted_domain_filter.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceTrustedDomainFilter - attr_accessor :domain_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain_filter' => :'domainFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain_filter' => :'InstanceServiceDomainFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceTrustedDomainFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceTrustedDomainFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain_filter') - self.domain_filter = attributes[:'domain_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain_filter == o.domain_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceTrustedDomainFilter. + class InstanceServiceTrustedDomainFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain_filter: 'domainFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain_filter: 'InstanceServiceDomainFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_update_instance_request.rb b/lib/zitadel/client/models/instance_service_update_instance_request.rb index b81394f9..b90804e4 100644 --- a/lib/zitadel/client/models/instance_service_update_instance_request.rb +++ b/lib/zitadel/client/models/instance_service_update_instance_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceUpdateInstanceRequest - # InstanceID is the unique ID of the instance to be updated. If not set, the instance in the current context (e.g. identified by the host header) will be changed. If an ID is set, the caller must have additional permissions. - attr_accessor :instance_id - - # InstanceName is the new name of the instance to be set. - attr_accessor :instance_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance_id' => :'instanceId', - :'instance_name' => :'instanceName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance_id' => :'String', - :'instance_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceUpdateInstanceRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceUpdateInstanceRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance_id') - self.instance_id = attributes[:'instance_id'] - end - - if attributes.key?(:'instance_name') - self.instance_name = attributes[:'instance_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance_id == o.instance_id && - instance_name == o.instance_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance_id, instance_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceUpdateInstanceRequest. + class InstanceServiceUpdateInstanceRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance_id: 'instanceId', + instance_name: 'instanceName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance_id: 'String', + instance_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # InstanceID is the unique ID of the instance to be updated. If not set, the instance in the current context (e.g. identified by the host header) will be changed. If an ID is set, the caller must have additional permissions. + # @example null + attribute :instance_id, Types::Any.optional.meta(omittable: true) + # InstanceName is the new name of the instance to be set. + # @example null + attribute :instance_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/instance_service_update_instance_response.rb b/lib/zitadel/client/models/instance_service_update_instance_response.rb index 188c7fee..01fc80fe 100644 --- a/lib/zitadel/client/models/instance_service_update_instance_response.rb +++ b/lib/zitadel/client/models/instance_service_update_instance_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InstanceServiceUpdateInstanceResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InstanceServiceUpdateInstanceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InstanceServiceUpdateInstanceResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InstanceServiceUpdateInstanceResponse. + class InstanceServiceUpdateInstanceResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_administrator.rb b/lib/zitadel/client/models/internal_permission_service_administrator.rb index 72ac8621..3fda8ba1 100644 --- a/lib/zitadel/client/models/internal_permission_service_administrator.rb +++ b/lib/zitadel/client/models/internal_permission_service_administrator.rb @@ -1,284 +1,105 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceAdministrator - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :user - - # Roles are the roles that were granted to the user for the specified resource. - attr_accessor :roles - - # Instance is returned if the administrator roles were granted on the instance level. - attr_accessor :instance - - attr_accessor :organization - - attr_accessor :project - - attr_accessor :project_grant - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'user' => :'user', - :'roles' => :'roles', - :'instance' => :'instance', - :'organization' => :'organization', - :'project' => :'project', - :'project_grant' => :'projectGrant' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'user' => :'InternalPermissionServiceUser', - :'roles' => :'Array', - :'instance' => :'Boolean', - :'organization' => :'InternalPermissionServiceOrganization', - :'project' => :'InternalPermissionServiceProject', - :'project_grant' => :'InternalPermissionServiceProjectGrant' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceAdministrator` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceAdministrator`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'organization') - self.organization = attributes[:'organization'] - end - - if attributes.key?(:'project') - self.project = attributes[:'project'] - end - - if attributes.key?(:'project_grant') - self.project_grant = attributes[:'project_grant'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - change_date == o.change_date && - user == o.user && - roles == o.roles && - instance == o.instance && - organization == o.organization && - project == o.project && - project_grant == o.project_grant - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, change_date, user, roles, instance, organization, project, project_grant].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceAdministrator. + class InternalPermissionServiceAdministrator < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + change_date: 'changeDate', + user: 'user', + roles: 'roles', + instance: 'instance', + organization: 'organization', + project: 'project', + project_grant: 'projectGrant' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + change_date: 'Time', + user: 'InternalPermissionServiceUser', + roles: 'Array', + instance: 'Boolean', + organization: 'InternalPermissionServiceOrganization', + project: 'InternalPermissionServiceProject', + project_grant: 'InternalPermissionServiceProjectGrant' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + # Roles are the roles that were granted to the user for the specified resource. + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) + # Instance is returned if the administrator roles were granted on the instance level. + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grant, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_administrator_field_name.rb b/lib/zitadel/client/models/internal_permission_service_administrator_field_name.rb index 89eff509..91f89e3b 100644 --- a/lib/zitadel/client/models/internal_permission_service_administrator_field_name.rb +++ b/lib/zitadel/client/models/internal_permission_service_administrator_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class InternalPermissionServiceAdministratorFieldName - ADMINISTRATOR_FIELD_NAME_UNSPECIFIED = "ADMINISTRATOR_FIELD_NAME_UNSPECIFIED".freeze - ADMINISTRATOR_FIELD_NAME_USER_ID = "ADMINISTRATOR_FIELD_NAME_USER_ID".freeze - ADMINISTRATOR_FIELD_NAME_CREATION_DATE = "ADMINISTRATOR_FIELD_NAME_CREATION_DATE".freeze - ADMINISTRATOR_FIELD_NAME_CHANGE_DATE = "ADMINISTRATOR_FIELD_NAME_CHANGE_DATE".freeze - - def self.all_vars - @all_vars ||= [ADMINISTRATOR_FIELD_NAME_UNSPECIFIED, ADMINISTRATOR_FIELD_NAME_USER_ID, ADMINISTRATOR_FIELD_NAME_CREATION_DATE, ADMINISTRATOR_FIELD_NAME_CHANGE_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if InternalPermissionServiceAdministratorFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::InternalPermissionServiceAdministratorFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for InternalPermissionServiceAdministratorFieldName. + class InternalPermissionServiceAdministratorFieldName + ADMINISTRATOR_FIELD_NAME_UNSPECIFIED = 'ADMINISTRATOR_FIELD_NAME_UNSPECIFIED' + ADMINISTRATOR_FIELD_NAME_USER_ID = 'ADMINISTRATOR_FIELD_NAME_USER_ID' + ADMINISTRATOR_FIELD_NAME_CREATION_DATE = 'ADMINISTRATOR_FIELD_NAME_CREATION_DATE' + ADMINISTRATOR_FIELD_NAME_CHANGE_DATE = 'ADMINISTRATOR_FIELD_NAME_CHANGE_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [ADMINISTRATOR_FIELD_NAME_UNSPECIFIED, ADMINISTRATOR_FIELD_NAME_USER_ID, ADMINISTRATOR_FIELD_NAME_CREATION_DATE, ADMINISTRATOR_FIELD_NAME_CHANGE_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for InternalPermissionServiceAdministratorFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/internal_permission_service_administrator_search_filter.rb b/lib/zitadel/client/models/internal_permission_service_administrator_search_filter.rb index 21e7aef8..35b182ae 100644 --- a/lib/zitadel/client/models/internal_permission_service_administrator_search_filter.rb +++ b/lib/zitadel/client/models/internal_permission_service_administrator_search_filter.rb @@ -1,305 +1,113 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceAdministratorSearchFilter - attr_accessor :_and - - attr_accessor :change_date - - attr_accessor :creation_date - - attr_accessor :in_user_ids_filter - - attr_accessor :_not - - attr_accessor :_or - - attr_accessor :resource - - attr_accessor :role - - attr_accessor :user_display_name - - attr_accessor :user_organization_id - - attr_accessor :user_preferred_login_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'_and' => :'and', - :'change_date' => :'changeDate', - :'creation_date' => :'creationDate', - :'in_user_ids_filter' => :'inUserIdsFilter', - :'_not' => :'not', - :'_or' => :'or', - :'resource' => :'resource', - :'role' => :'role', - :'user_display_name' => :'userDisplayName', - :'user_organization_id' => :'userOrganizationId', - :'user_preferred_login_name' => :'userPreferredLoginName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'_and' => :'InternalPermissionServiceAndFilter', - :'change_date' => :'InternalPermissionServiceTimestampFilter', - :'creation_date' => :'InternalPermissionServiceTimestampFilter', - :'in_user_ids_filter' => :'InternalPermissionServiceInIDsFilter', - :'_not' => :'InternalPermissionServiceNotFilter', - :'_or' => :'InternalPermissionServiceOrFilter', - :'resource' => :'InternalPermissionServiceResourceFilter', - :'role' => :'InternalPermissionServiceRoleFilter', - :'user_display_name' => :'InternalPermissionServiceUserDisplayNameFilter', - :'user_organization_id' => :'InternalPermissionServiceIDFilter', - :'user_preferred_login_name' => :'InternalPermissionServiceUserPreferredLoginNameFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceAdministratorSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceAdministratorSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'_and') - self._and = attributes[:'_and'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'in_user_ids_filter') - self.in_user_ids_filter = attributes[:'in_user_ids_filter'] - end - - if attributes.key?(:'_not') - self._not = attributes[:'_not'] - end - - if attributes.key?(:'_or') - self._or = attributes[:'_or'] - end - - if attributes.key?(:'resource') - self.resource = attributes[:'resource'] - end - - if attributes.key?(:'role') - self.role = attributes[:'role'] - end - - if attributes.key?(:'user_display_name') - self.user_display_name = attributes[:'user_display_name'] - end - - if attributes.key?(:'user_organization_id') - self.user_organization_id = attributes[:'user_organization_id'] - end - - if attributes.key?(:'user_preferred_login_name') - self.user_preferred_login_name = attributes[:'user_preferred_login_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - _and == o._and && - change_date == o.change_date && - creation_date == o.creation_date && - in_user_ids_filter == o.in_user_ids_filter && - _not == o._not && - _or == o._or && - resource == o.resource && - role == o.role && - user_display_name == o.user_display_name && - user_organization_id == o.user_organization_id && - user_preferred_login_name == o.user_preferred_login_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [_and, change_date, creation_date, in_user_ids_filter, _not, _or, resource, role, user_display_name, user_organization_id, user_preferred_login_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceAdministratorSearchFilter. + class InternalPermissionServiceAdministratorSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + _and: 'and', + change_date: 'changeDate', + creation_date: 'creationDate', + in_user_ids_filter: 'inUserIdsFilter', + _not: 'not', + _or: 'or', + resource: 'resource', + role: 'role', + user_display_name: 'userDisplayName', + user_organization_id: 'userOrganizationId', + user_preferred_login_name: 'userPreferredLoginName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + _and: 'InternalPermissionServiceAndFilter', + change_date: 'InternalPermissionServiceTimestampFilter', + creation_date: 'InternalPermissionServiceTimestampFilter', + in_user_ids_filter: 'InternalPermissionServiceInIDsFilter', + _not: 'InternalPermissionServiceNotFilter', + _or: 'InternalPermissionServiceOrFilter', + resource: 'InternalPermissionServiceResourceFilter', + role: 'InternalPermissionServiceRoleFilter', + user_display_name: 'InternalPermissionServiceUserDisplayNameFilter', + user_organization_id: 'InternalPermissionServiceIDFilter', + user_preferred_login_name: 'InternalPermissionServiceUserPreferredLoginNameFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :_and, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_user_ids_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :_not, Types::Any.optional.meta(omittable: true) + # @example null + attribute :_or, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource, Types::Any.optional.meta(omittable: true) + # @example null + attribute :role, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_preferred_login_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_and_filter.rb b/lib/zitadel/client/models/internal_permission_service_and_filter.rb index 35a1a5b1..eed26e14 100644 --- a/lib/zitadel/client/models/internal_permission_service_and_filter.rb +++ b/lib/zitadel/client/models/internal_permission_service_and_filter.rb @@ -1,217 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceAndFilter - attr_accessor :queries - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceAndFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceAndFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceAndFilter. + class InternalPermissionServiceAndFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_any.rb b/lib/zitadel/client/models/internal_permission_service_any.rb index 327a346e..549ffbc3 100644 --- a/lib/zitadel/client/models/internal_permission_service_any.rb +++ b/lib/zitadel/client/models/internal_permission_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class InternalPermissionServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class InternalPermissionServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_connect_error.rb b/lib/zitadel/client/models/internal_permission_service_connect_error.rb index dd2999f1..bb614438 100644 --- a/lib/zitadel/client/models/internal_permission_service_connect_error.rb +++ b/lib/zitadel/client/models/internal_permission_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class InternalPermissionServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class InternalPermissionServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_create_administrator_request.rb b/lib/zitadel/client/models/internal_permission_service_create_administrator_request.rb index 77cddfdb..c7b481c4 100644 --- a/lib/zitadel/client/models/internal_permission_service_create_administrator_request.rb +++ b/lib/zitadel/client/models/internal_permission_service_create_administrator_request.rb @@ -1,237 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceCreateAdministratorRequest - # UserID is the ID of the user who should be granted the administrator role. - attr_accessor :user_id - - attr_accessor :resource - - # Roles are the roles that should be granted to the user for the specified resource. Note that roles are currently specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. - attr_accessor :roles - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'resource' => :'resource', - :'roles' => :'roles' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'resource' => :'InternalPermissionServiceResourceType', - :'roles' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceCreateAdministratorRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceCreateAdministratorRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'resource') - self.resource = attributes[:'resource'] - end - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - resource == o.resource && - roles == o.roles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, resource, roles].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceCreateAdministratorRequest. + class InternalPermissionServiceCreateAdministratorRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + resource: 'resource', + roles: 'roles' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + resource: 'InternalPermissionServiceResourceType', + roles: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # UserID is the ID of the user who should be granted the administrator role. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource, Types::Any.optional.meta(omittable: true) + # Roles are the roles that should be granted to the user for the specified resource. Note that roles are currently specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_create_administrator_response.rb b/lib/zitadel/client/models/internal_permission_service_create_administrator_response.rb index 49ff5339..7e3a65de 100644 --- a/lib/zitadel/client/models/internal_permission_service_create_administrator_response.rb +++ b/lib/zitadel/client/models/internal_permission_service_create_administrator_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceCreateAdministratorResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceCreateAdministratorResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceCreateAdministratorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceCreateAdministratorResponse. + class InternalPermissionServiceCreateAdministratorResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_delete_administrator_request.rb b/lib/zitadel/client/models/internal_permission_service_delete_administrator_request.rb index c4d78576..7c170aa9 100644 --- a/lib/zitadel/client/models/internal_permission_service_delete_administrator_request.rb +++ b/lib/zitadel/client/models/internal_permission_service_delete_administrator_request.rb @@ -1,225 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceDeleteAdministratorRequest - # UserID is the ID of the user whose administrator roles should be removed. - attr_accessor :user_id - - attr_accessor :resource - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'resource' => :'resource' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'resource' => :'InternalPermissionServiceResourceType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceDeleteAdministratorRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceDeleteAdministratorRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'resource') - self.resource = attributes[:'resource'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - resource == o.resource - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, resource].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceDeleteAdministratorRequest. + class InternalPermissionServiceDeleteAdministratorRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + resource: 'resource' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + resource: 'InternalPermissionServiceResourceType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # UserID is the ID of the user whose administrator roles should be removed. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_delete_administrator_response.rb b/lib/zitadel/client/models/internal_permission_service_delete_administrator_response.rb index e2ac3f4e..4752f169 100644 --- a/lib/zitadel/client/models/internal_permission_service_delete_administrator_response.rb +++ b/lib/zitadel/client/models/internal_permission_service_delete_administrator_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceDeleteAdministratorResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceDeleteAdministratorResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceDeleteAdministratorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceDeleteAdministratorResponse. + class InternalPermissionServiceDeleteAdministratorResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_i_d_filter.rb b/lib/zitadel/client/models/internal_permission_service_i_d_filter.rb deleted file mode 100644 index f2d070cd..00000000 --- a/lib/zitadel/client/models/internal_permission_service_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceIDFilter - # Only return resources that belong to this id. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/internal_permission_service_id_filter.rb b/lib/zitadel/client/models/internal_permission_service_id_filter.rb new file mode 100644 index 00000000..fa3a6485 --- /dev/null +++ b/lib/zitadel/client/models/internal_permission_service_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceIDFilter. + class InternalPermissionServiceIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Only return resources that belong to this id. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/internal_permission_service_in_i_ds_filter.rb b/lib/zitadel/client/models/internal_permission_service_in_i_ds_filter.rb deleted file mode 100644 index c18b24e6..00000000 --- a/lib/zitadel/client/models/internal_permission_service_in_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceInIDsFilter - # Defines the ids to query for. - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceInIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceInIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/internal_permission_service_in_ids_filter.rb b/lib/zitadel/client/models/internal_permission_service_in_ids_filter.rb new file mode 100644 index 00000000..14e2ef9c --- /dev/null +++ b/lib/zitadel/client/models/internal_permission_service_in_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceInIDsFilter. + class InternalPermissionServiceInIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/internal_permission_service_list_administrators_request.rb b/lib/zitadel/client/models/internal_permission_service_list_administrators_request.rb index 9286409b..f2edbbc8 100644 --- a/lib/zitadel/client/models/internal_permission_service_list_administrators_request.rb +++ b/lib/zitadel/client/models/internal_permission_service_list_administrators_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceListAdministratorsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Filter the administrator roles to be returned. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'InternalPermissionServicePaginationRequest', - :'sorting_column' => :'InternalPermissionServiceAdministratorFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceListAdministratorsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceListAdministratorsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceListAdministratorsRequest. + class InternalPermissionServiceListAdministratorsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'InternalPermissionServicePaginationRequest', + sorting_column: 'InternalPermissionServiceAdministratorFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Filter the administrator roles to be returned. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_list_administrators_response.rb b/lib/zitadel/client/models/internal_permission_service_list_administrators_response.rb index 66860eeb..61180c80 100644 --- a/lib/zitadel/client/models/internal_permission_service_list_administrators_response.rb +++ b/lib/zitadel/client/models/internal_permission_service_list_administrators_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceListAdministratorsResponse - attr_accessor :pagination - - # Administrators contains the list of administrators matching the request. - attr_accessor :administrators - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'administrators' => :'administrators' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'InternalPermissionServicePaginationResponse', - :'administrators' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceListAdministratorsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceListAdministratorsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'administrators') - if (value = attributes[:'administrators']).is_a?(Array) - self.administrators = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - administrators == o.administrators - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, administrators].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceListAdministratorsResponse. + class InternalPermissionServiceListAdministratorsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + administrators: 'administrators' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'InternalPermissionServicePaginationResponse', + administrators: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Administrators contains the list of administrators matching the request. + # @example null + attribute :administrators, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_not_filter.rb b/lib/zitadel/client/models/internal_permission_service_not_filter.rb index 687c7ca0..62c73d79 100644 --- a/lib/zitadel/client/models/internal_permission_service_not_filter.rb +++ b/lib/zitadel/client/models/internal_permission_service_not_filter.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceNotFilter - attr_accessor :query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'query' => :'query' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'query' => :'InternalPermissionServiceAdministratorSearchFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceNotFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceNotFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - query == o.query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceNotFilter. + class InternalPermissionServiceNotFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + query: 'query' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + query: 'InternalPermissionServiceAdministratorSearchFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_or_filter.rb b/lib/zitadel/client/models/internal_permission_service_or_filter.rb index 7d71a027..f79c5bd3 100644 --- a/lib/zitadel/client/models/internal_permission_service_or_filter.rb +++ b/lib/zitadel/client/models/internal_permission_service_or_filter.rb @@ -1,217 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceOrFilter - attr_accessor :queries - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceOrFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceOrFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceOrFilter. + class InternalPermissionServiceOrFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_organization.rb b/lib/zitadel/client/models/internal_permission_service_organization.rb index 0deb676f..2d882155 100644 --- a/lib/zitadel/client/models/internal_permission_service_organization.rb +++ b/lib/zitadel/client/models/internal_permission_service_organization.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceOrganization - # ID is the unique identifier of the organization the user was granted the administrator role for. - attr_accessor :id - - # Name is the name of the organization the user was granted the administrator role for. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceOrganization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceOrganization. + class InternalPermissionServiceOrganization < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the organization the user was granted the administrator role for. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Name is the name of the organization the user was granted the administrator role for. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_pagination_request.rb b/lib/zitadel/client/models/internal_permission_service_pagination_request.rb index cbc0bf81..b18effc5 100644 --- a/lib/zitadel/client/models/internal_permission_service_pagination_request.rb +++ b/lib/zitadel/client/models/internal_permission_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServicePaginationRequest. + class InternalPermissionServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_pagination_response.rb b/lib/zitadel/client/models/internal_permission_service_pagination_response.rb index 591c3826..1106ae5b 100644 --- a/lib/zitadel/client/models/internal_permission_service_pagination_response.rb +++ b/lib/zitadel/client/models/internal_permission_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServicePaginationResponse. + class InternalPermissionServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_project.rb b/lib/zitadel/client/models/internal_permission_service_project.rb index e1048d34..10d5648b 100644 --- a/lib/zitadel/client/models/internal_permission_service_project.rb +++ b/lib/zitadel/client/models/internal_permission_service_project.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceProject - # ID is the unique identifier of the project the user was granted the administrator role for. - attr_accessor :id - - # Name is the name of the project the user was granted the administrator role for. - attr_accessor :name - - # OrganizationID is the ID of the organization the project belongs to. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceProject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceProject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceProject. + class InternalPermissionServiceProject < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the project the user was granted the administrator role for. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # Name is the name of the project the user was granted the administrator role for. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # OrganizationID is the ID of the organization the project belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_project_grant.rb b/lib/zitadel/client/models/internal_permission_service_project_grant.rb index 999e1d0f..c6db2de8 100644 --- a/lib/zitadel/client/models/internal_permission_service_project_grant.rb +++ b/lib/zitadel/client/models/internal_permission_service_project_grant.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceProjectGrant - # ProjectID is the unique identifier of the project the project grant belongs to. - attr_accessor :project_id - - # OrganizationID is the unique identifier of the organization the project was granted to and on which the administrator role should be granted. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceProjectGrant` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceProjectGrant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceProjectGrant. + class InternalPermissionServiceProjectGrant < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project the project grant belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # OrganizationID is the unique identifier of the organization the project was granted to and on which the administrator role should be granted. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_resource_filter.rb b/lib/zitadel/client/models/internal_permission_service_resource_filter.rb index 7327f123..04a3499c 100644 --- a/lib/zitadel/client/models/internal_permission_service_resource_filter.rb +++ b/lib/zitadel/client/models/internal_permission_service_resource_filter.rb @@ -1,245 +1,88 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceResourceFilter - # Search for administrators granted on the instance level. - attr_accessor :instance - - # Search for administrators granted on a specific organization. - attr_accessor :organization_id - - attr_accessor :project_grant - - # Search for administrators granted on a specific project. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance' => :'instance', - :'organization_id' => :'organizationId', - :'project_grant' => :'projectGrant', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance' => :'Boolean', - :'organization_id' => :'String', - :'project_grant' => :'InternalPermissionServiceProjectGrant', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceResourceFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceResourceFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'project_grant') - self.project_grant = attributes[:'project_grant'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance == o.instance && - organization_id == o.organization_id && - project_grant == o.project_grant && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance, organization_id, project_grant, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceResourceFilter. + class InternalPermissionServiceResourceFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance: 'instance', + organization_id: 'organizationId', + project_grant: 'projectGrant', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance: 'Boolean', + organization_id: 'String', + project_grant: 'InternalPermissionServiceProjectGrant', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Search for administrators granted on the instance level. + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # Search for administrators granted on a specific organization. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grant, Types::Any.optional.meta(omittable: true) + # Search for administrators granted on a specific project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_resource_type.rb b/lib/zitadel/client/models/internal_permission_service_resource_type.rb index 3b1e2f39..1af5f0dd 100644 --- a/lib/zitadel/client/models/internal_permission_service_resource_type.rb +++ b/lib/zitadel/client/models/internal_permission_service_resource_type.rb @@ -1,245 +1,88 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceResourceType - # Instance is the resource type for granting administrator privileges on the instance level. - attr_accessor :instance - - # OrganizationID is required to grant administrator privileges for a specific organization. - attr_accessor :organization_id - - attr_accessor :project_grant - - # ProjectID is required to grant administrator privileges for a specific project. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance' => :'instance', - :'organization_id' => :'organizationId', - :'project_grant' => :'projectGrant', - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance' => :'Boolean', - :'organization_id' => :'String', - :'project_grant' => :'InternalPermissionServiceProjectGrant', - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceResourceType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceResourceType`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'project_grant') - self.project_grant = attributes[:'project_grant'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance == o.instance && - organization_id == o.organization_id && - project_grant == o.project_grant && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance, organization_id, project_grant, project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceResourceType. + class InternalPermissionServiceResourceType < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance: 'instance', + organization_id: 'organizationId', + project_grant: 'projectGrant', + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance: 'Boolean', + organization_id: 'String', + project_grant: 'InternalPermissionServiceProjectGrant', + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Instance is the resource type for granting administrator privileges on the instance level. + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # OrganizationID is required to grant administrator privileges for a specific organization. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_grant, Types::Any.optional.meta(omittable: true) + # ProjectID is required to grant administrator privileges for a specific project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_role_filter.rb b/lib/zitadel/client/models/internal_permission_service_role_filter.rb index e467dd25..009e3af8 100644 --- a/lib/zitadel/client/models/internal_permission_service_role_filter.rb +++ b/lib/zitadel/client/models/internal_permission_service_role_filter.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceRoleFilter - # Search for administrators by the granted role. - attr_accessor :role_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'role_key' => :'roleKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'role_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceRoleFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceRoleFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - role_key == o.role_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [role_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceRoleFilter. + class InternalPermissionServiceRoleFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + role_key: 'roleKey' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + role_key: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Search for administrators by the granted role. + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_text_filter_method.rb b/lib/zitadel/client/models/internal_permission_service_text_filter_method.rb index d23d846e..dff44936 100644 --- a/lib/zitadel/client/models/internal_permission_service_text_filter_method.rb +++ b/lib/zitadel/client/models/internal_permission_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class InternalPermissionServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for InternalPermissionServiceTextFilterMethod. + class InternalPermissionServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if InternalPermissionServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::InternalPermissionServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for InternalPermissionServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/internal_permission_service_timestamp_filter.rb b/lib/zitadel/client/models/internal_permission_service_timestamp_filter.rb index 8fd6dcb2..0a109eb8 100644 --- a/lib/zitadel/client/models/internal_permission_service_timestamp_filter.rb +++ b/lib/zitadel/client/models/internal_permission_service_timestamp_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceTimestampFilter - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'timestamp' => :'timestamp', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'timestamp' => :'Time', - :'method' => :'InternalPermissionServiceTimestampFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceTimestampFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceTimestampFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - timestamp == o.timestamp && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [timestamp, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceTimestampFilter. + class InternalPermissionServiceTimestampFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + timestamp: 'timestamp', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + timestamp: 'Time', + method: 'InternalPermissionServiceTimestampFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_timestamp_filter_method.rb b/lib/zitadel/client/models/internal_permission_service_timestamp_filter_method.rb index 023a4d45..ade10972 100644 --- a/lib/zitadel/client/models/internal_permission_service_timestamp_filter_method.rb +++ b/lib/zitadel/client/models/internal_permission_service_timestamp_filter_method.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class InternalPermissionServiceTimestampFilterMethod - TIMESTAMP_FILTER_METHOD_EQUALS = "TIMESTAMP_FILTER_METHOD_EQUALS".freeze - TIMESTAMP_FILTER_METHOD_AFTER = "TIMESTAMP_FILTER_METHOD_AFTER".freeze - TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS".freeze - TIMESTAMP_FILTER_METHOD_BEFORE = "TIMESTAMP_FILTER_METHOD_BEFORE".freeze - TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for InternalPermissionServiceTimestampFilterMethod. + class InternalPermissionServiceTimestampFilterMethod + TIMESTAMP_FILTER_METHOD_EQUALS = 'TIMESTAMP_FILTER_METHOD_EQUALS' + TIMESTAMP_FILTER_METHOD_AFTER = 'TIMESTAMP_FILTER_METHOD_AFTER' + TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS' + TIMESTAMP_FILTER_METHOD_BEFORE = 'TIMESTAMP_FILTER_METHOD_BEFORE' + TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS' - def self.all_vars - @all_vars ||= [TIMESTAMP_FILTER_METHOD_EQUALS, TIMESTAMP_FILTER_METHOD_AFTER, TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS, TIMESTAMP_FILTER_METHOD_BEFORE, TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [TIMESTAMP_FILTER_METHOD_EQUALS, TIMESTAMP_FILTER_METHOD_AFTER, TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS, TIMESTAMP_FILTER_METHOD_BEFORE, TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if InternalPermissionServiceTimestampFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::InternalPermissionServiceTimestampFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for InternalPermissionServiceTimestampFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/internal_permission_service_update_administrator_request.rb b/lib/zitadel/client/models/internal_permission_service_update_administrator_request.rb index ab1558e3..19e828a5 100644 --- a/lib/zitadel/client/models/internal_permission_service_update_administrator_request.rb +++ b/lib/zitadel/client/models/internal_permission_service_update_administrator_request.rb @@ -1,237 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceUpdateAdministratorRequest - # UserID is the ID of the user whose administrator roles should be updated. - attr_accessor :user_id - - attr_accessor :resource - - # Roles are the roles that the user should be granted. Note that any role previously granted to the user and not present in the list will be revoked. - attr_accessor :roles - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'resource' => :'resource', - :'roles' => :'roles' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'resource' => :'InternalPermissionServiceResourceType', - :'roles' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceUpdateAdministratorRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceUpdateAdministratorRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'resource') - self.resource = attributes[:'resource'] - end - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - resource == o.resource && - roles == o.roles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, resource, roles].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceUpdateAdministratorRequest. + class InternalPermissionServiceUpdateAdministratorRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + resource: 'resource', + roles: 'roles' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + resource: 'InternalPermissionServiceResourceType', + roles: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # UserID is the ID of the user whose administrator roles should be updated. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource, Types::Any.optional.meta(omittable: true) + # Roles are the roles that the user should be granted. Note that any role previously granted to the user and not present in the list will be revoked. + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_update_administrator_response.rb b/lib/zitadel/client/models/internal_permission_service_update_administrator_response.rb index 58ca8796..f2a054be 100644 --- a/lib/zitadel/client/models/internal_permission_service_update_administrator_response.rb +++ b/lib/zitadel/client/models/internal_permission_service_update_administrator_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceUpdateAdministratorResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceUpdateAdministratorResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceUpdateAdministratorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceUpdateAdministratorResponse. + class InternalPermissionServiceUpdateAdministratorResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_user.rb b/lib/zitadel/client/models/internal_permission_service_user.rb index 4665104e..4d88ac34 100644 --- a/lib/zitadel/client/models/internal_permission_service_user.rb +++ b/lib/zitadel/client/models/internal_permission_service_user.rb @@ -1,246 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceUser - # ID is the unique identifier of the user. - attr_accessor :id - - # PreferredLoginName is the preferred login name of the user. This value is unique across the whole instance. - attr_accessor :preferred_login_name - - # DisplayName is the public display name of the user. By default it's the user's given name and family name, their username or their email address. - attr_accessor :display_name - - # The organization the user belong to. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'preferred_login_name' => :'preferredLoginName', - :'display_name' => :'displayName', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'preferred_login_name' => :'String', - :'display_name' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - preferred_login_name == o.preferred_login_name && - display_name == o.display_name && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, preferred_login_name, display_name, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceUser. + class InternalPermissionServiceUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + preferred_login_name: 'preferredLoginName', + display_name: 'displayName', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + preferred_login_name: 'String', + display_name: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the user. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # PreferredLoginName is the preferred login name of the user. This value is unique across the whole instance. + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # DisplayName is the public display name of the user. By default it's the user's given name and family name, their username or their email address. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # The organization the user belong to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_user_display_name_filter.rb b/lib/zitadel/client/models/internal_permission_service_user_display_name_filter.rb index 7c58fb63..ca11409b 100644 --- a/lib/zitadel/client/models/internal_permission_service_user_display_name_filter.rb +++ b/lib/zitadel/client/models/internal_permission_service_user_display_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceUserDisplayNameFilter - # Search for administrators by the display name of the user. - attr_accessor :display_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name' => :'displayName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name' => :'String', - :'method' => :'InternalPermissionServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceUserDisplayNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceUserDisplayNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name == o.display_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceUserDisplayNameFilter. + class InternalPermissionServiceUserDisplayNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name: 'displayName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name: 'String', + method: 'InternalPermissionServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Search for administrators by the display name of the user. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/internal_permission_service_user_preferred_login_name_filter.rb b/lib/zitadel/client/models/internal_permission_service_user_preferred_login_name_filter.rb index f84695ac..10ab6ea9 100644 --- a/lib/zitadel/client/models/internal_permission_service_user_preferred_login_name_filter.rb +++ b/lib/zitadel/client/models/internal_permission_service_user_preferred_login_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class InternalPermissionServiceUserPreferredLoginNameFilter - # Search for administrators by the preferred login name of the user. - attr_accessor :preferred_login_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'preferred_login_name' => :'preferredLoginName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'preferred_login_name' => :'String', - :'method' => :'InternalPermissionServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::InternalPermissionServiceUserPreferredLoginNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::InternalPermissionServiceUserPreferredLoginNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - preferred_login_name == o.preferred_login_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [preferred_login_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for InternalPermissionServiceUserPreferredLoginNameFilter. + class InternalPermissionServiceUserPreferredLoginNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + preferred_login_name: 'preferredLoginName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + preferred_login_name: 'String', + method: 'InternalPermissionServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Search for administrators by the preferred login name of the user. + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/o_i_d_c_service_any.rb b/lib/zitadel/client/models/o_i_d_c_service_any.rb deleted file mode 100644 index 49195257..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_any.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class OIDCServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_auth_request.rb b/lib/zitadel/client/models/o_i_d_c_service_auth_request.rb deleted file mode 100644 index 2c60e767..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_auth_request.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # AuthRequest represents an OpenID Connect Authorization Request as defined in https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest - class OIDCServiceAuthRequest - # The unique identifier of the authorization request. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # The OAuth2/OIDC client_id of the application that initiated the authorization request. - attr_accessor :client_id - - # The scopes by the application that the user must consent to. - attr_accessor :scope - - # The redirect_uri used in the authorization request. This must exactly match one of the redirect URIs registered for the client. This uri is used to send the authorization code or tokens back to the application. - attr_accessor :redirect_uri - - # Prompts that must be displayed to the user. - attr_accessor :prompt - - # End-User's preferred languages and scripts for the user interface, represented as a list of BCP47 [RFC5646] language tag values, ordered by preference. For instance, the value [fr-CA, fr, en] represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation). An error SHOULD NOT result if some or all of the requested locales are not supported. - attr_accessor :ui_locales - - # Login hint can be set by the application with a user identifier such as an email or phone number. - attr_accessor :login_hint - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :max_age - - # User ID taken from a ID Token Hint if it was present and valid. - attr_accessor :hint_user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'client_id' => :'clientId', - :'scope' => :'scope', - :'redirect_uri' => :'redirectUri', - :'prompt' => :'prompt', - :'ui_locales' => :'uiLocales', - :'login_hint' => :'loginHint', - :'max_age' => :'maxAge', - :'hint_user_id' => :'hintUserId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'client_id' => :'String', - :'scope' => :'Array', - :'redirect_uri' => :'String', - :'prompt' => :'Array', - :'ui_locales' => :'Array', - :'login_hint' => :'String', - :'max_age' => :'String', - :'hint_user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'login_hint', - :'hint_user_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceAuthRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceAuthRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'scope') - if (value = attributes[:'scope']).is_a?(Array) - self.scope = value - end - end - - if attributes.key?(:'redirect_uri') - self.redirect_uri = attributes[:'redirect_uri'] - end - - if attributes.key?(:'prompt') - if (value = attributes[:'prompt']).is_a?(Array) - self.prompt = value - end - end - - if attributes.key?(:'ui_locales') - if (value = attributes[:'ui_locales']).is_a?(Array) - self.ui_locales = value - end - end - - if attributes.key?(:'login_hint') - self.login_hint = attributes[:'login_hint'] - end - - if attributes.key?(:'max_age') - self.max_age = attributes[:'max_age'] - end - - if attributes.key?(:'hint_user_id') - self.hint_user_id = attributes[:'hint_user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - client_id == o.client_id && - scope == o.scope && - redirect_uri == o.redirect_uri && - prompt == o.prompt && - ui_locales == o.ui_locales && - login_hint == o.login_hint && - max_age == o.max_age && - hint_user_id == o.hint_user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, client_id, scope, redirect_uri, prompt, ui_locales, login_hint, max_age, hint_user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_authorization_error.rb b/lib/zitadel/client/models/o_i_d_c_service_authorization_error.rb deleted file mode 100644 index e9c0a7d0..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_authorization_error.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceAuthorizationError - attr_accessor :error - - attr_accessor :error_description - - attr_accessor :error_uri - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error' => :'error', - :'error_description' => :'errorDescription', - :'error_uri' => :'errorUri' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error' => :'OIDCServiceErrorReason', - :'error_description' => :'String', - :'error_uri' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error_description', - :'error_uri' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceAuthorizationError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceAuthorizationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'error_description') - self.error_description = attributes[:'error_description'] - end - - if attributes.key?(:'error_uri') - self.error_uri = attributes[:'error_uri'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error == o.error && - error_description == o.error_description && - error_uri == o.error_uri - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error, error_description, error_uri].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_authorize_or_deny_device_authorization_request.rb b/lib/zitadel/client/models/o_i_d_c_service_authorize_or_deny_device_authorization_request.rb deleted file mode 100644 index ea38d49a..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_authorize_or_deny_device_authorization_request.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest - # The device authorization id returned when submitting the user code. - attr_accessor :device_authorization_id - - attr_accessor :deny - - attr_accessor :session - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'device_authorization_id' => :'deviceAuthorizationId', - :'deny' => :'deny', - :'session' => :'session' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'device_authorization_id' => :'String', - :'deny' => :'Object', - :'session' => :'OIDCServiceSession' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'device_authorization_id') - self.device_authorization_id = attributes[:'device_authorization_id'] - end - - if attributes.key?(:'deny') - self.deny = attributes[:'deny'] - end - - if attributes.key?(:'session') - self.session = attributes[:'session'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - device_authorization_id == o.device_authorization_id && - deny == o.deny && - session == o.session - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [device_authorization_id, deny, session].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_connect_error.rb b/lib/zitadel/client/models/o_i_d_c_service_connect_error.rb deleted file mode 100644 index f59e5318..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_connect_error.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class OIDCServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_create_callback_request.rb b/lib/zitadel/client/models/o_i_d_c_service_create_callback_request.rb deleted file mode 100644 index cf261413..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_create_callback_request.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceCreateCallbackRequest - # The ID of the Auth Request to finalize. - attr_accessor :auth_request_id - - attr_accessor :error - - attr_accessor :session - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_request_id' => :'authRequestId', - :'error' => :'error', - :'session' => :'session' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_request_id' => :'String', - :'error' => :'OIDCServiceAuthorizationError', - :'session' => :'OIDCServiceSession' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceCreateCallbackRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceCreateCallbackRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_request_id') - self.auth_request_id = attributes[:'auth_request_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'session') - self.session = attributes[:'session'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_request_id == o.auth_request_id && - error == o.error && - session == o.session - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_request_id, error, session].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_create_callback_response.rb b/lib/zitadel/client/models/o_i_d_c_service_create_callback_response.rb deleted file mode 100644 index cf68ddd8..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_create_callback_response.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceCreateCallbackResponse - attr_accessor :details - - # The callback URL where the user should be redirected using an HTTP \"302 FOUND\" status. This contains details for the application to obtain the tokens on success, or error details on failure. Note that this field must be treated as credentials, as the contained code can be used to obtain tokens on behalf of the user.\" - attr_accessor :callback_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'callback_url' => :'callbackUrl' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'OIDCServiceDetails', - :'callback_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceCreateCallbackResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceCreateCallbackResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'callback_url') - self.callback_url = attributes[:'callback_url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - callback_url == o.callback_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, callback_url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_details.rb b/lib/zitadel/client/models/o_i_d_c_service_details.rb deleted file mode 100644 index 1c5d548a..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_details.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_device_authorization_request.rb b/lib/zitadel/client/models/o_i_d_c_service_device_authorization_request.rb deleted file mode 100644 index de4f14b1..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_device_authorization_request.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceDeviceAuthorizationRequest - # The unique identifier of the device authorization request to be used for authorizing or denying the request. - attr_accessor :id - - # The client_id of the application that initiated the device authorization request. - attr_accessor :client_id - - # The scopes requested by the application. - attr_accessor :scope - - # Name of the client application. - attr_accessor :app_name - - # Name of the project the client application is part of. - attr_accessor :project_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'client_id' => :'clientId', - :'scope' => :'scope', - :'app_name' => :'appName', - :'project_name' => :'projectName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'client_id' => :'String', - :'scope' => :'Array', - :'app_name' => :'String', - :'project_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceDeviceAuthorizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceDeviceAuthorizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'scope') - if (value = attributes[:'scope']).is_a?(Array) - self.scope = value - end - end - - if attributes.key?(:'app_name') - self.app_name = attributes[:'app_name'] - end - - if attributes.key?(:'project_name') - self.project_name = attributes[:'project_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - client_id == o.client_id && - scope == o.scope && - app_name == o.app_name && - project_name == o.project_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, client_id, scope, app_name, project_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_error_reason.rb b/lib/zitadel/client/models/o_i_d_c_service_error_reason.rb deleted file mode 100644 index 332af046..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_error_reason.rb +++ /dev/null @@ -1,56 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceErrorReason - ERROR_REASON_UNSPECIFIED = "ERROR_REASON_UNSPECIFIED".freeze - ERROR_REASON_INVALID_REQUEST = "ERROR_REASON_INVALID_REQUEST".freeze - ERROR_REASON_UNAUTHORIZED_CLIENT = "ERROR_REASON_UNAUTHORIZED_CLIENT".freeze - ERROR_REASON_ACCESS_DENIED = "ERROR_REASON_ACCESS_DENIED".freeze - ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE = "ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE".freeze - ERROR_REASON_INVALID_SCOPE = "ERROR_REASON_INVALID_SCOPE".freeze - ERROR_REASON_SERVER_ERROR = "ERROR_REASON_SERVER_ERROR".freeze - ERROR_REASON_TEMPORARY_UNAVAILABLE = "ERROR_REASON_TEMPORARY_UNAVAILABLE".freeze - ERROR_REASON_INTERACTION_REQUIRED = "ERROR_REASON_INTERACTION_REQUIRED".freeze - ERROR_REASON_LOGIN_REQUIRED = "ERROR_REASON_LOGIN_REQUIRED".freeze - ERROR_REASON_ACCOUNT_SELECTION_REQUIRED = "ERROR_REASON_ACCOUNT_SELECTION_REQUIRED".freeze - ERROR_REASON_CONSENT_REQUIRED = "ERROR_REASON_CONSENT_REQUIRED".freeze - ERROR_REASON_INVALID_REQUEST_URI = "ERROR_REASON_INVALID_REQUEST_URI".freeze - ERROR_REASON_INVALID_REQUEST_OBJECT = "ERROR_REASON_INVALID_REQUEST_OBJECT".freeze - ERROR_REASON_REQUEST_NOT_SUPPORTED = "ERROR_REASON_REQUEST_NOT_SUPPORTED".freeze - ERROR_REASON_REQUEST_URI_NOT_SUPPORTED = "ERROR_REASON_REQUEST_URI_NOT_SUPPORTED".freeze - ERROR_REASON_REGISTRATION_NOT_SUPPORTED = "ERROR_REASON_REGISTRATION_NOT_SUPPORTED".freeze - - def self.all_vars - @all_vars ||= [ERROR_REASON_UNSPECIFIED, ERROR_REASON_INVALID_REQUEST, ERROR_REASON_UNAUTHORIZED_CLIENT, ERROR_REASON_ACCESS_DENIED, ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE, ERROR_REASON_INVALID_SCOPE, ERROR_REASON_SERVER_ERROR, ERROR_REASON_TEMPORARY_UNAVAILABLE, ERROR_REASON_INTERACTION_REQUIRED, ERROR_REASON_LOGIN_REQUIRED, ERROR_REASON_ACCOUNT_SELECTION_REQUIRED, ERROR_REASON_CONSENT_REQUIRED, ERROR_REASON_INVALID_REQUEST_URI, ERROR_REASON_INVALID_REQUEST_OBJECT, ERROR_REASON_REQUEST_NOT_SUPPORTED, ERROR_REASON_REQUEST_URI_NOT_SUPPORTED, ERROR_REASON_REGISTRATION_NOT_SUPPORTED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OIDCServiceErrorReason.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OIDCServiceErrorReason" - end - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_get_auth_request_request.rb b/lib/zitadel/client/models/o_i_d_c_service_get_auth_request_request.rb deleted file mode 100644 index 84a5c29d..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_get_auth_request_request.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceGetAuthRequestRequest - # The ID of the Auth Request, as obtained from the redirect URL. - attr_accessor :auth_request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_request_id' => :'authRequestId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceGetAuthRequestRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceGetAuthRequestRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_request_id') - self.auth_request_id = attributes[:'auth_request_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_request_id == o.auth_request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_request_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_get_auth_request_response.rb b/lib/zitadel/client/models/o_i_d_c_service_get_auth_request_response.rb deleted file mode 100644 index c89639e7..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_get_auth_request_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceGetAuthRequestResponse - attr_accessor :auth_request - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_request' => :'authRequest' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_request' => :'OIDCServiceAuthRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceGetAuthRequestResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceGetAuthRequestResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_request') - self.auth_request = attributes[:'auth_request'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_request == o.auth_request - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_request].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_get_device_authorization_request_request.rb b/lib/zitadel/client/models/o_i_d_c_service_get_device_authorization_request_request.rb deleted file mode 100644 index cc280cbd..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_get_device_authorization_request_request.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceGetDeviceAuthorizationRequestRequest - # The user_code returned by the device authorization request and provided to the user by the device. - attr_accessor :user_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_code' => :'userCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceGetDeviceAuthorizationRequestRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceGetDeviceAuthorizationRequestRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_code') - self.user_code = attributes[:'user_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_code == o.user_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_get_device_authorization_request_response.rb b/lib/zitadel/client/models/o_i_d_c_service_get_device_authorization_request_response.rb deleted file mode 100644 index fc94a41a..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_get_device_authorization_request_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceGetDeviceAuthorizationRequestResponse - attr_accessor :device_authorization_request - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'device_authorization_request' => :'deviceAuthorizationRequest' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'device_authorization_request' => :'OIDCServiceDeviceAuthorizationRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceGetDeviceAuthorizationRequestResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceGetDeviceAuthorizationRequestResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'device_authorization_request') - self.device_authorization_request = attributes[:'device_authorization_request'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - device_authorization_request == o.device_authorization_request - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [device_authorization_request].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_prompt.rb b/lib/zitadel/client/models/o_i_d_c_service_prompt.rb deleted file mode 100644 index 2d5598c8..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_prompt.rb +++ /dev/null @@ -1,45 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServicePrompt - PROMPT_UNSPECIFIED = "PROMPT_UNSPECIFIED".freeze - PROMPT_NONE = "PROMPT_NONE".freeze - PROMPT_LOGIN = "PROMPT_LOGIN".freeze - PROMPT_CONSENT = "PROMPT_CONSENT".freeze - PROMPT_SELECT_ACCOUNT = "PROMPT_SELECT_ACCOUNT".freeze - PROMPT_CREATE = "PROMPT_CREATE".freeze - - def self.all_vars - @all_vars ||= [PROMPT_UNSPECIFIED, PROMPT_NONE, PROMPT_LOGIN, PROMPT_CONSENT, PROMPT_SELECT_ACCOUNT, PROMPT_CREATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OIDCServicePrompt.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OIDCServicePrompt" - end - end - -end diff --git a/lib/zitadel/client/models/o_i_d_c_service_session.rb b/lib/zitadel/client/models/o_i_d_c_service_session.rb deleted file mode 100644 index c11f666d..00000000 --- a/lib/zitadel/client/models/o_i_d_c_service_session.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OIDCServiceSession - # ID of the session, used to login the user. Connects the session to the Auth Request. - attr_accessor :session_id - - # Token of the session used to login the user. This token verifies that the session is valid. - attr_accessor :session_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'session_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OIDCServiceSession` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OIDCServiceSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - session_token == o.session_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, session_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/oidc_service_any.rb b/lib/zitadel/client/models/oidc_service_any.rb new file mode 100644 index 00000000..9bc50ebb --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_any.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class OIDCServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_auth_request.rb b/lib/zitadel/client/models/oidc_service_auth_request.rb new file mode 100644 index 00000000..95dffdab --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_auth_request.rb @@ -0,0 +1,119 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # AuthRequest represents an OpenID Connect Authorization Request as defined in https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest + class OIDCServiceAuthRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + client_id: 'clientId', + scope: 'scope', + redirect_uri: 'redirectUri', + prompt: 'prompt', + ui_locales: 'uiLocales', + login_hint: 'loginHint', + max_age: 'maxAge', + hint_user_id: 'hintUserId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + client_id: 'String', + scope: 'Array', + redirect_uri: 'String', + prompt: 'Array', + ui_locales: 'Array', + login_hint: 'String', + max_age: 'ISO8601::Duration', + hint_user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The unique identifier of the authorization request. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # The OAuth2/OIDC client_id of the application that initiated the authorization request. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # The scopes by the application that the user must consent to. + # @example null + attribute :scope, Types::Any.optional.meta(omittable: true) + # The redirect_uri used in the authorization request. This must exactly match one of the redirect URIs registered for the client. This uri is used to send the authorization code or tokens back to the application. + # @example null + attribute :redirect_uri, Types::Any.optional.meta(omittable: true) + # Prompts that must be displayed to the user. + # @example null + attribute :prompt, Types::Any.optional.meta(omittable: true) + # End-User's preferred languages and scripts for the user interface, represented as a list of BCP47 [RFC5646] language tag values, ordered by preference. For instance, the value [fr-CA, fr, en] represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation). An error SHOULD NOT result if some or all of the requested locales are not supported. + # @example null + attribute :ui_locales, Types::Any.optional.meta(omittable: true) + # Login hint can be set by the application with a user identifier such as an email or phone number. + # @example null + attribute :login_hint, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :max_age, Types::Any.optional.meta(omittable: true) + # User ID taken from a ID Token Hint if it was present and valid. + # @example null + attribute :hint_user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_authorization_error.rb b/lib/zitadel/client/models/oidc_service_authorization_error.rb new file mode 100644 index 00000000..79e6cca7 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_authorization_error.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceAuthorizationError. + class OIDCServiceAuthorizationError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + error: 'error', + error_description: 'errorDescription', + error_uri: 'errorUri' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + error: 'OIDCServiceErrorReason', + error_description: 'String', + error_uri: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :error_description, Types::Any.optional.meta(omittable: true) + # @example null + attribute :error_uri, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rb b/lib/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rb new file mode 100644 index 00000000..2b96cdc7 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest. + class OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + device_authorization_id: 'deviceAuthorizationId', + deny: 'deny', + session: 'session' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + device_authorization_id: 'String', + deny: 'Object', + session: 'OIDCServiceSession' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The device authorization id returned when submitting the user code. + # @example null + attribute :device_authorization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :deny, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_connect_error.rb b/lib/zitadel/client/models/oidc_service_connect_error.rb new file mode 100644 index 00000000..6dba9c31 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_connect_error.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class OIDCServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_create_callback_request.rb b/lib/zitadel/client/models/oidc_service_create_callback_request.rb new file mode 100644 index 00000000..46388797 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_create_callback_request.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceCreateCallbackRequest. + class OIDCServiceCreateCallbackRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_request_id: 'authRequestId', + error: 'error', + session: 'session' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_request_id: 'String', + error: 'OIDCServiceAuthorizationError', + session: 'OIDCServiceSession' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The ID of the Auth Request to finalize. + # @example null + attribute :auth_request_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_create_callback_response.rb b/lib/zitadel/client/models/oidc_service_create_callback_response.rb new file mode 100644 index 00000000..dd7edf37 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_create_callback_response.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceCreateCallbackResponse. + class OIDCServiceCreateCallbackResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + callback_url: 'callbackUrl' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'OIDCServiceDetails', + callback_url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # The callback URL where the user should be redirected using an HTTP \"302 FOUND\" status. This contains details for the application to obtain the tokens on success, or error details on failure. Note that this field must be treated as credentials, as the contained code can be used to obtain tokens on behalf of the user.\" + # @example null + attribute :callback_url, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_details.rb b/lib/zitadel/client/models/oidc_service_details.rb new file mode 100644 index 00000000..a9862467 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_details.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceDetails. + class OIDCServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_device_authorization_request.rb b/lib/zitadel/client/models/oidc_service_device_authorization_request.rb new file mode 100644 index 00000000..ee120889 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_device_authorization_request.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceDeviceAuthorizationRequest. + class OIDCServiceDeviceAuthorizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + client_id: 'clientId', + scope: 'scope', + app_name: 'appName', + project_name: 'projectName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + client_id: 'String', + scope: 'Array', + app_name: 'String', + project_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The unique identifier of the device authorization request to be used for authorizing or denying the request. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # The client_id of the application that initiated the device authorization request. + # @example null + attribute :client_id, Types::Any.optional.meta(omittable: true) + # The scopes requested by the application. + # @example null + attribute :scope, Types::Any.optional.meta(omittable: true) + # Name of the client application. + # @example null + attribute :app_name, Types::Any.optional.meta(omittable: true) + # Name of the project the client application is part of. + # @example null + attribute :project_name, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_error_reason.rb b/lib/zitadel/client/models/oidc_service_error_reason.rb new file mode 100644 index 00000000..66bd2c66 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_error_reason.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for OIDCServiceErrorReason. + class OIDCServiceErrorReason + ERROR_REASON_UNSPECIFIED = 'ERROR_REASON_UNSPECIFIED' + ERROR_REASON_INVALID_REQUEST = 'ERROR_REASON_INVALID_REQUEST' + ERROR_REASON_UNAUTHORIZED_CLIENT = 'ERROR_REASON_UNAUTHORIZED_CLIENT' + ERROR_REASON_ACCESS_DENIED = 'ERROR_REASON_ACCESS_DENIED' + ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE = 'ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE' + ERROR_REASON_INVALID_SCOPE = 'ERROR_REASON_INVALID_SCOPE' + ERROR_REASON_SERVER_ERROR = 'ERROR_REASON_SERVER_ERROR' + ERROR_REASON_TEMPORARY_UNAVAILABLE = 'ERROR_REASON_TEMPORARY_UNAVAILABLE' + ERROR_REASON_INTERACTION_REQUIRED = 'ERROR_REASON_INTERACTION_REQUIRED' + ERROR_REASON_LOGIN_REQUIRED = 'ERROR_REASON_LOGIN_REQUIRED' + ERROR_REASON_ACCOUNT_SELECTION_REQUIRED = 'ERROR_REASON_ACCOUNT_SELECTION_REQUIRED' + ERROR_REASON_CONSENT_REQUIRED = 'ERROR_REASON_CONSENT_REQUIRED' + ERROR_REASON_INVALID_REQUEST_URI = 'ERROR_REASON_INVALID_REQUEST_URI' + ERROR_REASON_INVALID_REQUEST_OBJECT = 'ERROR_REASON_INVALID_REQUEST_OBJECT' + ERROR_REASON_REQUEST_NOT_SUPPORTED = 'ERROR_REASON_REQUEST_NOT_SUPPORTED' + ERROR_REASON_REQUEST_URI_NOT_SUPPORTED = 'ERROR_REASON_REQUEST_URI_NOT_SUPPORTED' + ERROR_REASON_REGISTRATION_NOT_SUPPORTED = 'ERROR_REASON_REGISTRATION_NOT_SUPPORTED' + + # Frozen set of all allowed values, used for validation. + VALUES = [ERROR_REASON_UNSPECIFIED, ERROR_REASON_INVALID_REQUEST, ERROR_REASON_UNAUTHORIZED_CLIENT, ERROR_REASON_ACCESS_DENIED, ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE, ERROR_REASON_INVALID_SCOPE, ERROR_REASON_SERVER_ERROR, ERROR_REASON_TEMPORARY_UNAVAILABLE, ERROR_REASON_INTERACTION_REQUIRED, ERROR_REASON_LOGIN_REQUIRED, ERROR_REASON_ACCOUNT_SELECTION_REQUIRED, ERROR_REASON_CONSENT_REQUIRED, ERROR_REASON_INVALID_REQUEST_URI, ERROR_REASON_INVALID_REQUEST_OBJECT, ERROR_REASON_REQUEST_NOT_SUPPORTED, ERROR_REASON_REQUEST_URI_NOT_SUPPORTED, ERROR_REASON_REGISTRATION_NOT_SUPPORTED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for OIDCServiceErrorReason: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_get_auth_request_request.rb b/lib/zitadel/client/models/oidc_service_get_auth_request_request.rb new file mode 100644 index 00000000..455a9264 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_get_auth_request_request.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceGetAuthRequestRequest. + class OIDCServiceGetAuthRequestRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_request_id: 'authRequestId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_request_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The ID of the Auth Request, as obtained from the redirect URL. + # @example null + attribute :auth_request_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_get_auth_request_response.rb b/lib/zitadel/client/models/oidc_service_get_auth_request_response.rb new file mode 100644 index 00000000..da35d782 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_get_auth_request_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceGetAuthRequestResponse. + class OIDCServiceGetAuthRequestResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + auth_request: 'authRequest' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + auth_request: 'OIDCServiceAuthRequest' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :auth_request, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_get_device_authorization_request_request.rb b/lib/zitadel/client/models/oidc_service_get_device_authorization_request_request.rb new file mode 100644 index 00000000..31443d80 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_get_device_authorization_request_request.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceGetDeviceAuthorizationRequestRequest. + class OIDCServiceGetDeviceAuthorizationRequestRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_code: 'userCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The user_code returned by the device authorization request and provided to the user by the device. + # @example null + attribute :user_code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_get_device_authorization_request_response.rb b/lib/zitadel/client/models/oidc_service_get_device_authorization_request_response.rb new file mode 100644 index 00000000..557ee162 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_get_device_authorization_request_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceGetDeviceAuthorizationRequestResponse. + class OIDCServiceGetDeviceAuthorizationRequestResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + device_authorization_request: 'deviceAuthorizationRequest' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + device_authorization_request: 'OIDCServiceDeviceAuthorizationRequest' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :device_authorization_request, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_prompt.rb b/lib/zitadel/client/models/oidc_service_prompt.rb new file mode 100644 index 00000000..3064d90b --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_prompt.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for OIDCServicePrompt. + class OIDCServicePrompt + PROMPT_UNSPECIFIED = 'PROMPT_UNSPECIFIED' + PROMPT_NONE = 'PROMPT_NONE' + PROMPT_LOGIN = 'PROMPT_LOGIN' + PROMPT_CONSENT = 'PROMPT_CONSENT' + PROMPT_SELECT_ACCOUNT = 'PROMPT_SELECT_ACCOUNT' + PROMPT_CREATE = 'PROMPT_CREATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROMPT_UNSPECIFIED, PROMPT_NONE, PROMPT_LOGIN, PROMPT_CONSENT, PROMPT_SELECT_ACCOUNT, PROMPT_CREATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for OIDCServicePrompt: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/oidc_service_session.rb b/lib/zitadel/client/models/oidc_service_session.rb new file mode 100644 index 00000000..e913b5d8 --- /dev/null +++ b/lib/zitadel/client/models/oidc_service_session.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OIDCServiceSession. + class OIDCServiceSession < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session_id: 'sessionId', + session_token: 'sessionToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session_id: 'String', + session_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # ID of the session, used to login the user. Connects the session to the Auth Request. + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # Token of the session used to login the user. This token verifies that the session is valid. + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/organization_service_activate_organization_request.rb b/lib/zitadel/client/models/organization_service_activate_organization_request.rb index 92615c2e..ff28188a 100644 --- a/lib/zitadel/client/models/organization_service_activate_organization_request.rb +++ b/lib/zitadel/client/models/organization_service_activate_organization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceActivateOrganizationRequest - # OrganizationID is the unique identifier of the organization to be activated. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceActivateOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceActivateOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceActivateOrganizationRequest. + class OrganizationServiceActivateOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization to be activated. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_activate_organization_response.rb b/lib/zitadel/client/models/organization_service_activate_organization_response.rb index a606ee08..a09222b9 100644 --- a/lib/zitadel/client/models/organization_service_activate_organization_response.rb +++ b/lib/zitadel/client/models/organization_service_activate_organization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceActivateOrganizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceActivateOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceActivateOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceActivateOrganizationResponse. + class OrganizationServiceActivateOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_add_human_user_request.rb b/lib/zitadel/client/models/organization_service_add_human_user_request.rb index 76b8fb92..6cc70d4e 100644 --- a/lib/zitadel/client/models/organization_service_add_human_user_request.rb +++ b/lib/zitadel/client/models/organization_service_add_human_user_request.rb @@ -1,315 +1,116 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceAddHumanUserRequest - # optionally set your own id unique for the user. - attr_accessor :user_id - - # optionally set a unique username, if none is provided the email will be used. - attr_accessor :username - - attr_accessor :organization - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - attr_accessor :metadata - - attr_accessor :idp_links - - # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. - attr_accessor :totp_secret - - attr_accessor :hashed_password - - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'username' => :'username', - :'organization' => :'organization', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'metadata' => :'metadata', - :'idp_links' => :'idpLinks', - :'totp_secret' => :'totpSecret', - :'hashed_password' => :'hashedPassword', - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'username' => :'String', - :'organization' => :'OrganizationServiceOrganization', - :'profile' => :'OrganizationServiceSetHumanProfile', - :'email' => :'OrganizationServiceSetHumanEmail', - :'phone' => :'OrganizationServiceSetHumanPhone', - :'metadata' => :'Array', - :'idp_links' => :'Array', - :'totp_secret' => :'String', - :'hashed_password' => :'OrganizationServiceHashedPassword', - :'password' => :'OrganizationServicePassword' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user_id', - :'username', - :'totp_secret', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAddHumanUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAddHumanUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'organization') - self.organization = attributes[:'organization'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - - if attributes.key?(:'idp_links') - if (value = attributes[:'idp_links']).is_a?(Array) - self.idp_links = value - end - end - - if attributes.key?(:'totp_secret') - self.totp_secret = attributes[:'totp_secret'] - end - - if attributes.key?(:'hashed_password') - self.hashed_password = attributes[:'hashed_password'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - username == o.username && - organization == o.organization && - profile == o.profile && - email == o.email && - phone == o.phone && - metadata == o.metadata && - idp_links == o.idp_links && - totp_secret == o.totp_secret && - hashed_password == o.hashed_password && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, username, organization, profile, email, phone, metadata, idp_links, totp_secret, hashed_password, password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceAddHumanUserRequest. + class OrganizationServiceAddHumanUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + username: 'username', + organization: 'organization', + profile: 'profile', + email: 'email', + phone: 'phone', + metadata: 'metadata', + idp_links: 'idpLinks', + totp_secret: 'totpSecret', + hashed_password: 'hashedPassword', + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + username: 'String', + organization: 'OrganizationServiceOrganization', + profile: 'OrganizationServiceSetHumanProfile', + email: 'OrganizationServiceSetHumanEmail', + phone: 'OrganizationServiceSetHumanPhone', + metadata: 'Array', + idp_links: 'Array', + totp_secret: 'String', + hashed_password: 'OrganizationServiceHashedPassword', + password: 'OrganizationServicePassword' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # optionally set your own id unique for the user. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # optionally set a unique username, if none is provided the email will be used. + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization, Types::Any.optional.meta(omittable: true) + # @example null + attribute :profile, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_links, Types::Any.optional.meta(omittable: true) + # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. + # @example null + attribute :totp_secret, Types::Any.optional.meta(omittable: true) + # @example null + attribute :hashed_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_add_organization_domain_request.rb b/lib/zitadel/client/models/organization_service_add_organization_domain_request.rb index 6a2cfecb..340ee03b 100644 --- a/lib/zitadel/client/models/organization_service_add_organization_domain_request.rb +++ b/lib/zitadel/client/models/organization_service_add_organization_domain_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceAddOrganizationDomainRequest - # OrganizationID is the unique identifier of the organization to which the domain is to be added. - attr_accessor :organization_id - - # Domain is the full qualified domain name to be added to the organization. Note that the domain has to be unique across the instance. Depending on the settings, you might have to verify the domain before it can be used. - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAddOrganizationDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAddOrganizationDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceAddOrganizationDomainRequest. + class OrganizationServiceAddOrganizationDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization to which the domain is to be added. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Domain is the full qualified domain name to be added to the organization. Note that the domain has to be unique across the instance. Depending on the settings, you might have to verify the domain before it can be used. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_add_organization_domain_response.rb b/lib/zitadel/client/models/organization_service_add_organization_domain_response.rb index c2658ddd..528bec90 100644 --- a/lib/zitadel/client/models/organization_service_add_organization_domain_response.rb +++ b/lib/zitadel/client/models/organization_service_add_organization_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceAddOrganizationDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAddOrganizationDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAddOrganizationDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceAddOrganizationDomainResponse. + class OrganizationServiceAddOrganizationDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_add_organization_request.rb b/lib/zitadel/client/models/organization_service_add_organization_request.rb index ed4937f2..9a4395d9 100644 --- a/lib/zitadel/client/models/organization_service_add_organization_request.rb +++ b/lib/zitadel/client/models/organization_service_add_organization_request.rb @@ -1,250 +1,90 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceAddOrganizationRequest - # Name is the unique name of the organization to be created. This must be unique across the instance. - attr_accessor :name - - # Specify users to be assigned as organization admins. If no users are specified here, the organization will be created without any admin users. The organization can still be managed by any instance administrator. If no roles are specified for a user, they will be assigned the role ORG_OWNER. - attr_accessor :admins - - # OrganizationID is the unique identifier of the organization. This field is optional. If omitted, the system will generate one, which is the recommended way. The generated ID will be returned in the response. - attr_accessor :organization_id - - # Optionally, set a unique id for the organization. If omitted, the system will generate one, which is the recommended way. The generated ID will be returned in the response. Deprecated: use 'organization_id' field instead. If both org_id and organization_id are set, organization_id will take precedence. - attr_accessor :org_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'admins' => :'admins', - :'organization_id' => :'organizationId', - :'org_id' => :'orgId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'admins' => :'Array', - :'organization_id' => :'String', - :'org_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'organization_id', - :'org_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAddOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAddOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'admins') - if (value = attributes[:'admins']).is_a?(Array) - self.admins = value - end - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - admins == o.admins && - organization_id == o.organization_id && - org_id == o.org_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, admins, organization_id, org_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceAddOrganizationRequest. + class OrganizationServiceAddOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + admins: 'admins', + organization_id: 'organizationId', + org_id: 'orgId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + admins: 'Array', + organization_id: 'String', + org_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Name is the unique name of the organization to be created. This must be unique across the instance. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # Specify users to be assigned as organization admins. If no users are specified here, the organization will be created without any admin users. The organization can still be managed by any instance administrator. If no roles are specified for a user, they will be assigned the role ORG_OWNER. + # @example null + attribute :admins, Types::Any.optional.meta(omittable: true) + # OrganizationID is the unique identifier of the organization. This field is optional. If omitted, the system will generate one, which is the recommended way. The generated ID will be returned in the response. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Optionally, set a unique id for the organization. If omitted, the system will generate one, which is the recommended way. The generated ID will be returned in the response. Deprecated: use 'organization_id' field instead. If both org_id and organization_id are set, organization_id will take precedence. + # @example null + # @deprecated This property is deprecated. + attribute :org_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_add_organization_response.rb b/lib/zitadel/client/models/organization_service_add_organization_response.rb index 6ba679d5..dc4c726e 100644 --- a/lib/zitadel/client/models/organization_service_add_organization_response.rb +++ b/lib/zitadel/client/models/organization_service_add_organization_response.rb @@ -1,235 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceAddOrganizationResponse - attr_accessor :details - - attr_accessor :organization_id - - attr_accessor :created_admins - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'organization_id' => :'organizationId', - :'created_admins' => :'createdAdmins' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'OrganizationServiceDetails', - :'organization_id' => :'String', - :'created_admins' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAddOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAddOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'created_admins') - if (value = attributes[:'created_admins']).is_a?(Array) - self.created_admins = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - organization_id == o.organization_id && - created_admins == o.created_admins - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, organization_id, created_admins].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceAddOrganizationResponse. + class OrganizationServiceAddOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + organization_id: 'organizationId', + created_admins: 'createdAdmins' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'OrganizationServiceDetails', + organization_id: 'String', + created_admins: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :created_admins, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_admin.rb b/lib/zitadel/client/models/organization_service_admin.rb index 30386a2b..b2752373 100644 --- a/lib/zitadel/client/models/organization_service_admin.rb +++ b/lib/zitadel/client/models/organization_service_admin.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceAdmin - # specify Org Member Roles for the provided user (default is ORG_OWNER if roles are empty) - attr_accessor :roles - - attr_accessor :human - - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'roles' => :'roles', - :'human' => :'human', - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'roles' => :'Array', - :'human' => :'OrganizationServiceAddHumanUserRequest', - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAdmin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'roles') - if (value = attributes[:'roles']).is_a?(Array) - self.roles = value - end - end - - if attributes.key?(:'human') - self.human = attributes[:'human'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - roles == o.roles && - human == o.human && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [roles, human, user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceAdmin. + class OrganizationServiceAdmin < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + roles: 'roles', + human: 'human', + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + roles: 'Array', + human: 'OrganizationServiceAddHumanUserRequest', + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # specify Org Member Roles for the provided user (default is ORG_OWNER if roles are empty) + # @example null + attribute :roles, Types::Any.optional.meta(omittable: true) + # @example null + attribute :human, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_any.rb b/lib/zitadel/client/models/organization_service_any.rb index 6a8bfa76..9b4a0f8a 100644 --- a/lib/zitadel/client/models/organization_service_any.rb +++ b/lib/zitadel/client/models/organization_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class OrganizationServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class OrganizationServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_connect_error.rb b/lib/zitadel/client/models/organization_service_connect_error.rb index 39253c38..e8b6b07c 100644 --- a/lib/zitadel/client/models/organization_service_connect_error.rb +++ b/lib/zitadel/client/models/organization_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class OrganizationServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class OrganizationServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_created_admin.rb b/lib/zitadel/client/models/organization_service_created_admin.rb index 9b540bef..6fbd0d58 100644 --- a/lib/zitadel/client/models/organization_service_created_admin.rb +++ b/lib/zitadel/client/models/organization_service_created_admin.rb @@ -1,235 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceCreatedAdmin - attr_accessor :user_id - - attr_accessor :email_code - - attr_accessor :phone_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'email_code' => :'emailCode', - :'phone_code' => :'phoneCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'email_code' => :'String', - :'phone_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_code', - :'phone_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceCreatedAdmin` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceCreatedAdmin`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'email_code') - self.email_code = attributes[:'email_code'] - end - - if attributes.key?(:'phone_code') - self.phone_code = attributes[:'phone_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - email_code == o.email_code && - phone_code == o.phone_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, email_code, phone_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceCreatedAdmin. + class OrganizationServiceCreatedAdmin < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + email_code: 'emailCode', + phone_code: 'phoneCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + email_code: 'String', + phone_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_deactivate_organization_request.rb b/lib/zitadel/client/models/organization_service_deactivate_organization_request.rb index d2e4afd0..8c6cff56 100644 --- a/lib/zitadel/client/models/organization_service_deactivate_organization_request.rb +++ b/lib/zitadel/client/models/organization_service_deactivate_organization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDeactivateOrganizationRequest - # OrganizationID is the unique identifier of the organization to be deactivated. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDeactivateOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDeactivateOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDeactivateOrganizationRequest. + class OrganizationServiceDeactivateOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization to be deactivated. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_deactivate_organization_response.rb b/lib/zitadel/client/models/organization_service_deactivate_organization_response.rb index ac9c7da4..9b7eac1a 100644 --- a/lib/zitadel/client/models/organization_service_deactivate_organization_response.rb +++ b/lib/zitadel/client/models/organization_service_deactivate_organization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDeactivateOrganizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDeactivateOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDeactivateOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDeactivateOrganizationResponse. + class OrganizationServiceDeactivateOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_delete_organization_domain_request.rb b/lib/zitadel/client/models/organization_service_delete_organization_domain_request.rb index f0a31d7c..3b0bb528 100644 --- a/lib/zitadel/client/models/organization_service_delete_organization_domain_request.rb +++ b/lib/zitadel/client/models/organization_service_delete_organization_domain_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDeleteOrganizationDomainRequest - # OrganizationID is the unique identifier of the organization from which the domain is to be deleted. - attr_accessor :organization_id - - # Domain is the full qualified domain name to be deleted from the organization. Note that if the domain is used as suffix for user logins, those users will not be able to log in anymore. They have to use another domain instead. Also if the domain was used for domain discovery, users will not be able to find the organization by the domain anymore. - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDeleteOrganizationDomainRequest. + class OrganizationServiceDeleteOrganizationDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization from which the domain is to be deleted. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Domain is the full qualified domain name to be deleted from the organization. Note that if the domain is used as suffix for user logins, those users will not be able to log in anymore. They have to use another domain instead. Also if the domain was used for domain discovery, users will not be able to find the organization by the domain anymore. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_delete_organization_domain_response.rb b/lib/zitadel/client/models/organization_service_delete_organization_domain_response.rb index 2c0a90f5..c0eda8c7 100644 --- a/lib/zitadel/client/models/organization_service_delete_organization_domain_response.rb +++ b/lib/zitadel/client/models/organization_service_delete_organization_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDeleteOrganizationDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDeleteOrganizationDomainResponse. + class OrganizationServiceDeleteOrganizationDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_delete_organization_metadata_request.rb b/lib/zitadel/client/models/organization_service_delete_organization_metadata_request.rb index 9790e575..afc33005 100644 --- a/lib/zitadel/client/models/organization_service_delete_organization_metadata_request.rb +++ b/lib/zitadel/client/models/organization_service_delete_organization_metadata_request.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDeleteOrganizationMetadataRequest - # Organization ID is the unique identifier of the organization whose metadata is to be deleted. - attr_accessor :organization_id - - # Keys are the organization metadata entries to be deleted by their key. - attr_accessor :keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'keys' => :'keys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationMetadataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'keys') - if (value = attributes[:'keys']).is_a?(Array) - self.keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - keys == o.keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDeleteOrganizationMetadataRequest. + class OrganizationServiceDeleteOrganizationMetadataRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + keys: 'keys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization ID is the unique identifier of the organization whose metadata is to be deleted. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Keys are the organization metadata entries to be deleted by their key. + # @example null + attribute :keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_delete_organization_metadata_response.rb b/lib/zitadel/client/models/organization_service_delete_organization_metadata_response.rb index 9d41adb2..841e0231 100644 --- a/lib/zitadel/client/models/organization_service_delete_organization_metadata_response.rb +++ b/lib/zitadel/client/models/organization_service_delete_organization_metadata_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDeleteOrganizationMetadataResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDeleteOrganizationMetadataResponse. + class OrganizationServiceDeleteOrganizationMetadataResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_delete_organization_request.rb b/lib/zitadel/client/models/organization_service_delete_organization_request.rb index 817bca85..15824a1e 100644 --- a/lib/zitadel/client/models/organization_service_delete_organization_request.rb +++ b/lib/zitadel/client/models/organization_service_delete_organization_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDeleteOrganizationRequest - # OrganizationID is the unique identifier of the organization to be deleted. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDeleteOrganizationRequest. + class OrganizationServiceDeleteOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization to be deleted. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_delete_organization_response.rb b/lib/zitadel/client/models/organization_service_delete_organization_response.rb index 4e96fe94..1ddcbfaa 100644 --- a/lib/zitadel/client/models/organization_service_delete_organization_response.rb +++ b/lib/zitadel/client/models/organization_service_delete_organization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDeleteOrganizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDeleteOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDeleteOrganizationResponse. + class OrganizationServiceDeleteOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_details.rb b/lib/zitadel/client/models/organization_service_details.rb index f771071f..28f9f628 100644 --- a/lib/zitadel/client/models/organization_service_details.rb +++ b/lib/zitadel/client/models/organization_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDetails. + class OrganizationServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_domain.rb b/lib/zitadel/client/models/organization_service_domain.rb index a9eadfc7..3d63e70a 100644 --- a/lib/zitadel/client/models/organization_service_domain.rb +++ b/lib/zitadel/client/models/organization_service_domain.rb @@ -1,277 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDomain - # OrganizationID is the unique identifier of the organization the domain belongs to. - attr_accessor :organization_id - - # Domain is the fully qualified domain name. - attr_accessor :domain - - # IsVerified is a boolean flag indicating if the domain has been verified. - attr_accessor :is_verified - - # IsPrimary is a boolean flag indicating if the domain is the primary domain of the organization. - attr_accessor :is_primary - - attr_accessor :validation_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain' => :'domain', - :'is_verified' => :'isVerified', - :'is_primary' => :'isPrimary', - :'validation_type' => :'validationType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain' => :'String', - :'is_verified' => :'Boolean', - :'is_primary' => :'Boolean', - :'validation_type' => :'OrganizationServiceDomainValidationType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDomain` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDomain`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'is_primary') - self.is_primary = attributes[:'is_primary'] - end - - if attributes.key?(:'validation_type') - self.validation_type = attributes[:'validation_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain == o.domain && - is_verified == o.is_verified && - is_primary == o.is_primary && - validation_type == o.validation_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain, is_verified, is_primary, validation_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDomain. + class OrganizationServiceDomain < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain: 'domain', + is_verified: 'isVerified', + is_primary: 'isPrimary', + validation_type: 'validationType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain: 'String', + is_verified: 'Boolean', + is_primary: 'Boolean', + validation_type: 'OrganizationServiceDomainValidationType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization the domain belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Domain is the fully qualified domain name. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # IsVerified is a boolean flag indicating if the domain has been verified. + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # IsPrimary is a boolean flag indicating if the domain is the primary domain of the organization. + # @example null + attribute :is_primary, Types::Any.optional.meta(omittable: true) + # @example null + attribute :validation_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_domain_field_name.rb b/lib/zitadel/client/models/organization_service_domain_field_name.rb index 55df9e9e..21a3f7b8 100644 --- a/lib/zitadel/client/models/organization_service_domain_field_name.rb +++ b/lib/zitadel/client/models/organization_service_domain_field_name.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class OrganizationServiceDomainFieldName - DOMAIN_FIELD_NAME_UNSPECIFIED = "DOMAIN_FIELD_NAME_UNSPECIFIED".freeze - DOMAIN_FIELD_NAME_NAME = "DOMAIN_FIELD_NAME_NAME".freeze - DOMAIN_FIELD_NAME_CREATION_DATE = "DOMAIN_FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [DOMAIN_FIELD_NAME_UNSPECIFIED, DOMAIN_FIELD_NAME_NAME, DOMAIN_FIELD_NAME_CREATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OrganizationServiceDomainFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OrganizationServiceDomainFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for OrganizationServiceDomainFieldName. + class OrganizationServiceDomainFieldName + DOMAIN_FIELD_NAME_UNSPECIFIED = 'DOMAIN_FIELD_NAME_UNSPECIFIED' + DOMAIN_FIELD_NAME_NAME = 'DOMAIN_FIELD_NAME_NAME' + DOMAIN_FIELD_NAME_CREATION_DATE = 'DOMAIN_FIELD_NAME_CREATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [DOMAIN_FIELD_NAME_UNSPECIFIED, DOMAIN_FIELD_NAME_NAME, DOMAIN_FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for OrganizationServiceDomainFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/organization_service_domain_search_filter.rb b/lib/zitadel/client/models/organization_service_domain_search_filter.rb index 0a8349ce..7855c4d4 100644 --- a/lib/zitadel/client/models/organization_service_domain_search_filter.rb +++ b/lib/zitadel/client/models/organization_service_domain_search_filter.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceDomainSearchFilter - attr_accessor :domain_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain_filter' => :'domainFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain_filter' => :'OrganizationServiceOrganizationDomainQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceDomainSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceDomainSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain_filter') - self.domain_filter = attributes[:'domain_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain_filter == o.domain_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceDomainSearchFilter. + class OrganizationServiceDomainSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain_filter: 'domainFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain_filter: 'OrganizationServiceOrganizationDomainQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :domain_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_domain_validation_type.rb b/lib/zitadel/client/models/organization_service_domain_validation_type.rb index 4a7bc505..ffe6e897 100644 --- a/lib/zitadel/client/models/organization_service_domain_validation_type.rb +++ b/lib/zitadel/client/models/organization_service_domain_validation_type.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class OrganizationServiceDomainValidationType - DOMAIN_VALIDATION_TYPE_UNSPECIFIED = "DOMAIN_VALIDATION_TYPE_UNSPECIFIED".freeze - DOMAIN_VALIDATION_TYPE_HTTP = "DOMAIN_VALIDATION_TYPE_HTTP".freeze - DOMAIN_VALIDATION_TYPE_DNS = "DOMAIN_VALIDATION_TYPE_DNS".freeze - - def self.all_vars - @all_vars ||= [DOMAIN_VALIDATION_TYPE_UNSPECIFIED, DOMAIN_VALIDATION_TYPE_HTTP, DOMAIN_VALIDATION_TYPE_DNS].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OrganizationServiceDomainValidationType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OrganizationServiceDomainValidationType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for OrganizationServiceDomainValidationType. + class OrganizationServiceDomainValidationType + DOMAIN_VALIDATION_TYPE_UNSPECIFIED = 'DOMAIN_VALIDATION_TYPE_UNSPECIFIED' + DOMAIN_VALIDATION_TYPE_HTTP = 'DOMAIN_VALIDATION_TYPE_HTTP' + DOMAIN_VALIDATION_TYPE_DNS = 'DOMAIN_VALIDATION_TYPE_DNS' + + # Frozen set of all allowed values, used for validation. + VALUES = [DOMAIN_VALIDATION_TYPE_UNSPECIFIED, DOMAIN_VALIDATION_TYPE_HTTP, DOMAIN_VALIDATION_TYPE_DNS].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for OrganizationServiceDomainValidationType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/organization_service_gender.rb b/lib/zitadel/client/models/organization_service_gender.rb index 3ffe4fa2..1b887611 100644 --- a/lib/zitadel/client/models/organization_service_gender.rb +++ b/lib/zitadel/client/models/organization_service_gender.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class OrganizationServiceGender - GENDER_UNSPECIFIED = "GENDER_UNSPECIFIED".freeze - GENDER_FEMALE = "GENDER_FEMALE".freeze - GENDER_MALE = "GENDER_MALE".freeze - GENDER_DIVERSE = "GENDER_DIVERSE".freeze - - def self.all_vars - @all_vars ||= [GENDER_UNSPECIFIED, GENDER_FEMALE, GENDER_MALE, GENDER_DIVERSE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OrganizationServiceGender.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OrganizationServiceGender" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for OrganizationServiceGender. + class OrganizationServiceGender + GENDER_UNSPECIFIED = 'GENDER_UNSPECIFIED' + GENDER_FEMALE = 'GENDER_FEMALE' + GENDER_MALE = 'GENDER_MALE' + GENDER_DIVERSE = 'GENDER_DIVERSE' + + # Frozen set of all allowed values, used for validation. + VALUES = [GENDER_UNSPECIFIED, GENDER_FEMALE, GENDER_MALE, GENDER_DIVERSE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for OrganizationServiceGender: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/organization_service_generate_organization_domain_validation_request.rb b/lib/zitadel/client/models/organization_service_generate_organization_domain_validation_request.rb index 6ba855a5..2c251d0f 100644 --- a/lib/zitadel/client/models/organization_service_generate_organization_domain_validation_request.rb +++ b/lib/zitadel/client/models/organization_service_generate_organization_domain_validation_request.rb @@ -1,257 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceGenerateOrganizationDomainValidationRequest - # OrganizationID is the unique identifier of the organization for which the domain validation is to be generated. - attr_accessor :organization_id - - # Domain is the full qualified domain name for which the validation is to be generated. - attr_accessor :domain - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain' => :'domain', - :'type' => :'type' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain' => :'String', - :'type' => :'OrganizationServiceDomainValidationType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceGenerateOrganizationDomainValidationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceGenerateOrganizationDomainValidationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain == o.domain && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain, type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceGenerateOrganizationDomainValidationRequest. + class OrganizationServiceGenerateOrganizationDomainValidationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain: 'domain', + type: 'type' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain: 'String', + type: 'OrganizationServiceDomainValidationType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization for which the domain validation is to be generated. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Domain is the full qualified domain name for which the validation is to be generated. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_generate_organization_domain_validation_response.rb b/lib/zitadel/client/models/organization_service_generate_organization_domain_validation_response.rb index 6eb141cb..4b502020 100644 --- a/lib/zitadel/client/models/organization_service_generate_organization_domain_validation_response.rb +++ b/lib/zitadel/client/models/organization_service_generate_organization_domain_validation_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceGenerateOrganizationDomainValidationResponse - # Token is a verification token that needs to be added to the DNS records or as a file to the webserver. Zitadel will check for this token to verify the domain. - attr_accessor :token - - # URL is the location where the token needs to be placed for HTTP challenge. - attr_accessor :url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'token' => :'token', - :'url' => :'url' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'token' => :'String', - :'url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceGenerateOrganizationDomainValidationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceGenerateOrganizationDomainValidationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'token') - self.token = attributes[:'token'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - token == o.token && - url == o.url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [token, url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceGenerateOrganizationDomainValidationResponse. + class OrganizationServiceGenerateOrganizationDomainValidationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + token: 'token', + url: 'url' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + token: 'String', + url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Token is a verification token that needs to be added to the DNS records or as a file to the webserver. Zitadel will check for this token to verify the domain. + # @example null + attribute :token, Types::Any.optional.meta(omittable: true) + # URL is the location where the token needs to be placed for HTTP challenge. + # @example null + attribute :url, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_hashed_password.rb b/lib/zitadel/client/models/organization_service_hashed_password.rb index 6ccb55d1..5f8d9a1b 100644 --- a/lib/zitadel/client/models/organization_service_hashed_password.rb +++ b/lib/zitadel/client/models/organization_service_hashed_password.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceHashedPassword - attr_accessor :hash - - attr_accessor :change_required - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'hash' => :'hash', - :'change_required' => :'changeRequired' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'hash' => :'String', - :'change_required' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceHashedPassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceHashedPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'hash') - self.hash = attributes[:'hash'] - end - - if attributes.key?(:'change_required') - self.change_required = attributes[:'change_required'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - hash == o.hash && - change_required == o.change_required - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [hash, change_required].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceHashedPassword. + class OrganizationServiceHashedPassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + hash: 'hash', + change_required: 'changeRequired' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + hash: 'String', + change_required: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :hash, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_required, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_i_d_p_link.rb b/lib/zitadel/client/models/organization_service_i_d_p_link.rb deleted file mode 100644 index 93f52541..00000000 --- a/lib/zitadel/client/models/organization_service_i_d_p_link.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OrganizationServiceIDPLink - attr_accessor :idp_id - - attr_accessor :user_id - - attr_accessor :user_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_id' => :'idpId', - :'user_id' => :'userId', - :'user_name' => :'userName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_id' => :'String', - :'user_id' => :'String', - :'user_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceIDPLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceIDPLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_id == o.idp_id && - user_id == o.user_id && - user_name == o.user_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_id, user_id, user_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/organization_service_idp_link.rb b/lib/zitadel/client/models/organization_service_idp_link.rb new file mode 100644 index 00000000..437c75cd --- /dev/null +++ b/lib/zitadel/client/models/organization_service_idp_link.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceIDPLink. + class OrganizationServiceIDPLink < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_id: 'idpId', + user_id: 'userId', + user_name: 'userName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_id: 'String', + user_id: 'String', + user_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_name, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/organization_service_list_details.rb b/lib/zitadel/client/models/organization_service_list_details.rb index cf03edfc..2673e113 100644 --- a/lib/zitadel/client/models/organization_service_list_details.rb +++ b/lib/zitadel/client/models/organization_service_list_details.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceListDetails - attr_accessor :total_result - - attr_accessor :processed_sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'processed_sequence' => :'processedSequence', - :'timestamp' => :'timestamp' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'processed_sequence' => :'Object', - :'timestamp' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'processed_sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceListDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'processed_sequence') - self.processed_sequence = attributes[:'processed_sequence'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - processed_sequence == o.processed_sequence && - timestamp == o.timestamp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, processed_sequence, timestamp].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceListDetails. + class OrganizationServiceListDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + processed_sequence: 'processedSequence', + timestamp: 'timestamp' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + processed_sequence: 'Object', + timestamp: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # @example null + attribute :processed_sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_list_organization_domains_request.rb b/lib/zitadel/client/models/organization_service_list_organization_domains_request.rb index b2091fc0..056e678c 100644 --- a/lib/zitadel/client/models/organization_service_list_organization_domains_request.rb +++ b/lib/zitadel/client/models/organization_service_list_organization_domains_request.rb @@ -1,268 +1,87 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceListOrganizationDomainsRequest - # OrganizationID is the unique identifier of the organization from which the domains are to be listed. - attr_accessor :organization_id - - attr_accessor :pagination - - # Filters define the criteria to query for. - attr_accessor :filters - - attr_accessor :sorting_column - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'pagination' => :'pagination', - :'filters' => :'filters', - :'sorting_column' => :'sortingColumn' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'pagination' => :'OrganizationServicePaginationRequest', - :'filters' => :'Array', - :'sorting_column' => :'OrganizationServiceDomainFieldName' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceListOrganizationDomainsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceListOrganizationDomainsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - pagination == o.pagination && - filters == o.filters && - sorting_column == o.sorting_column - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, pagination, filters, sorting_column].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceListOrganizationDomainsRequest. + class OrganizationServiceListOrganizationDomainsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + pagination: 'pagination', + filters: 'filters', + sorting_column: 'sortingColumn' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + pagination: 'OrganizationServicePaginationRequest', + filters: 'Array', + sorting_column: 'OrganizationServiceDomainFieldName' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization from which the domains are to be listed. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Filters define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_list_organization_domains_response.rb b/lib/zitadel/client/models/organization_service_list_organization_domains_response.rb index 7e35dfa2..00426c2f 100644 --- a/lib/zitadel/client/models/organization_service_list_organization_domains_response.rb +++ b/lib/zitadel/client/models/organization_service_list_organization_domains_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceListOrganizationDomainsResponse - attr_accessor :pagination - - # Domains is a list of fully qualified domain names registered to the organization matching the query. - attr_accessor :domains - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'domains' => :'domains' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'OrganizationServicePaginationResponse', - :'domains' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceListOrganizationDomainsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceListOrganizationDomainsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'domains') - if (value = attributes[:'domains']).is_a?(Array) - self.domains = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - domains == o.domains - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, domains].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceListOrganizationDomainsResponse. + class OrganizationServiceListOrganizationDomainsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + domains: 'domains' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'OrganizationServicePaginationResponse', + domains: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Domains is a list of fully qualified domain names registered to the organization matching the query. + # @example null + attribute :domains, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_list_organization_metadata_request.rb b/lib/zitadel/client/models/organization_service_list_organization_metadata_request.rb index 6f9b424f..8a9c53a2 100644 --- a/lib/zitadel/client/models/organization_service_list_organization_metadata_request.rb +++ b/lib/zitadel/client/models/organization_service_list_organization_metadata_request.rb @@ -1,237 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceListOrganizationMetadataRequest - # Organization ID is the unique identifier of the organization whose metadata is to be listed. - attr_accessor :organization_id - - attr_accessor :pagination - - # Filters define the criteria to query the metadata for. - attr_accessor :filters - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'pagination' => :'pagination', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'pagination' => :'OrganizationServicePaginationRequest', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceListOrganizationMetadataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceListOrganizationMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - pagination == o.pagination && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, pagination, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceListOrganizationMetadataRequest. + class OrganizationServiceListOrganizationMetadataRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + pagination: 'pagination', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + pagination: 'OrganizationServicePaginationRequest', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization ID is the unique identifier of the organization whose metadata is to be listed. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Filters define the criteria to query the metadata for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_list_organization_metadata_response.rb b/lib/zitadel/client/models/organization_service_list_organization_metadata_response.rb index 06b59a57..f26a53eb 100644 --- a/lib/zitadel/client/models/organization_service_list_organization_metadata_response.rb +++ b/lib/zitadel/client/models/organization_service_list_organization_metadata_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceListOrganizationMetadataResponse - attr_accessor :pagination - - # Metadata is a list of organization metadata that matched the query. - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'metadata' => :'metadata' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'OrganizationServicePaginationResponse', - :'metadata' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceListOrganizationMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceListOrganizationMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, metadata].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceListOrganizationMetadataResponse. + class OrganizationServiceListOrganizationMetadataResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + metadata: 'metadata' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'OrganizationServicePaginationResponse', + metadata: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Metadata is a list of organization metadata that matched the query. + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_list_organizations_request.rb b/lib/zitadel/client/models/organization_service_list_organizations_request.rb index 2be00f98..e7f2ad77 100644 --- a/lib/zitadel/client/models/organization_service_list_organizations_request.rb +++ b/lib/zitadel/client/models/organization_service_list_organizations_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceListOrganizationsRequest - attr_accessor :query - - attr_accessor :sorting_column - - # criteria the client is looking for - attr_accessor :queries - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'query' => :'query', - :'sorting_column' => :'sortingColumn', - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'query' => :'OrganizationServiceListQuery', - :'sorting_column' => :'OrganizationServiceOrganizationFieldName', - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceListOrganizationsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceListOrganizationsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - query == o.query && - sorting_column == o.sorting_column && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [query, sorting_column, queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceListOrganizationsRequest. + class OrganizationServiceListOrganizationsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + query: 'query', + sorting_column: 'sortingColumn', + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + query: 'OrganizationServiceListQuery', + sorting_column: 'OrganizationServiceOrganizationFieldName', + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # criteria the client is looking for + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_list_organizations_response.rb b/lib/zitadel/client/models/organization_service_list_organizations_response.rb index 2b747157..a2589a85 100644 --- a/lib/zitadel/client/models/organization_service_list_organizations_response.rb +++ b/lib/zitadel/client/models/organization_service_list_organizations_response.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceListOrganizationsResponse - attr_accessor :details - - attr_accessor :sorting_column - - # The Result is a list of organizations matching the query. - attr_accessor :result - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'sorting_column' => :'sortingColumn', - :'result' => :'result' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'OrganizationServiceListDetails', - :'sorting_column' => :'OrganizationServiceOrganizationFieldName', - :'result' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceListOrganizationsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceListOrganizationsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'result') - if (value = attributes[:'result']).is_a?(Array) - self.result = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - sorting_column == o.sorting_column && - result == o.result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, sorting_column, result].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceListOrganizationsResponse. + class OrganizationServiceListOrganizationsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + sorting_column: 'sortingColumn', + result: 'result' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'OrganizationServiceListDetails', + sorting_column: 'OrganizationServiceOrganizationFieldName', + result: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # The Result is a list of organizations matching the query. + # @example null + attribute :result, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_list_query.rb b/lib/zitadel/client/models/organization_service_list_query.rb index 1f26d7a7..70c8ee48 100644 --- a/lib/zitadel/client/models/organization_service_list_query.rb +++ b/lib/zitadel/client/models/organization_service_list_query.rb @@ -1,234 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceListQuery - attr_accessor :offset - - attr_accessor :limit - - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceListQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceListQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceListQuery. + class OrganizationServiceListQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_metadata.rb b/lib/zitadel/client/models/organization_service_metadata.rb index db41f15f..ad66c3d8 100644 --- a/lib/zitadel/client/models/organization_service_metadata.rb +++ b/lib/zitadel/client/models/organization_service_metadata.rb @@ -1,226 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceMetadata - # Key is identifier of the metadata entry. - attr_accessor :key - - # Value is the values of the metadata entry. - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'value' => :'value' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, value].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceMetadata. + class OrganizationServiceMetadata < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + value: 'value' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + value: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + value: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Key is identifier of the metadata entry. + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # Value is the values of the metadata entry. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_metadata_key_filter.rb b/lib/zitadel/client/models/organization_service_metadata_key_filter.rb index 99b293b7..3e460dd2 100644 --- a/lib/zitadel/client/models/organization_service_metadata_key_filter.rb +++ b/lib/zitadel/client/models/organization_service_metadata_key_filter.rb @@ -1,246 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceMetadataKeyFilter - attr_accessor :key - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'method' => :'OrganizationServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceMetadataKeyFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceMetadataKeyFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceMetadataKeyFilter. + class OrganizationServiceMetadataKeyFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + method: 'OrganizationServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_metadata_search_filter.rb b/lib/zitadel/client/models/organization_service_metadata_search_filter.rb index b187a90e..5aa680da 100644 --- a/lib/zitadel/client/models/organization_service_metadata_search_filter.rb +++ b/lib/zitadel/client/models/organization_service_metadata_search_filter.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceMetadataSearchFilter - attr_accessor :key_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_filter' => :'keyFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_filter' => :'OrganizationServiceMetadataKeyFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceMetadataSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceMetadataSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_filter') - self.key_filter = attributes[:'key_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_filter == o.key_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceMetadataSearchFilter. + class OrganizationServiceMetadataSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_filter: 'keyFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_filter: 'OrganizationServiceMetadataKeyFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_organization.rb b/lib/zitadel/client/models/organization_service_organization.rb index dab6dd4a..bd32e33e 100644 --- a/lib/zitadel/client/models/organization_service_organization.rb +++ b/lib/zitadel/client/models/organization_service_organization.rb @@ -1,276 +1,92 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceOrganization - # ID is the unique identifier of the organization. - attr_accessor :id - - attr_accessor :details - - attr_accessor :state - - # Name of the organization. - attr_accessor :name - - # Primary domain used in the organization. - attr_accessor :primary_domain - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'details' => :'details', - :'state' => :'state', - :'name' => :'name', - :'primary_domain' => :'primaryDomain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'details' => :'OrganizationServiceDetails', - :'state' => :'OrganizationServiceOrganizationState', - :'name' => :'String', - :'primary_domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'primary_domain') - self.primary_domain = attributes[:'primary_domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - details == o.details && - state == o.state && - name == o.name && - primary_domain == o.primary_domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, details, state, name, primary_domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceOrganization. + class OrganizationServiceOrganization < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + details: 'details', + state: 'state', + name: 'name', + primary_domain: 'primaryDomain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + details: 'OrganizationServiceDetails', + state: 'OrganizationServiceOrganizationState', + name: 'String', + primary_domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID is the unique identifier of the organization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # Name of the organization. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # Primary domain used in the organization. + # @example null + attribute :primary_domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_organization_domain_query.rb b/lib/zitadel/client/models/organization_service_organization_domain_query.rb index eab37bf9..4a0905dc 100644 --- a/lib/zitadel/client/models/organization_service_organization_domain_query.rb +++ b/lib/zitadel/client/models/organization_service_organization_domain_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceOrganizationDomainQuery - # Domain used in organization, not necessary primary domain. - attr_accessor :domain - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain' => :'domain', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain' => :'String', - :'method' => :'OrganizationServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganizationDomainQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganizationDomainQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain == o.domain && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceOrganizationDomainQuery. + class OrganizationServiceOrganizationDomainQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain: 'domain', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain: 'String', + method: 'OrganizationServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Domain used in organization, not necessary primary domain. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_organization_field_name.rb b/lib/zitadel/client/models/organization_service_organization_field_name.rb index 06dfd821..87920550 100644 --- a/lib/zitadel/client/models/organization_service_organization_field_name.rb +++ b/lib/zitadel/client/models/organization_service_organization_field_name.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class OrganizationServiceOrganizationFieldName - ORGANIZATION_FIELD_NAME_UNSPECIFIED = "ORGANIZATION_FIELD_NAME_UNSPECIFIED".freeze - ORGANIZATION_FIELD_NAME_NAME = "ORGANIZATION_FIELD_NAME_NAME".freeze - ORGANIZATION_FIELD_NAME_CREATION_DATE = "ORGANIZATION_FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [ORGANIZATION_FIELD_NAME_UNSPECIFIED, ORGANIZATION_FIELD_NAME_NAME, ORGANIZATION_FIELD_NAME_CREATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OrganizationServiceOrganizationFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OrganizationServiceOrganizationFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for OrganizationServiceOrganizationFieldName. + class OrganizationServiceOrganizationFieldName + ORGANIZATION_FIELD_NAME_UNSPECIFIED = 'ORGANIZATION_FIELD_NAME_UNSPECIFIED' + ORGANIZATION_FIELD_NAME_NAME = 'ORGANIZATION_FIELD_NAME_NAME' + ORGANIZATION_FIELD_NAME_CREATION_DATE = 'ORGANIZATION_FIELD_NAME_CREATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [ORGANIZATION_FIELD_NAME_UNSPECIFIED, ORGANIZATION_FIELD_NAME_NAME, ORGANIZATION_FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for OrganizationServiceOrganizationFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/organization_service_organization_i_d_query.rb b/lib/zitadel/client/models/organization_service_organization_i_d_query.rb deleted file mode 100644 index be6a7b7a..00000000 --- a/lib/zitadel/client/models/organization_service_organization_i_d_query.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class OrganizationServiceOrganizationIDQuery - # Unique identifier of the organization. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganizationIDQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganizationIDQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/organization_service_organization_id_query.rb b/lib/zitadel/client/models/organization_service_organization_id_query.rb new file mode 100644 index 00000000..483c5ef4 --- /dev/null +++ b/lib/zitadel/client/models/organization_service_organization_id_query.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceOrganizationIDQuery. + class OrganizationServiceOrganizationIDQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Unique identifier of the organization. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/organization_service_organization_name_query.rb b/lib/zitadel/client/models/organization_service_organization_name_query.rb index 65a51e3d..3776db0c 100644 --- a/lib/zitadel/client/models/organization_service_organization_name_query.rb +++ b/lib/zitadel/client/models/organization_service_organization_name_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceOrganizationNameQuery - # Name of the organization. - attr_accessor :name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'method' => :'OrganizationServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganizationNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganizationNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceOrganizationNameQuery. + class OrganizationServiceOrganizationNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + method: 'OrganizationServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Name of the organization. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_organization_state.rb b/lib/zitadel/client/models/organization_service_organization_state.rb index 004c185c..9622d558 100644 --- a/lib/zitadel/client/models/organization_service_organization_state.rb +++ b/lib/zitadel/client/models/organization_service_organization_state.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class OrganizationServiceOrganizationState - ORGANIZATION_STATE_UNSPECIFIED = "ORGANIZATION_STATE_UNSPECIFIED".freeze - ORGANIZATION_STATE_ACTIVE = "ORGANIZATION_STATE_ACTIVE".freeze - ORGANIZATION_STATE_INACTIVE = "ORGANIZATION_STATE_INACTIVE".freeze - ORGANIZATION_STATE_REMOVED = "ORGANIZATION_STATE_REMOVED".freeze - - def self.all_vars - @all_vars ||= [ORGANIZATION_STATE_UNSPECIFIED, ORGANIZATION_STATE_ACTIVE, ORGANIZATION_STATE_INACTIVE, ORGANIZATION_STATE_REMOVED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OrganizationServiceOrganizationState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OrganizationServiceOrganizationState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for OrganizationServiceOrganizationState. + class OrganizationServiceOrganizationState + ORGANIZATION_STATE_UNSPECIFIED = 'ORGANIZATION_STATE_UNSPECIFIED' + ORGANIZATION_STATE_ACTIVE = 'ORGANIZATION_STATE_ACTIVE' + ORGANIZATION_STATE_INACTIVE = 'ORGANIZATION_STATE_INACTIVE' + ORGANIZATION_STATE_REMOVED = 'ORGANIZATION_STATE_REMOVED' + + # Frozen set of all allowed values, used for validation. + VALUES = [ORGANIZATION_STATE_UNSPECIFIED, ORGANIZATION_STATE_ACTIVE, ORGANIZATION_STATE_INACTIVE, ORGANIZATION_STATE_REMOVED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for OrganizationServiceOrganizationState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/organization_service_organization_state_query.rb b/lib/zitadel/client/models/organization_service_organization_state_query.rb index 924a1c7e..6d400497 100644 --- a/lib/zitadel/client/models/organization_service_organization_state_query.rb +++ b/lib/zitadel/client/models/organization_service_organization_state_query.rb @@ -1,237 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceOrganizationStateQuery - attr_accessor :state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'state' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'OrganizationServiceOrganizationState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceOrganizationStateQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceOrganizationStateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceOrganizationStateQuery. + class OrganizationServiceOrganizationStateQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + state: 'state' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + state: 'OrganizationServiceOrganizationState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_pagination_request.rb b/lib/zitadel/client/models/organization_service_pagination_request.rb index d2cb4d8b..653ae569 100644 --- a/lib/zitadel/client/models/organization_service_pagination_request.rb +++ b/lib/zitadel/client/models/organization_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServicePaginationRequest. + class OrganizationServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_pagination_response.rb b/lib/zitadel/client/models/organization_service_pagination_response.rb index f4790a30..e4d9f95a 100644 --- a/lib/zitadel/client/models/organization_service_pagination_response.rb +++ b/lib/zitadel/client/models/organization_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServicePaginationResponse. + class OrganizationServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_password.rb b/lib/zitadel/client/models/organization_service_password.rb index 0a492de4..d80b9bad 100644 --- a/lib/zitadel/client/models/organization_service_password.rb +++ b/lib/zitadel/client/models/organization_service_password.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServicePassword - attr_accessor :password - - attr_accessor :change_required - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'password' => :'password', - :'change_required' => :'changeRequired' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'password' => :'String', - :'change_required' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServicePassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServicePassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'change_required') - self.change_required = attributes[:'change_required'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - password == o.password && - change_required == o.change_required - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [password, change_required].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServicePassword. + class OrganizationServicePassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + password: 'password', + change_required: 'changeRequired' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + password: 'String', + change_required: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_required, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_search_query.rb b/lib/zitadel/client/models/organization_service_search_query.rb index dfe32727..a82cfb03 100644 --- a/lib/zitadel/client/models/organization_service_search_query.rb +++ b/lib/zitadel/client/models/organization_service_search_query.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSearchQuery - attr_accessor :default_query - - attr_accessor :domain_query - - attr_accessor :id_query - - attr_accessor :name_query - - attr_accessor :state_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'default_query' => :'defaultQuery', - :'domain_query' => :'domainQuery', - :'id_query' => :'idQuery', - :'name_query' => :'nameQuery', - :'state_query' => :'stateQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'default_query' => :'Object', - :'domain_query' => :'OrganizationServiceOrganizationDomainQuery', - :'id_query' => :'OrganizationServiceOrganizationIDQuery', - :'name_query' => :'OrganizationServiceOrganizationNameQuery', - :'state_query' => :'OrganizationServiceOrganizationStateQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'default_query') - self.default_query = attributes[:'default_query'] - end - - if attributes.key?(:'domain_query') - self.domain_query = attributes[:'domain_query'] - end - - if attributes.key?(:'id_query') - self.id_query = attributes[:'id_query'] - end - - if attributes.key?(:'name_query') - self.name_query = attributes[:'name_query'] - end - - if attributes.key?(:'state_query') - self.state_query = attributes[:'state_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - default_query == o.default_query && - domain_query == o.domain_query && - id_query == o.id_query && - name_query == o.name_query && - state_query == o.state_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [default_query, domain_query, id_query, name_query, state_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceSearchQuery. + class OrganizationServiceSearchQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + default_query: 'defaultQuery', + domain_query: 'domainQuery', + id_query: 'idQuery', + name_query: 'nameQuery', + state_query: 'stateQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + default_query: 'Object', + domain_query: 'OrganizationServiceOrganizationDomainQuery', + id_query: 'OrganizationServiceOrganizationIDQuery', + name_query: 'OrganizationServiceOrganizationNameQuery', + state_query: 'OrganizationServiceOrganizationStateQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :default_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_send_email_verification_code.rb b/lib/zitadel/client/models/organization_service_send_email_verification_code.rb index 18edaba6..1c34d575 100644 --- a/lib/zitadel/client/models/organization_service_send_email_verification_code.rb +++ b/lib/zitadel/client/models/organization_service_send_email_verification_code.rb @@ -1,217 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSendEmailVerificationCode - # Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code - attr_accessor :url_template - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSendEmailVerificationCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSendEmailVerificationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceSendEmailVerificationCode. + class OrganizationServiceSendEmailVerificationCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_set_human_email.rb b/lib/zitadel/client/models/organization_service_set_human_email.rb index 8eadfa30..d2b8c8ea 100644 --- a/lib/zitadel/client/models/organization_service_set_human_email.rb +++ b/lib/zitadel/client/models/organization_service_set_human_email.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSetHumanEmail - attr_accessor :email - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'OrganizationServiceSendEmailVerificationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetHumanEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetHumanEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceSetHumanEmail. + class OrganizationServiceSetHumanEmail < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + email: 'email', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + email: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'OrganizationServiceSendEmailVerificationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_set_human_phone.rb b/lib/zitadel/client/models/organization_service_set_human_phone.rb index bbe796f5..1b25260b 100644 --- a/lib/zitadel/client/models/organization_service_set_human_phone.rb +++ b/lib/zitadel/client/models/organization_service_set_human_phone.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSetHumanPhone - attr_accessor :phone - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone' => :'phone', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetHumanPhone` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetHumanPhone`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone == o.phone && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceSetHumanPhone. + class OrganizationServiceSetHumanPhone < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + phone: 'phone', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + phone: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_set_human_profile.rb b/lib/zitadel/client/models/organization_service_set_human_profile.rb index a31a0735..35d4b414 100644 --- a/lib/zitadel/client/models/organization_service_set_human_profile.rb +++ b/lib/zitadel/client/models/organization_service_set_human_profile.rb @@ -1,285 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSetHumanProfile - attr_accessor :given_name - - attr_accessor :family_name - - attr_accessor :nick_name - - attr_accessor :display_name - - attr_accessor :preferred_language - - attr_accessor :gender - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'givenName', - :'family_name' => :'familyName', - :'nick_name' => :'nickName', - :'display_name' => :'displayName', - :'preferred_language' => :'preferredLanguage', - :'gender' => :'gender' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'nick_name' => :'String', - :'display_name' => :'String', - :'preferred_language' => :'String', - :'gender' => :'OrganizationServiceGender' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'nick_name', - :'display_name', - :'preferred_language', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetHumanProfile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetHumanProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'preferred_language') - self.preferred_language = attributes[:'preferred_language'] - end - - if attributes.key?(:'gender') - self.gender = attributes[:'gender'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - nick_name == o.nick_name && - display_name == o.display_name && - preferred_language == o.preferred_language && - gender == o.gender - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, nick_name, display_name, preferred_language, gender].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceSetHumanProfile. + class OrganizationServiceSetHumanProfile < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + given_name: 'givenName', + family_name: 'familyName', + nick_name: 'nickName', + display_name: 'displayName', + preferred_language: 'preferredLanguage', + gender: 'gender' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + given_name: 'String', + family_name: 'String', + nick_name: 'String', + display_name: 'String', + preferred_language: 'String', + gender: 'OrganizationServiceGender' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :given_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :family_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :nick_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_language, Types::Any.optional.meta(omittable: true) + # @example null + attribute :gender, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/organization_service_set_metadata_entry.rb b/lib/zitadel/client/models/organization_service_set_metadata_entry.rb index f2da25e0..6482e4f4 100644 --- a/lib/zitadel/client/models/organization_service_set_metadata_entry.rb +++ b/lib/zitadel/client/models/organization_service_set_metadata_entry.rb @@ -1,224 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSetMetadataEntry - attr_accessor :key - - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'value' => :'value' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetMetadataEntry` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetMetadataEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, value].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceSetMetadataEntry. + class OrganizationServiceSetMetadataEntry < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + value: 'value' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + value: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + value: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_set_organization_metadata_request.rb b/lib/zitadel/client/models/organization_service_set_organization_metadata_request.rb index 69a479a1..8c3b402a 100644 --- a/lib/zitadel/client/models/organization_service_set_organization_metadata_request.rb +++ b/lib/zitadel/client/models/organization_service_set_organization_metadata_request.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSetOrganizationMetadataRequest - # Organization ID is the unique identifier of the organization whose metadata is to be set. - attr_accessor :organization_id - - # Metadata is a list of metadata entries to set. - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'metadata' => :'metadata' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'metadata' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetOrganizationMetadataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetOrganizationMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, metadata].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceSetOrganizationMetadataRequest. + class OrganizationServiceSetOrganizationMetadataRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + metadata: 'metadata' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + metadata: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization ID is the unique identifier of the organization whose metadata is to be set. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Metadata is a list of metadata entries to set. + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_set_organization_metadata_response.rb b/lib/zitadel/client/models/organization_service_set_organization_metadata_response.rb index 07c1788e..c03686d0 100644 --- a/lib/zitadel/client/models/organization_service_set_organization_metadata_response.rb +++ b/lib/zitadel/client/models/organization_service_set_organization_metadata_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceSetOrganizationMetadataResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :set_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'set_date' => :'setDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'set_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceSetOrganizationMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceSetOrganizationMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'set_date') - self.set_date = attributes[:'set_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - set_date == o.set_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [set_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceSetOrganizationMetadataResponse. + class OrganizationServiceSetOrganizationMetadataResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + set_date: 'setDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + set_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :set_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_text_filter_method.rb b/lib/zitadel/client/models/organization_service_text_filter_method.rb index 0a846cfc..eb19a2c5 100644 --- a/lib/zitadel/client/models/organization_service_text_filter_method.rb +++ b/lib/zitadel/client/models/organization_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class OrganizationServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for OrganizationServiceTextFilterMethod. + class OrganizationServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OrganizationServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OrganizationServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for OrganizationServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/organization_service_text_query_method.rb b/lib/zitadel/client/models/organization_service_text_query_method.rb index b407a896..9eeee800 100644 --- a/lib/zitadel/client/models/organization_service_text_query_method.rb +++ b/lib/zitadel/client/models/organization_service_text_query_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class OrganizationServiceTextQueryMethod - TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS".freeze - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH".freeze - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS".freeze - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH".freeze - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for OrganizationServiceTextQueryMethod. + class OrganizationServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' + TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' + TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if OrganizationServiceTextQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::OrganizationServiceTextQueryMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for OrganizationServiceTextQueryMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/organization_service_update_organization_request.rb b/lib/zitadel/client/models/organization_service_update_organization_request.rb index 15e7ea67..40c6f910 100644 --- a/lib/zitadel/client/models/organization_service_update_organization_request.rb +++ b/lib/zitadel/client/models/organization_service_update_organization_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceUpdateOrganizationRequest - # OrganizationID is the unique identifier of the organization to be updated. - attr_accessor :organization_id - - # Name is the new name for the organization to be set. Note that since the name is used to generate the organization's default domain, changing the name will also change the domain. Additionally, if the domain is used as suffix for user logins, their login names will also change accordingly. It will not affect any custom domains added to the organization. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'name' => :'name' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceUpdateOrganizationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceUpdateOrganizationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceUpdateOrganizationRequest. + class OrganizationServiceUpdateOrganizationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + name: 'name' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization to be updated. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Name is the new name for the organization to be set. Note that since the name is used to generate the organization's default domain, changing the name will also change the domain. Additionally, if the domain is used as suffix for user logins, their login names will also change accordingly. It will not affect any custom domains added to the organization. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_update_organization_response.rb b/lib/zitadel/client/models/organization_service_update_organization_response.rb index fb29da9d..86a8e3b1 100644 --- a/lib/zitadel/client/models/organization_service_update_organization_response.rb +++ b/lib/zitadel/client/models/organization_service_update_organization_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceUpdateOrganizationResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceUpdateOrganizationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceUpdateOrganizationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceUpdateOrganizationResponse. + class OrganizationServiceUpdateOrganizationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_verify_organization_domain_request.rb b/lib/zitadel/client/models/organization_service_verify_organization_domain_request.rb index 65d402c3..4d7b044c 100644 --- a/lib/zitadel/client/models/organization_service_verify_organization_domain_request.rb +++ b/lib/zitadel/client/models/organization_service_verify_organization_domain_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceVerifyOrganizationDomainRequest - # Organization ID is the unique identifier of the organization whose domain is to be verified. - attr_accessor :organization_id - - # Domain is the full qualified domain name to be verified. - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceVerifyOrganizationDomainRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceVerifyOrganizationDomainRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceVerifyOrganizationDomainRequest. + class OrganizationServiceVerifyOrganizationDomainRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Organization ID is the unique identifier of the organization whose domain is to be verified. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # Domain is the full qualified domain name to be verified. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/organization_service_verify_organization_domain_response.rb b/lib/zitadel/client/models/organization_service_verify_organization_domain_response.rb index 231d05a3..77a264e4 100644 --- a/lib/zitadel/client/models/organization_service_verify_organization_domain_response.rb +++ b/lib/zitadel/client/models/organization_service_verify_organization_domain_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class OrganizationServiceVerifyOrganizationDomainResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::OrganizationServiceVerifyOrganizationDomainResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::OrganizationServiceVerifyOrganizationDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for OrganizationServiceVerifyOrganizationDomainResponse. + class OrganizationServiceVerifyOrganizationDomainResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_activate_project_grant_request.rb b/lib/zitadel/client/models/project_service_activate_project_grant_request.rb index d9e51bc9..56f846d6 100644 --- a/lib/zitadel/client/models/project_service_activate_project_grant_request.rb +++ b/lib/zitadel/client/models/project_service_activate_project_grant_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceActivateProjectGrantRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # GrantedOrganizationID is the unique identifier of the organization the project was granted to. - attr_accessor :granted_organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceActivateProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceActivateProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceActivateProjectGrantRequest. + class ProjectServiceActivateProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # GrantedOrganizationID is the unique identifier of the organization the project was granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_activate_project_grant_response.rb b/lib/zitadel/client/models/project_service_activate_project_grant_response.rb index 160a5822..5d3c187c 100644 --- a/lib/zitadel/client/models/project_service_activate_project_grant_response.rb +++ b/lib/zitadel/client/models/project_service_activate_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceActivateProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceActivateProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceActivateProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceActivateProjectGrantResponse. + class ProjectServiceActivateProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_activate_project_request.rb b/lib/zitadel/client/models/project_service_activate_project_request.rb index 2a82bb8e..50ca45b2 100644 --- a/lib/zitadel/client/models/project_service_activate_project_request.rb +++ b/lib/zitadel/client/models/project_service_activate_project_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceActivateProjectRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceActivateProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceActivateProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceActivateProjectRequest. + class ProjectServiceActivateProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_activate_project_response.rb b/lib/zitadel/client/models/project_service_activate_project_response.rb index aca878c5..941c255c 100644 --- a/lib/zitadel/client/models/project_service_activate_project_response.rb +++ b/lib/zitadel/client/models/project_service_activate_project_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceActivateProjectResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceActivateProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceActivateProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceActivateProjectResponse. + class ProjectServiceActivateProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_add_project_role_request.rb b/lib/zitadel/client/models/project_service_add_project_role_request.rb index 32930cb5..271ea658 100644 --- a/lib/zitadel/client/models/project_service_add_project_role_request.rb +++ b/lib/zitadel/client/models/project_service_add_project_role_request.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceAddProjectRoleRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # RoleKey identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. - attr_accessor :role_key - - # DisplayName is a human readable name for the role, which might be displayed to users. - attr_accessor :display_name - - # Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. This attribute is not to be confused with groups as a collection of users. - attr_accessor :group - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'role_key' => :'roleKey', - :'display_name' => :'displayName', - :'group' => :'group' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'role_key' => :'String', - :'display_name' => :'String', - :'group' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'group' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceAddProjectRoleRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceAddProjectRoleRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - role_key == o.role_key && - display_name == o.display_name && - group == o.group - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, role_key, display_name, group].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceAddProjectRoleRequest. + class ProjectServiceAddProjectRoleRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + role_key: 'roleKey', + display_name: 'displayName', + group: 'group' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + role_key: 'String', + display_name: 'String', + group: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # RoleKey identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) + # DisplayName is a human readable name for the role, which might be displayed to users. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. This attribute is not to be confused with groups as a collection of users. + # @example null + attribute :group, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_add_project_role_response.rb b/lib/zitadel/client/models/project_service_add_project_role_response.rb index 36aeec55..f6ba26d8 100644 --- a/lib/zitadel/client/models/project_service_add_project_role_response.rb +++ b/lib/zitadel/client/models/project_service_add_project_role_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceAddProjectRoleResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceAddProjectRoleResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceAddProjectRoleResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceAddProjectRoleResponse. + class ProjectServiceAddProjectRoleResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_any.rb b/lib/zitadel/client/models/project_service_any.rb index 43617370..03de48ba 100644 --- a/lib/zitadel/client/models/project_service_any.rb +++ b/lib/zitadel/client/models/project_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class ProjectServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class ProjectServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_connect_error.rb b/lib/zitadel/client/models/project_service_connect_error.rb index 5f71d7df..785a69ba 100644 --- a/lib/zitadel/client/models/project_service_connect_error.rb +++ b/lib/zitadel/client/models/project_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class ProjectServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class ProjectServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_create_project_grant_request.rb b/lib/zitadel/client/models/project_service_create_project_grant_request.rb index f124095a..58aaa577 100644 --- a/lib/zitadel/client/models/project_service_create_project_grant_request.rb +++ b/lib/zitadel/client/models/project_service_create_project_grant_request.rb @@ -1,238 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceCreateProjectGrantRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # GrantedOrganizationID is the unique identifier of the organization the project will be granted to. - attr_accessor :granted_organization_id - - # RoleKeys is a list of roles to be granted to the organization for self management. The roles are identified by their keys. - attr_accessor :role_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId', - :'role_keys' => :'roleKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String', - :'role_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceCreateProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceCreateProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - - if attributes.key?(:'role_keys') - if (value = attributes[:'role_keys']).is_a?(Array) - self.role_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id && - role_keys == o.role_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id, role_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceCreateProjectGrantRequest. + class ProjectServiceCreateProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId', + role_keys: 'roleKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String', + role_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # GrantedOrganizationID is the unique identifier of the organization the project will be granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) + # RoleKeys is a list of roles to be granted to the organization for self management. The roles are identified by their keys. + # @example null + attribute :role_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_create_project_grant_response.rb b/lib/zitadel/client/models/project_service_create_project_grant_response.rb index 6edc84c1..76682964 100644 --- a/lib/zitadel/client/models/project_service_create_project_grant_response.rb +++ b/lib/zitadel/client/models/project_service_create_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceCreateProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceCreateProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceCreateProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceCreateProjectGrantResponse. + class ProjectServiceCreateProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_create_project_request.rb b/lib/zitadel/client/models/project_service_create_project_request.rb index aa2108c3..9e17a2b7 100644 --- a/lib/zitadel/client/models/project_service_create_project_request.rb +++ b/lib/zitadel/client/models/project_service_create_project_request.rb @@ -1,298 +1,103 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceCreateProjectRequest - # OrganizationID is the unique identifier of the organization the project belongs to. - attr_accessor :organization_id - - # ProjectID is the unique identifier of the new project. This field is optional. If omitted, the system will generate a unique ID for you. This is the recommended way. The generated ID will be returned in the response. - attr_accessor :project_id - - # Name of the project. This might be presented to users, e.g. in sign-in flows. - attr_accessor :name - - # ProjectRoleAssertion is a setting that can be enabled to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types. - attr_accessor :project_role_assertion - - # AuthorizationRequired is a boolean flag that can be enabled to check if a user has an authorization to use this project assigned when login into an application of this project. - attr_accessor :authorization_required - - # ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted). - attr_accessor :project_access_required - - attr_accessor :private_labeling_setting - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'project_id' => :'projectId', - :'name' => :'name', - :'project_role_assertion' => :'projectRoleAssertion', - :'authorization_required' => :'authorizationRequired', - :'project_access_required' => :'projectAccessRequired', - :'private_labeling_setting' => :'privateLabelingSetting' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'project_id' => :'String', - :'name' => :'String', - :'project_role_assertion' => :'Boolean', - :'authorization_required' => :'Boolean', - :'project_access_required' => :'Boolean', - :'private_labeling_setting' => :'ProjectServicePrivateLabelingSetting' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'project_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceCreateProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceCreateProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'project_role_assertion') - self.project_role_assertion = attributes[:'project_role_assertion'] - end - - if attributes.key?(:'authorization_required') - self.authorization_required = attributes[:'authorization_required'] - end - - if attributes.key?(:'project_access_required') - self.project_access_required = attributes[:'project_access_required'] - end - - if attributes.key?(:'private_labeling_setting') - self.private_labeling_setting = attributes[:'private_labeling_setting'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - project_id == o.project_id && - name == o.name && - project_role_assertion == o.project_role_assertion && - authorization_required == o.authorization_required && - project_access_required == o.project_access_required && - private_labeling_setting == o.private_labeling_setting - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, project_id, name, project_role_assertion, authorization_required, project_access_required, private_labeling_setting].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceCreateProjectRequest. + class ProjectServiceCreateProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + project_id: 'projectId', + name: 'name', + project_role_assertion: 'projectRoleAssertion', + authorization_required: 'authorizationRequired', + project_access_required: 'projectAccessRequired', + private_labeling_setting: 'privateLabelingSetting' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + project_id: 'String', + name: 'String', + project_role_assertion: 'Boolean', + authorization_required: 'Boolean', + project_access_required: 'Boolean', + private_labeling_setting: 'ProjectServicePrivateLabelingSetting' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # OrganizationID is the unique identifier of the organization the project belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # ProjectID is the unique identifier of the new project. This field is optional. If omitted, the system will generate a unique ID for you. This is the recommended way. The generated ID will be returned in the response. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Name of the project. This might be presented to users, e.g. in sign-in flows. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # ProjectRoleAssertion is a setting that can be enabled to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types. + # @example null + attribute :project_role_assertion, Types::Any.optional.meta(omittable: true) + # AuthorizationRequired is a boolean flag that can be enabled to check if a user has an authorization to use this project assigned when login into an application of this project. + # @example null + attribute :authorization_required, Types::Any.optional.meta(omittable: true) + # ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted). + # @example null + attribute :project_access_required, Types::Any.optional.meta(omittable: true) + # @example null + attribute :private_labeling_setting, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_create_project_response.rb b/lib/zitadel/client/models/project_service_create_project_response.rb index c6ac82d1..a5fcca5d 100644 --- a/lib/zitadel/client/models/project_service_create_project_response.rb +++ b/lib/zitadel/client/models/project_service_create_project_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceCreateProjectResponse - # ProjectID is the unique identifier of the newly created project. - attr_accessor :project_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceCreateProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceCreateProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceCreateProjectResponse. + class ProjectServiceCreateProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the newly created project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_deactivate_project_grant_request.rb b/lib/zitadel/client/models/project_service_deactivate_project_grant_request.rb index bdee127f..e51bb7ea 100644 --- a/lib/zitadel/client/models/project_service_deactivate_project_grant_request.rb +++ b/lib/zitadel/client/models/project_service_deactivate_project_grant_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceDeactivateProjectGrantRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # GrantedOrganizationID is the unique identifier of the organization the project was granted to. - attr_accessor :granted_organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceDeactivateProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceDeactivateProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceDeactivateProjectGrantRequest. + class ProjectServiceDeactivateProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # GrantedOrganizationID is the unique identifier of the organization the project was granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_deactivate_project_grant_response.rb b/lib/zitadel/client/models/project_service_deactivate_project_grant_response.rb index 0e1317c5..89daf5d8 100644 --- a/lib/zitadel/client/models/project_service_deactivate_project_grant_response.rb +++ b/lib/zitadel/client/models/project_service_deactivate_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceDeactivateProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceDeactivateProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceDeactivateProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceDeactivateProjectGrantResponse. + class ProjectServiceDeactivateProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_deactivate_project_request.rb b/lib/zitadel/client/models/project_service_deactivate_project_request.rb index 42840ba3..fb43a1ea 100644 --- a/lib/zitadel/client/models/project_service_deactivate_project_request.rb +++ b/lib/zitadel/client/models/project_service_deactivate_project_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceDeactivateProjectRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceDeactivateProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceDeactivateProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceDeactivateProjectRequest. + class ProjectServiceDeactivateProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_deactivate_project_response.rb b/lib/zitadel/client/models/project_service_deactivate_project_response.rb index 8b612ba0..366a063c 100644 --- a/lib/zitadel/client/models/project_service_deactivate_project_response.rb +++ b/lib/zitadel/client/models/project_service_deactivate_project_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceDeactivateProjectResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceDeactivateProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceDeactivateProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceDeactivateProjectResponse. + class ProjectServiceDeactivateProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_delete_project_grant_request.rb b/lib/zitadel/client/models/project_service_delete_project_grant_request.rb index 14729ca3..3215a77b 100644 --- a/lib/zitadel/client/models/project_service_delete_project_grant_request.rb +++ b/lib/zitadel/client/models/project_service_delete_project_grant_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceDeleteProjectGrantRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # GrantedOrganizationID is the unique identifier of the organization the project was granted to. - attr_accessor :granted_organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceDeleteProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceDeleteProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceDeleteProjectGrantRequest. + class ProjectServiceDeleteProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # GrantedOrganizationID is the unique identifier of the organization the project was granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_delete_project_grant_response.rb b/lib/zitadel/client/models/project_service_delete_project_grant_response.rb index cfd0d688..d6c16317 100644 --- a/lib/zitadel/client/models/project_service_delete_project_grant_response.rb +++ b/lib/zitadel/client/models/project_service_delete_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceDeleteProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceDeleteProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceDeleteProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceDeleteProjectGrantResponse. + class ProjectServiceDeleteProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_delete_project_request.rb b/lib/zitadel/client/models/project_service_delete_project_request.rb index b33e2c8b..954b78e8 100644 --- a/lib/zitadel/client/models/project_service_delete_project_request.rb +++ b/lib/zitadel/client/models/project_service_delete_project_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceDeleteProjectRequest - # ProjectID is the unique identifier of the project to be deleted. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceDeleteProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceDeleteProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceDeleteProjectRequest. + class ProjectServiceDeleteProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project to be deleted. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_delete_project_response.rb b/lib/zitadel/client/models/project_service_delete_project_response.rb index dd505dbe..2e57c84c 100644 --- a/lib/zitadel/client/models/project_service_delete_project_response.rb +++ b/lib/zitadel/client/models/project_service_delete_project_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceDeleteProjectResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceDeleteProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceDeleteProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceDeleteProjectResponse. + class ProjectServiceDeleteProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_get_project_request.rb b/lib/zitadel/client/models/project_service_get_project_request.rb index 424271c3..d7b5d5c6 100644 --- a/lib/zitadel/client/models/project_service_get_project_request.rb +++ b/lib/zitadel/client/models/project_service_get_project_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceGetProjectRequest - # ProjectID is the unique identifier of the project to be retrieved. - attr_accessor :project_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceGetProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceGetProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceGetProjectRequest. + class ProjectServiceGetProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project to be retrieved. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_get_project_response.rb b/lib/zitadel/client/models/project_service_get_project_response.rb index e6257a26..bc57546f 100644 --- a/lib/zitadel/client/models/project_service_get_project_response.rb +++ b/lib/zitadel/client/models/project_service_get_project_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceGetProjectResponse - attr_accessor :project - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project' => :'project' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project' => :'ProjectServiceProject' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceGetProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceGetProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project') - self.project = attributes[:'project'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project == o.project - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceGetProjectResponse. + class ProjectServiceGetProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project: 'project' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project: 'ProjectServiceProject' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :project, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_granted_project_state.rb b/lib/zitadel/client/models/project_service_granted_project_state.rb index 6b6dbba7..fd9175b3 100644 --- a/lib/zitadel/client/models/project_service_granted_project_state.rb +++ b/lib/zitadel/client/models/project_service_granted_project_state.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ProjectServiceGrantedProjectState - GRANTED_PROJECT_STATE_UNSPECIFIED = "GRANTED_PROJECT_STATE_UNSPECIFIED".freeze - GRANTED_PROJECT_STATE_ACTIVE = "GRANTED_PROJECT_STATE_ACTIVE".freeze - GRANTED_PROJECT_STATE_INACTIVE = "GRANTED_PROJECT_STATE_INACTIVE".freeze - - def self.all_vars - @all_vars ||= [GRANTED_PROJECT_STATE_UNSPECIFIED, GRANTED_PROJECT_STATE_ACTIVE, GRANTED_PROJECT_STATE_INACTIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ProjectServiceGrantedProjectState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ProjectServiceGrantedProjectState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ProjectServiceGrantedProjectState. + class ProjectServiceGrantedProjectState + GRANTED_PROJECT_STATE_UNSPECIFIED = 'GRANTED_PROJECT_STATE_UNSPECIFIED' + GRANTED_PROJECT_STATE_ACTIVE = 'GRANTED_PROJECT_STATE_ACTIVE' + GRANTED_PROJECT_STATE_INACTIVE = 'GRANTED_PROJECT_STATE_INACTIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [GRANTED_PROJECT_STATE_UNSPECIFIED, GRANTED_PROJECT_STATE_ACTIVE, GRANTED_PROJECT_STATE_INACTIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ProjectServiceGrantedProjectState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/project_service_i_d_filter.rb b/lib/zitadel/client/models/project_service_i_d_filter.rb deleted file mode 100644 index bc218ff0..00000000 --- a/lib/zitadel/client/models/project_service_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ProjectServiceIDFilter - # Only return resources that belong to this id. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/project_service_id_filter.rb b/lib/zitadel/client/models/project_service_id_filter.rb new file mode 100644 index 00000000..3c99d39e --- /dev/null +++ b/lib/zitadel/client/models/project_service_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceIDFilter. + class ProjectServiceIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Only return resources that belong to this id. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/project_service_in_i_ds_filter.rb b/lib/zitadel/client/models/project_service_in_i_ds_filter.rb deleted file mode 100644 index d3d5a147..00000000 --- a/lib/zitadel/client/models/project_service_in_i_ds_filter.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ProjectServiceInIDsFilter - # Defines the ids to query for. - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceInIDsFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceInIDsFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/project_service_in_ids_filter.rb b/lib/zitadel/client/models/project_service_in_ids_filter.rb new file mode 100644 index 00000000..3e233de3 --- /dev/null +++ b/lib/zitadel/client/models/project_service_in_ids_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceInIDsFilter. + class ProjectServiceInIDsFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Defines the ids to query for. + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/project_service_list_project_grants_request.rb b/lib/zitadel/client/models/project_service_list_project_grants_request.rb index 460bb075..af378cc3 100644 --- a/lib/zitadel/client/models/project_service_list_project_grants_request.rb +++ b/lib/zitadel/client/models/project_service_list_project_grants_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceListProjectGrantsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Filters define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ProjectServicePaginationRequest', - :'sorting_column' => :'ProjectServiceProjectGrantFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceListProjectGrantsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceListProjectGrantsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceListProjectGrantsRequest. + class ProjectServiceListProjectGrantsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ProjectServicePaginationRequest', + sorting_column: 'ProjectServiceProjectGrantFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Filters define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_list_project_grants_response.rb b/lib/zitadel/client/models/project_service_list_project_grants_response.rb index 05067a46..81afaa4a 100644 --- a/lib/zitadel/client/models/project_service_list_project_grants_response.rb +++ b/lib/zitadel/client/models/project_service_list_project_grants_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceListProjectGrantsResponse - attr_accessor :pagination - - # ProjectGrants is a list of project grants matching the query. - attr_accessor :project_grants - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'project_grants' => :'projectGrants' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ProjectServicePaginationResponse', - :'project_grants' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceListProjectGrantsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceListProjectGrantsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'project_grants') - if (value = attributes[:'project_grants']).is_a?(Array) - self.project_grants = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - project_grants == o.project_grants - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, project_grants].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceListProjectGrantsResponse. + class ProjectServiceListProjectGrantsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + project_grants: 'projectGrants' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ProjectServicePaginationResponse', + project_grants: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # ProjectGrants is a list of project grants matching the query. + # @example null + attribute :project_grants, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_list_project_roles_request.rb b/lib/zitadel/client/models/project_service_list_project_roles_request.rb index dce6b514..ed52c7e4 100644 --- a/lib/zitadel/client/models/project_service_list_project_roles_request.rb +++ b/lib/zitadel/client/models/project_service_list_project_roles_request.rb @@ -1,268 +1,87 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceListProjectRolesRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - attr_accessor :pagination - - attr_accessor :sorting_column - - # Filters define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'pagination' => :'ProjectServicePaginationRequest', - :'sorting_column' => :'ProjectServiceProjectRoleFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceListProjectRolesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceListProjectRolesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceListProjectRolesRequest. + class ProjectServiceListProjectRolesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + pagination: 'ProjectServicePaginationRequest', + sorting_column: 'ProjectServiceProjectRoleFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Filters define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_list_project_roles_response.rb b/lib/zitadel/client/models/project_service_list_project_roles_response.rb index 1140c131..d3f97c15 100644 --- a/lib/zitadel/client/models/project_service_list_project_roles_response.rb +++ b/lib/zitadel/client/models/project_service_list_project_roles_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceListProjectRolesResponse - attr_accessor :pagination - - # ProjectRoles is a list of roles matching the query. - attr_accessor :project_roles - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'project_roles' => :'projectRoles' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ProjectServicePaginationResponse', - :'project_roles' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceListProjectRolesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceListProjectRolesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'project_roles') - if (value = attributes[:'project_roles']).is_a?(Array) - self.project_roles = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - project_roles == o.project_roles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, project_roles].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceListProjectRolesResponse. + class ProjectServiceListProjectRolesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + project_roles: 'projectRoles' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ProjectServicePaginationResponse', + project_roles: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # ProjectRoles is a list of roles matching the query. + # @example null + attribute :project_roles, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_list_projects_request.rb b/lib/zitadel/client/models/project_service_list_projects_request.rb index 24ad991e..eed8bca0 100644 --- a/lib/zitadel/client/models/project_service_list_projects_request.rb +++ b/lib/zitadel/client/models/project_service_list_projects_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceListProjectsRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Filters define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ProjectServicePaginationRequest', - :'sorting_column' => :'ProjectServiceProjectFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceListProjectsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceListProjectsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceListProjectsRequest. + class ProjectServiceListProjectsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ProjectServicePaginationRequest', + sorting_column: 'ProjectServiceProjectFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Filters define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_list_projects_response.rb b/lib/zitadel/client/models/project_service_list_projects_response.rb index 8398a486..08e29f4c 100644 --- a/lib/zitadel/client/models/project_service_list_projects_response.rb +++ b/lib/zitadel/client/models/project_service_list_projects_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceListProjectsResponse - attr_accessor :pagination - - # Projects is a list of projects matching the query. - attr_accessor :projects - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'projects' => :'projects' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'ProjectServicePaginationResponse', - :'projects' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceListProjectsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceListProjectsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'projects') - if (value = attributes[:'projects']).is_a?(Array) - self.projects = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - projects == o.projects - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, projects].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceListProjectsResponse. + class ProjectServiceListProjectsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + projects: 'projects' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'ProjectServicePaginationResponse', + projects: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Projects is a list of projects matching the query. + # @example null + attribute :projects, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_pagination_request.rb b/lib/zitadel/client/models/project_service_pagination_request.rb index b55771a1..7684337e 100644 --- a/lib/zitadel/client/models/project_service_pagination_request.rb +++ b/lib/zitadel/client/models/project_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServicePaginationRequest. + class ProjectServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_pagination_response.rb b/lib/zitadel/client/models/project_service_pagination_response.rb index 444fb239..333f2fe3 100644 --- a/lib/zitadel/client/models/project_service_pagination_response.rb +++ b/lib/zitadel/client/models/project_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServicePaginationResponse. + class ProjectServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_private_labeling_setting.rb b/lib/zitadel/client/models/project_service_private_labeling_setting.rb index 9a062b72..6479f792 100644 --- a/lib/zitadel/client/models/project_service_private_labeling_setting.rb +++ b/lib/zitadel/client/models/project_service_private_labeling_setting.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ProjectServicePrivateLabelingSetting - PRIVATE_LABELING_SETTING_UNSPECIFIED = "PRIVATE_LABELING_SETTING_UNSPECIFIED".freeze - PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY = "PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY".freeze - PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY = "PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY".freeze - - def self.all_vars - @all_vars ||= [PRIVATE_LABELING_SETTING_UNSPECIFIED, PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY, PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ProjectServicePrivateLabelingSetting.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ProjectServicePrivateLabelingSetting" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ProjectServicePrivateLabelingSetting. + class ProjectServicePrivateLabelingSetting + PRIVATE_LABELING_SETTING_UNSPECIFIED = 'PRIVATE_LABELING_SETTING_UNSPECIFIED' + PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY = 'PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY' + PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY = 'PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY' + + # Frozen set of all allowed values, used for validation. + VALUES = [PRIVATE_LABELING_SETTING_UNSPECIFIED, PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY, PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ProjectServicePrivateLabelingSetting: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/project_service_project.rb b/lib/zitadel/client/models/project_service_project.rb index 0123da7f..f516382d 100644 --- a/lib/zitadel/client/models/project_service_project.rb +++ b/lib/zitadel/client/models/project_service_project.rb @@ -1,357 +1,131 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceProject - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # OrganizationID is the unique identifier of the organization the project belongs to. - attr_accessor :organization_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Name is the name of the project. This might be presented to users, e.g. in sign-in flows. - attr_accessor :name - - attr_accessor :state - - # ProjectRoleAssertion is a boolean flag that describes if the roles of the user should be added to the token. - attr_accessor :project_role_assertion - - # AuthorizationRequired is a boolean flag that can be enabled to check if a user has an authorization to use this project assigned when login into an application of this project. - attr_accessor :authorization_required - - # ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted). - attr_accessor :project_access_required - - attr_accessor :private_labeling_setting - - # GrantedOrganizationID is the ID of the organization the project is granted to. In case the project is not granted, this field is unset. - attr_accessor :granted_organization_id - - # GrantedOrganizationName is the name of the organization the project is granted to. In case the project is not granted, this field is unset. - attr_accessor :granted_organization_name - - attr_accessor :granted_state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'organization_id' => :'organizationId', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'name' => :'name', - :'state' => :'state', - :'project_role_assertion' => :'projectRoleAssertion', - :'authorization_required' => :'authorizationRequired', - :'project_access_required' => :'projectAccessRequired', - :'private_labeling_setting' => :'privateLabelingSetting', - :'granted_organization_id' => :'grantedOrganizationId', - :'granted_organization_name' => :'grantedOrganizationName', - :'granted_state' => :'grantedState' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'organization_id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'name' => :'String', - :'state' => :'ProjectServiceProjectState', - :'project_role_assertion' => :'Boolean', - :'authorization_required' => :'Boolean', - :'project_access_required' => :'Boolean', - :'private_labeling_setting' => :'ProjectServicePrivateLabelingSetting', - :'granted_organization_id' => :'String', - :'granted_organization_name' => :'String', - :'granted_state' => :'ProjectServiceGrantedProjectState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'granted_organization_id', - :'granted_organization_name', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'project_role_assertion') - self.project_role_assertion = attributes[:'project_role_assertion'] - end - - if attributes.key?(:'authorization_required') - self.authorization_required = attributes[:'authorization_required'] - end - - if attributes.key?(:'project_access_required') - self.project_access_required = attributes[:'project_access_required'] - end - - if attributes.key?(:'private_labeling_setting') - self.private_labeling_setting = attributes[:'private_labeling_setting'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - - if attributes.key?(:'granted_organization_name') - self.granted_organization_name = attributes[:'granted_organization_name'] - end - - if attributes.key?(:'granted_state') - self.granted_state = attributes[:'granted_state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - organization_id == o.organization_id && - creation_date == o.creation_date && - change_date == o.change_date && - name == o.name && - state == o.state && - project_role_assertion == o.project_role_assertion && - authorization_required == o.authorization_required && - project_access_required == o.project_access_required && - private_labeling_setting == o.private_labeling_setting && - granted_organization_id == o.granted_organization_id && - granted_organization_name == o.granted_organization_name && - granted_state == o.granted_state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, organization_id, creation_date, change_date, name, state, project_role_assertion, authorization_required, project_access_required, private_labeling_setting, granted_organization_id, granted_organization_name, granted_state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProject. + class ProjectServiceProject < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + organization_id: 'organizationId', + creation_date: 'creationDate', + change_date: 'changeDate', + name: 'name', + state: 'state', + project_role_assertion: 'projectRoleAssertion', + authorization_required: 'authorizationRequired', + project_access_required: 'projectAccessRequired', + private_labeling_setting: 'privateLabelingSetting', + granted_organization_id: 'grantedOrganizationId', + granted_organization_name: 'grantedOrganizationName', + granted_state: 'grantedState' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + organization_id: 'String', + creation_date: 'Time', + change_date: 'Time', + name: 'String', + state: 'ProjectServiceProjectState', + project_role_assertion: 'Boolean', + authorization_required: 'Boolean', + project_access_required: 'Boolean', + private_labeling_setting: 'ProjectServicePrivateLabelingSetting', + granted_organization_id: 'String', + granted_organization_name: 'String', + granted_state: 'ProjectServiceGrantedProjectState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # OrganizationID is the unique identifier of the organization the project belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # Name is the name of the project. This might be presented to users, e.g. in sign-in flows. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # ProjectRoleAssertion is a boolean flag that describes if the roles of the user should be added to the token. + # @example null + attribute :project_role_assertion, Types::Any.optional.meta(omittable: true) + # AuthorizationRequired is a boolean flag that can be enabled to check if a user has an authorization to use this project assigned when login into an application of this project. + # @example null + attribute :authorization_required, Types::Any.optional.meta(omittable: true) + # ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted). + # @example null + attribute :project_access_required, Types::Any.optional.meta(omittable: true) + # @example null + attribute :private_labeling_setting, Types::Any.optional.meta(omittable: true) + # GrantedOrganizationID is the ID of the organization the project is granted to. In case the project is not granted, this field is unset. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) + # GrantedOrganizationName is the name of the organization the project is granted to. In case the project is not granted, this field is unset. + # @example null + attribute :granted_organization_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :granted_state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_project_field_name.rb b/lib/zitadel/client/models/project_service_project_field_name.rb index 0b8dd0c9..73b4d392 100644 --- a/lib/zitadel/client/models/project_service_project_field_name.rb +++ b/lib/zitadel/client/models/project_service_project_field_name.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class ProjectServiceProjectFieldName - PROJECT_FIELD_NAME_UNSPECIFIED = "PROJECT_FIELD_NAME_UNSPECIFIED".freeze - PROJECT_FIELD_NAME_ID = "PROJECT_FIELD_NAME_ID".freeze - PROJECT_FIELD_NAME_CREATION_DATE = "PROJECT_FIELD_NAME_CREATION_DATE".freeze - PROJECT_FIELD_NAME_CHANGE_DATE = "PROJECT_FIELD_NAME_CHANGE_DATE".freeze - PROJECT_FIELD_NAME_NAME = "PROJECT_FIELD_NAME_NAME".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ProjectServiceProjectFieldName. + class ProjectServiceProjectFieldName + PROJECT_FIELD_NAME_UNSPECIFIED = 'PROJECT_FIELD_NAME_UNSPECIFIED' + PROJECT_FIELD_NAME_ID = 'PROJECT_FIELD_NAME_ID' + PROJECT_FIELD_NAME_CREATION_DATE = 'PROJECT_FIELD_NAME_CREATION_DATE' + PROJECT_FIELD_NAME_CHANGE_DATE = 'PROJECT_FIELD_NAME_CHANGE_DATE' + PROJECT_FIELD_NAME_NAME = 'PROJECT_FIELD_NAME_NAME' - def self.all_vars - @all_vars ||= [PROJECT_FIELD_NAME_UNSPECIFIED, PROJECT_FIELD_NAME_ID, PROJECT_FIELD_NAME_CREATION_DATE, PROJECT_FIELD_NAME_CHANGE_DATE, PROJECT_FIELD_NAME_NAME].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_FIELD_NAME_UNSPECIFIED, PROJECT_FIELD_NAME_ID, PROJECT_FIELD_NAME_CREATION_DATE, PROJECT_FIELD_NAME_CHANGE_DATE, PROJECT_FIELD_NAME_NAME].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ProjectServiceProjectFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ProjectServiceProjectFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ProjectServiceProjectFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/project_service_project_grant.rb b/lib/zitadel/client/models/project_service_project_grant.rb index 7d4c4343..7ebf7fe4 100644 --- a/lib/zitadel/client/models/project_service_project_grant.rb +++ b/lib/zitadel/client/models/project_service_project_grant.rb @@ -1,319 +1,113 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceProjectGrant - # The unique identifier of the organization which granted the project to the granted_organization_id. - attr_accessor :organization_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # The ID of the organization the project is granted to. - attr_accessor :granted_organization_id - - # The name of the organization the project is granted to. - attr_accessor :granted_organization_name - - # The roles granted to the organization for self-management of the project. - attr_accessor :granted_role_keys - - # The ID of the granted project. - attr_accessor :project_id - - # The name of the granted project. - attr_accessor :project_name - - attr_accessor :state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'granted_organization_id' => :'grantedOrganizationId', - :'granted_organization_name' => :'grantedOrganizationName', - :'granted_role_keys' => :'grantedRoleKeys', - :'project_id' => :'projectId', - :'project_name' => :'projectName', - :'state' => :'state' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'granted_organization_id' => :'String', - :'granted_organization_name' => :'String', - :'granted_role_keys' => :'Array', - :'project_id' => :'String', - :'project_name' => :'String', - :'state' => :'ProjectServiceProjectGrantState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProjectGrant` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProjectGrant`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - - if attributes.key?(:'granted_organization_name') - self.granted_organization_name = attributes[:'granted_organization_name'] - end - - if attributes.key?(:'granted_role_keys') - if (value = attributes[:'granted_role_keys']).is_a?(Array) - self.granted_role_keys = value - end - end - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'project_name') - self.project_name = attributes[:'project_name'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - creation_date == o.creation_date && - change_date == o.change_date && - granted_organization_id == o.granted_organization_id && - granted_organization_name == o.granted_organization_name && - granted_role_keys == o.granted_role_keys && - project_id == o.project_id && - project_name == o.project_name && - state == o.state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, creation_date, change_date, granted_organization_id, granted_organization_name, granted_role_keys, project_id, project_name, state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProjectGrant. + class ProjectServiceProjectGrant < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + creation_date: 'creationDate', + change_date: 'changeDate', + granted_organization_id: 'grantedOrganizationId', + granted_organization_name: 'grantedOrganizationName', + granted_role_keys: 'grantedRoleKeys', + project_id: 'projectId', + project_name: 'projectName', + state: 'state' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + creation_date: 'Time', + change_date: 'Time', + granted_organization_id: 'String', + granted_organization_name: 'String', + granted_role_keys: 'Array', + project_id: 'String', + project_name: 'String', + state: 'ProjectServiceProjectGrantState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the organization which granted the project to the granted_organization_id. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # The ID of the organization the project is granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) + # The name of the organization the project is granted to. + # @example null + attribute :granted_organization_name, Types::Any.optional.meta(omittable: true) + # The roles granted to the organization for self-management of the project. + # @example null + attribute :granted_role_keys, Types::Any.optional.meta(omittable: true) + # The ID of the granted project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # The name of the granted project. + # @example null + attribute :project_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_project_grant_field_name.rb b/lib/zitadel/client/models/project_service_project_grant_field_name.rb index 1fb85eb2..3c3273ef 100644 --- a/lib/zitadel/client/models/project_service_project_grant_field_name.rb +++ b/lib/zitadel/client/models/project_service_project_grant_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ProjectServiceProjectGrantFieldName - PROJECT_GRANT_FIELD_NAME_UNSPECIFIED = "PROJECT_GRANT_FIELD_NAME_UNSPECIFIED".freeze - PROJECT_GRANT_FIELD_NAME_PROJECT_ID = "PROJECT_GRANT_FIELD_NAME_PROJECT_ID".freeze - PROJECT_GRANT_FIELD_NAME_CREATION_DATE = "PROJECT_GRANT_FIELD_NAME_CREATION_DATE".freeze - PROJECT_GRANT_FIELD_NAME_CHANGE_DATE = "PROJECT_GRANT_FIELD_NAME_CHANGE_DATE".freeze - - def self.all_vars - @all_vars ||= [PROJECT_GRANT_FIELD_NAME_UNSPECIFIED, PROJECT_GRANT_FIELD_NAME_PROJECT_ID, PROJECT_GRANT_FIELD_NAME_CREATION_DATE, PROJECT_GRANT_FIELD_NAME_CHANGE_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ProjectServiceProjectGrantFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ProjectServiceProjectGrantFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ProjectServiceProjectGrantFieldName. + class ProjectServiceProjectGrantFieldName + PROJECT_GRANT_FIELD_NAME_UNSPECIFIED = 'PROJECT_GRANT_FIELD_NAME_UNSPECIFIED' + PROJECT_GRANT_FIELD_NAME_PROJECT_ID = 'PROJECT_GRANT_FIELD_NAME_PROJECT_ID' + PROJECT_GRANT_FIELD_NAME_CREATION_DATE = 'PROJECT_GRANT_FIELD_NAME_CREATION_DATE' + PROJECT_GRANT_FIELD_NAME_CHANGE_DATE = 'PROJECT_GRANT_FIELD_NAME_CHANGE_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_GRANT_FIELD_NAME_UNSPECIFIED, PROJECT_GRANT_FIELD_NAME_PROJECT_ID, PROJECT_GRANT_FIELD_NAME_CREATION_DATE, PROJECT_GRANT_FIELD_NAME_CHANGE_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ProjectServiceProjectGrantFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/project_service_project_grant_search_filter.rb b/lib/zitadel/client/models/project_service_project_grant_search_filter.rb index b72d5ea8..3dc2e6d4 100644 --- a/lib/zitadel/client/models/project_service_project_grant_search_filter.rb +++ b/lib/zitadel/client/models/project_service_project_grant_search_filter.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceProjectGrantSearchFilter - attr_accessor :granted_organization_id_filter - - attr_accessor :in_project_ids_filter - - attr_accessor :organization_id_filter - - attr_accessor :project_name_filter - - attr_accessor :role_key_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'granted_organization_id_filter' => :'grantedOrganizationIdFilter', - :'in_project_ids_filter' => :'inProjectIdsFilter', - :'organization_id_filter' => :'organizationIdFilter', - :'project_name_filter' => :'projectNameFilter', - :'role_key_filter' => :'roleKeyFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'granted_organization_id_filter' => :'ProjectServiceIDFilter', - :'in_project_ids_filter' => :'ProjectServiceInIDsFilter', - :'organization_id_filter' => :'ProjectServiceIDFilter', - :'project_name_filter' => :'ProjectServiceProjectNameFilter', - :'role_key_filter' => :'ProjectServiceProjectRoleKeyFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProjectGrantSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProjectGrantSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'granted_organization_id_filter') - self.granted_organization_id_filter = attributes[:'granted_organization_id_filter'] - end - - if attributes.key?(:'in_project_ids_filter') - self.in_project_ids_filter = attributes[:'in_project_ids_filter'] - end - - if attributes.key?(:'organization_id_filter') - self.organization_id_filter = attributes[:'organization_id_filter'] - end - - if attributes.key?(:'project_name_filter') - self.project_name_filter = attributes[:'project_name_filter'] - end - - if attributes.key?(:'role_key_filter') - self.role_key_filter = attributes[:'role_key_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - granted_organization_id_filter == o.granted_organization_id_filter && - in_project_ids_filter == o.in_project_ids_filter && - organization_id_filter == o.organization_id_filter && - project_name_filter == o.project_name_filter && - role_key_filter == o.role_key_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [granted_organization_id_filter, in_project_ids_filter, organization_id_filter, project_name_filter, role_key_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProjectGrantSearchFilter. + class ProjectServiceProjectGrantSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + granted_organization_id_filter: 'grantedOrganizationIdFilter', + in_project_ids_filter: 'inProjectIdsFilter', + organization_id_filter: 'organizationIdFilter', + project_name_filter: 'projectNameFilter', + role_key_filter: 'roleKeyFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + granted_organization_id_filter: 'ProjectServiceIDFilter', + in_project_ids_filter: 'ProjectServiceInIDsFilter', + organization_id_filter: 'ProjectServiceIDFilter', + project_name_filter: 'ProjectServiceProjectNameFilter', + role_key_filter: 'ProjectServiceProjectRoleKeyFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :granted_organization_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_project_ids_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_name_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :role_key_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_project_grant_state.rb b/lib/zitadel/client/models/project_service_project_grant_state.rb index 50b2714e..5d203498 100644 --- a/lib/zitadel/client/models/project_service_project_grant_state.rb +++ b/lib/zitadel/client/models/project_service_project_grant_state.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ProjectServiceProjectGrantState - PROJECT_GRANT_STATE_UNSPECIFIED = "PROJECT_GRANT_STATE_UNSPECIFIED".freeze - PROJECT_GRANT_STATE_ACTIVE = "PROJECT_GRANT_STATE_ACTIVE".freeze - PROJECT_GRANT_STATE_INACTIVE = "PROJECT_GRANT_STATE_INACTIVE".freeze - - def self.all_vars - @all_vars ||= [PROJECT_GRANT_STATE_UNSPECIFIED, PROJECT_GRANT_STATE_ACTIVE, PROJECT_GRANT_STATE_INACTIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ProjectServiceProjectGrantState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ProjectServiceProjectGrantState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ProjectServiceProjectGrantState. + class ProjectServiceProjectGrantState + PROJECT_GRANT_STATE_UNSPECIFIED = 'PROJECT_GRANT_STATE_UNSPECIFIED' + PROJECT_GRANT_STATE_ACTIVE = 'PROJECT_GRANT_STATE_ACTIVE' + PROJECT_GRANT_STATE_INACTIVE = 'PROJECT_GRANT_STATE_INACTIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_GRANT_STATE_UNSPECIFIED, PROJECT_GRANT_STATE_ACTIVE, PROJECT_GRANT_STATE_INACTIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ProjectServiceProjectGrantState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/project_service_project_name_filter.rb b/lib/zitadel/client/models/project_service_project_name_filter.rb index b3818dec..15073d0f 100644 --- a/lib/zitadel/client/models/project_service_project_name_filter.rb +++ b/lib/zitadel/client/models/project_service_project_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceProjectNameFilter - # Defines the name of the project to query for. - attr_accessor :project_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_name' => :'projectName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_name' => :'String', - :'method' => :'ProjectServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProjectNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProjectNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_name') - self.project_name = attributes[:'project_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_name == o.project_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProjectNameFilter. + class ProjectServiceProjectNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_name: 'projectName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_name: 'String', + method: 'ProjectServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Defines the name of the project to query for. + # @example null + attribute :project_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_project_organization_i_d_filter.rb b/lib/zitadel/client/models/project_service_project_organization_i_d_filter.rb deleted file mode 100644 index e5beee4a..00000000 --- a/lib/zitadel/client/models/project_service_project_organization_i_d_filter.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class ProjectServiceProjectOrganizationIDFilter - # OrganizationID Is the ID of the organization to query for. - attr_accessor :organization_id - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'type' => :'type' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'type' => :'ProjectServiceType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProjectOrganizationIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProjectOrganizationIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/project_service_project_organization_id_filter.rb b/lib/zitadel/client/models/project_service_project_organization_id_filter.rb new file mode 100644 index 00000000..95047ddb --- /dev/null +++ b/lib/zitadel/client/models/project_service_project_organization_id_filter.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProjectOrganizationIDFilter. + class ProjectServiceProjectOrganizationIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + type: 'type' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + type: 'ProjectServiceType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # OrganizationID Is the ID of the organization to query for. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/project_service_project_role.rb b/lib/zitadel/client/models/project_service_project_role.rb index de1e0c31..a8ac52f6 100644 --- a/lib/zitadel/client/models/project_service_project_role.rb +++ b/lib/zitadel/client/models/project_service_project_role.rb @@ -1,266 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceProjectRole - # ProjectID is the ID of the project the role belongs to. - attr_accessor :project_id - - # Key of the project role. The key identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. - attr_accessor :key - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # DisplayName is a human readable name for the role, which might be displayed to users. - attr_accessor :display_name - - # Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. This attribute is not to be confused with groups as a collection of users. - attr_accessor :group - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'key' => :'key', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'display_name' => :'displayName', - :'group' => :'group' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'key' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'display_name' => :'String', - :'group' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProjectRole` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProjectRole`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - key == o.key && - creation_date == o.creation_date && - change_date == o.change_date && - display_name == o.display_name && - group == o.group - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, key, creation_date, change_date, display_name, group].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProjectRole. + class ProjectServiceProjectRole < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + key: 'key', + creation_date: 'creationDate', + change_date: 'changeDate', + display_name: 'displayName', + group: 'group' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + key: 'String', + creation_date: 'Time', + change_date: 'Time', + display_name: 'String', + group: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the ID of the project the role belongs to. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Key of the project role. The key identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # DisplayName is a human readable name for the role, which might be displayed to users. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. This attribute is not to be confused with groups as a collection of users. + # @example null + attribute :group, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_project_role_display_name_filter.rb b/lib/zitadel/client/models/project_service_project_role_display_name_filter.rb index 87cd2eec..192b4241 100644 --- a/lib/zitadel/client/models/project_service_project_role_display_name_filter.rb +++ b/lib/zitadel/client/models/project_service_project_role_display_name_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceProjectRoleDisplayNameFilter - # The display name of the project role to query for. - attr_accessor :display_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name' => :'displayName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name' => :'String', - :'method' => :'ProjectServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProjectRoleDisplayNameFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProjectRoleDisplayNameFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name == o.display_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProjectRoleDisplayNameFilter. + class ProjectServiceProjectRoleDisplayNameFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name: 'displayName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name: 'String', + method: 'ProjectServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The display name of the project role to query for. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_project_role_field_name.rb b/lib/zitadel/client/models/project_service_project_role_field_name.rb index 2c2b4b07..5bf0535f 100644 --- a/lib/zitadel/client/models/project_service_project_role_field_name.rb +++ b/lib/zitadel/client/models/project_service_project_role_field_name.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ProjectServiceProjectRoleFieldName - PROJECT_ROLE_FIELD_NAME_UNSPECIFIED = "PROJECT_ROLE_FIELD_NAME_UNSPECIFIED".freeze - PROJECT_ROLE_FIELD_NAME_KEY = "PROJECT_ROLE_FIELD_NAME_KEY".freeze - PROJECT_ROLE_FIELD_NAME_CREATION_DATE = "PROJECT_ROLE_FIELD_NAME_CREATION_DATE".freeze - PROJECT_ROLE_FIELD_NAME_CHANGE_DATE = "PROJECT_ROLE_FIELD_NAME_CHANGE_DATE".freeze - - def self.all_vars - @all_vars ||= [PROJECT_ROLE_FIELD_NAME_UNSPECIFIED, PROJECT_ROLE_FIELD_NAME_KEY, PROJECT_ROLE_FIELD_NAME_CREATION_DATE, PROJECT_ROLE_FIELD_NAME_CHANGE_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ProjectServiceProjectRoleFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ProjectServiceProjectRoleFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ProjectServiceProjectRoleFieldName. + class ProjectServiceProjectRoleFieldName + PROJECT_ROLE_FIELD_NAME_UNSPECIFIED = 'PROJECT_ROLE_FIELD_NAME_UNSPECIFIED' + PROJECT_ROLE_FIELD_NAME_KEY = 'PROJECT_ROLE_FIELD_NAME_KEY' + PROJECT_ROLE_FIELD_NAME_CREATION_DATE = 'PROJECT_ROLE_FIELD_NAME_CREATION_DATE' + PROJECT_ROLE_FIELD_NAME_CHANGE_DATE = 'PROJECT_ROLE_FIELD_NAME_CHANGE_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_ROLE_FIELD_NAME_UNSPECIFIED, PROJECT_ROLE_FIELD_NAME_KEY, PROJECT_ROLE_FIELD_NAME_CREATION_DATE, PROJECT_ROLE_FIELD_NAME_CHANGE_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ProjectServiceProjectRoleFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/project_service_project_role_key_filter.rb b/lib/zitadel/client/models/project_service_project_role_key_filter.rb index c2a188b1..f9cf2df9 100644 --- a/lib/zitadel/client/models/project_service_project_role_key_filter.rb +++ b/lib/zitadel/client/models/project_service_project_role_key_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceProjectRoleKeyFilter - # The key of the project role to query for. - attr_accessor :key - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'method' => :'ProjectServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProjectRoleKeyFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProjectRoleKeyFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProjectRoleKeyFilter. + class ProjectServiceProjectRoleKeyFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + method: 'ProjectServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The key of the project role to query for. + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_project_role_search_filter.rb b/lib/zitadel/client/models/project_service_project_role_search_filter.rb index 74371981..38c306b8 100644 --- a/lib/zitadel/client/models/project_service_project_role_search_filter.rb +++ b/lib/zitadel/client/models/project_service_project_role_search_filter.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceProjectRoleSearchFilter - attr_accessor :display_name_filter - - attr_accessor :role_key_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name_filter' => :'displayNameFilter', - :'role_key_filter' => :'roleKeyFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name_filter' => :'ProjectServiceProjectRoleDisplayNameFilter', - :'role_key_filter' => :'ProjectServiceProjectRoleKeyFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProjectRoleSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProjectRoleSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name_filter') - self.display_name_filter = attributes[:'display_name_filter'] - end - - if attributes.key?(:'role_key_filter') - self.role_key_filter = attributes[:'role_key_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name_filter == o.display_name_filter && - role_key_filter == o.role_key_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name_filter, role_key_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProjectRoleSearchFilter. + class ProjectServiceProjectRoleSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name_filter: 'displayNameFilter', + role_key_filter: 'roleKeyFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name_filter: 'ProjectServiceProjectRoleDisplayNameFilter', + role_key_filter: 'ProjectServiceProjectRoleKeyFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :display_name_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :role_key_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_project_search_filter.rb b/lib/zitadel/client/models/project_service_project_search_filter.rb index 1c8f0c4c..90e2ddd5 100644 --- a/lib/zitadel/client/models/project_service_project_search_filter.rb +++ b/lib/zitadel/client/models/project_service_project_search_filter.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceProjectSearchFilter - attr_accessor :in_project_ids_filter - - attr_accessor :organization_id_filter - - attr_accessor :project_name_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'in_project_ids_filter' => :'inProjectIdsFilter', - :'organization_id_filter' => :'organizationIdFilter', - :'project_name_filter' => :'projectNameFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'in_project_ids_filter' => :'ProjectServiceInIDsFilter', - :'organization_id_filter' => :'ProjectServiceProjectOrganizationIDFilter', - :'project_name_filter' => :'ProjectServiceProjectNameFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceProjectSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceProjectSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'in_project_ids_filter') - self.in_project_ids_filter = attributes[:'in_project_ids_filter'] - end - - if attributes.key?(:'organization_id_filter') - self.organization_id_filter = attributes[:'organization_id_filter'] - end - - if attributes.key?(:'project_name_filter') - self.project_name_filter = attributes[:'project_name_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - in_project_ids_filter == o.in_project_ids_filter && - organization_id_filter == o.organization_id_filter && - project_name_filter == o.project_name_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [in_project_ids_filter, organization_id_filter, project_name_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceProjectSearchFilter. + class ProjectServiceProjectSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + in_project_ids_filter: 'inProjectIdsFilter', + organization_id_filter: 'organizationIdFilter', + project_name_filter: 'projectNameFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + in_project_ids_filter: 'ProjectServiceInIDsFilter', + organization_id_filter: 'ProjectServiceProjectOrganizationIDFilter', + project_name_filter: 'ProjectServiceProjectNameFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :in_project_ids_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :project_name_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_project_state.rb b/lib/zitadel/client/models/project_service_project_state.rb index f9c331c7..68e5d0dd 100644 --- a/lib/zitadel/client/models/project_service_project_state.rb +++ b/lib/zitadel/client/models/project_service_project_state.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ProjectServiceProjectState - PROJECT_STATE_UNSPECIFIED = "PROJECT_STATE_UNSPECIFIED".freeze - PROJECT_STATE_ACTIVE = "PROJECT_STATE_ACTIVE".freeze - PROJECT_STATE_INACTIVE = "PROJECT_STATE_INACTIVE".freeze - - def self.all_vars - @all_vars ||= [PROJECT_STATE_UNSPECIFIED, PROJECT_STATE_ACTIVE, PROJECT_STATE_INACTIVE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ProjectServiceProjectState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ProjectServiceProjectState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ProjectServiceProjectState. + class ProjectServiceProjectState + PROJECT_STATE_UNSPECIFIED = 'PROJECT_STATE_UNSPECIFIED' + PROJECT_STATE_ACTIVE = 'PROJECT_STATE_ACTIVE' + PROJECT_STATE_INACTIVE = 'PROJECT_STATE_INACTIVE' + + # Frozen set of all allowed values, used for validation. + VALUES = [PROJECT_STATE_UNSPECIFIED, PROJECT_STATE_ACTIVE, PROJECT_STATE_INACTIVE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ProjectServiceProjectState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/project_service_remove_project_role_request.rb b/lib/zitadel/client/models/project_service_remove_project_role_request.rb index 75c3865c..09157e1c 100644 --- a/lib/zitadel/client/models/project_service_remove_project_role_request.rb +++ b/lib/zitadel/client/models/project_service_remove_project_role_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceRemoveProjectRoleRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # RoleKey is the key of the role to be removed. All dependencies of this role will be removed as well, including project grants and user grants. If the role is not found, the request will return a successful response as the desired state is already achieved. - attr_accessor :role_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'role_key' => :'roleKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'role_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceRemoveProjectRoleRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceRemoveProjectRoleRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - role_key == o.role_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, role_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceRemoveProjectRoleRequest. + class ProjectServiceRemoveProjectRoleRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + role_key: 'roleKey' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + role_key: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # RoleKey is the key of the role to be removed. All dependencies of this role will be removed as well, including project grants and user grants. If the role is not found, the request will return a successful response as the desired state is already achieved. + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_remove_project_role_response.rb b/lib/zitadel/client/models/project_service_remove_project_role_response.rb index 70858493..2da80326 100644 --- a/lib/zitadel/client/models/project_service_remove_project_role_response.rb +++ b/lib/zitadel/client/models/project_service_remove_project_role_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceRemoveProjectRoleResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :removal_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'removal_date' => :'removalDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'removal_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceRemoveProjectRoleResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceRemoveProjectRoleResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'removal_date') - self.removal_date = attributes[:'removal_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - removal_date == o.removal_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [removal_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceRemoveProjectRoleResponse. + class ProjectServiceRemoveProjectRoleResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + removal_date: 'removalDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + removal_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :removal_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_text_filter_method.rb b/lib/zitadel/client/models/project_service_text_filter_method.rb index 9680028d..42fbbb7e 100644 --- a/lib/zitadel/client/models/project_service_text_filter_method.rb +++ b/lib/zitadel/client/models/project_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class ProjectServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ProjectServiceTextFilterMethod. + class ProjectServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ProjectServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ProjectServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ProjectServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/project_service_type.rb b/lib/zitadel/client/models/project_service_type.rb index cf5220b5..6e9b0034 100644 --- a/lib/zitadel/client/models/project_service_type.rb +++ b/lib/zitadel/client/models/project_service_type.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class ProjectServiceType - TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED".freeze - OWNED = "OWNED".freeze - GRANTED = "GRANTED".freeze - OWNED_OR_GRANTED = "OWNED_OR_GRANTED".freeze - - def self.all_vars - @all_vars ||= [TYPE_UNSPECIFIED, OWNED, GRANTED, OWNED_OR_GRANTED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if ProjectServiceType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::ProjectServiceType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for ProjectServiceType. + class ProjectServiceType + TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED' + OWNED = 'OWNED' + GRANTED = 'GRANTED' + OWNED_OR_GRANTED = 'OWNED_OR_GRANTED' + + # Frozen set of all allowed values, used for validation. + VALUES = [TYPE_UNSPECIFIED, OWNED, GRANTED, OWNED_OR_GRANTED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for ProjectServiceType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/project_service_update_project_grant_request.rb b/lib/zitadel/client/models/project_service_update_project_grant_request.rb index ab033e80..1a02a47b 100644 --- a/lib/zitadel/client/models/project_service_update_project_grant_request.rb +++ b/lib/zitadel/client/models/project_service_update_project_grant_request.rb @@ -1,238 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceUpdateProjectGrantRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # GrantedOrganizationID is the unique identifier of the organization the project was granted to. - attr_accessor :granted_organization_id - - # RoleKeys is a list of roles to be granted to the organization for self management. The roles are identified by their keys. Any roles not included in this list will be removed from the project grant. If you want to add a role, make sure to include all other existing roles as well. If any previous role is removed, all user grants for this project grant with this role will be removed as well. - attr_accessor :role_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'granted_organization_id' => :'grantedOrganizationId', - :'role_keys' => :'roleKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'granted_organization_id' => :'String', - :'role_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceUpdateProjectGrantRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceUpdateProjectGrantRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'granted_organization_id') - self.granted_organization_id = attributes[:'granted_organization_id'] - end - - if attributes.key?(:'role_keys') - if (value = attributes[:'role_keys']).is_a?(Array) - self.role_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - granted_organization_id == o.granted_organization_id && - role_keys == o.role_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, granted_organization_id, role_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceUpdateProjectGrantRequest. + class ProjectServiceUpdateProjectGrantRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + granted_organization_id: 'grantedOrganizationId', + role_keys: 'roleKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + granted_organization_id: 'String', + role_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # GrantedOrganizationID is the unique identifier of the organization the project was granted to. + # @example null + attribute :granted_organization_id, Types::Any.optional.meta(omittable: true) + # RoleKeys is a list of roles to be granted to the organization for self management. The roles are identified by their keys. Any roles not included in this list will be removed from the project grant. If you want to add a role, make sure to include all other existing roles as well. If any previous role is removed, all user grants for this project grant with this role will be removed as well. + # @example null + attribute :role_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_update_project_grant_response.rb b/lib/zitadel/client/models/project_service_update_project_grant_response.rb index d5d338aa..5c08d7bb 100644 --- a/lib/zitadel/client/models/project_service_update_project_grant_response.rb +++ b/lib/zitadel/client/models/project_service_update_project_grant_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceUpdateProjectGrantResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceUpdateProjectGrantResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceUpdateProjectGrantResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceUpdateProjectGrantResponse. + class ProjectServiceUpdateProjectGrantResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_update_project_request.rb b/lib/zitadel/client/models/project_service_update_project_request.rb index 53323485..969d9662 100644 --- a/lib/zitadel/client/models/project_service_update_project_request.rb +++ b/lib/zitadel/client/models/project_service_update_project_request.rb @@ -1,291 +1,98 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceUpdateProjectRequest - # ProjectID is the unique identifier of the project to be updated. - attr_accessor :project_id - - # Name is used to update the name of the project. This field is optional. If omitted, the name will remain unchanged. - attr_accessor :name - - # ProjectRoleAssertion is a setting that can be enabled to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types. If omitted, the setting will remain unchanged. - attr_accessor :project_role_assertion - - # AuthorizationRequired is a boolean flag that can be enabled to check if a user has a role of this project assigned when logging into an application of this project. If omitted, the setting will remain unchanged. - attr_accessor :authorization_required - - # ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user has a grant to this project. If omitted, the setting will remain unchanged. - attr_accessor :project_access_required - - attr_accessor :private_labeling_setting - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'name' => :'name', - :'project_role_assertion' => :'projectRoleAssertion', - :'authorization_required' => :'authorizationRequired', - :'project_access_required' => :'projectAccessRequired', - :'private_labeling_setting' => :'privateLabelingSetting' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'name' => :'String', - :'project_role_assertion' => :'Boolean', - :'authorization_required' => :'Boolean', - :'project_access_required' => :'Boolean', - :'private_labeling_setting' => :'ProjectServicePrivateLabelingSetting' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'project_role_assertion', - :'authorization_required', - :'project_access_required', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceUpdateProjectRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceUpdateProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'project_role_assertion') - self.project_role_assertion = attributes[:'project_role_assertion'] - end - - if attributes.key?(:'authorization_required') - self.authorization_required = attributes[:'authorization_required'] - end - - if attributes.key?(:'project_access_required') - self.project_access_required = attributes[:'project_access_required'] - end - - if attributes.key?(:'private_labeling_setting') - self.private_labeling_setting = attributes[:'private_labeling_setting'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - name == o.name && - project_role_assertion == o.project_role_assertion && - authorization_required == o.authorization_required && - project_access_required == o.project_access_required && - private_labeling_setting == o.private_labeling_setting - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, name, project_role_assertion, authorization_required, project_access_required, private_labeling_setting].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceUpdateProjectRequest. + class ProjectServiceUpdateProjectRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + name: 'name', + project_role_assertion: 'projectRoleAssertion', + authorization_required: 'authorizationRequired', + project_access_required: 'projectAccessRequired', + private_labeling_setting: 'privateLabelingSetting' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + name: 'String', + project_role_assertion: 'Boolean', + authorization_required: 'Boolean', + project_access_required: 'Boolean', + private_labeling_setting: 'ProjectServicePrivateLabelingSetting' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project to be updated. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # Name is used to update the name of the project. This field is optional. If omitted, the name will remain unchanged. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # ProjectRoleAssertion is a setting that can be enabled to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types. If omitted, the setting will remain unchanged. + # @example null + attribute :project_role_assertion, Types::Any.optional.meta(omittable: true) + # AuthorizationRequired is a boolean flag that can be enabled to check if a user has a role of this project assigned when logging into an application of this project. If omitted, the setting will remain unchanged. + # @example null + attribute :authorization_required, Types::Any.optional.meta(omittable: true) + # ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user has a grant to this project. If omitted, the setting will remain unchanged. + # @example null + attribute :project_access_required, Types::Any.optional.meta(omittable: true) + # @example null + attribute :private_labeling_setting, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_update_project_response.rb b/lib/zitadel/client/models/project_service_update_project_response.rb index c5bc1119..c0ec9613 100644 --- a/lib/zitadel/client/models/project_service_update_project_response.rb +++ b/lib/zitadel/client/models/project_service_update_project_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceUpdateProjectResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceUpdateProjectResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceUpdateProjectResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceUpdateProjectResponse. + class ProjectServiceUpdateProjectResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/project_service_update_project_role_request.rb b/lib/zitadel/client/models/project_service_update_project_role_request.rb index fcfed08b..bd16f7d8 100644 --- a/lib/zitadel/client/models/project_service_update_project_role_request.rb +++ b/lib/zitadel/client/models/project_service_update_project_role_request.rb @@ -1,248 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceUpdateProjectRoleRequest - # ProjectID is the unique identifier of the project. - attr_accessor :project_id - - # RoleKey identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. It cannot be changed. If you need a different key, remove the role and create a new one. - attr_accessor :role_key - - # DisplayName is the human readable name for the role, which might be displayed to users. If omitted, the name will remain unchanged. - attr_accessor :display_name - - # Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. If omitted, the group will remain unchanged. This attribute is not to be confused with groups as a collection of users. - attr_accessor :group - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'project_id' => :'projectId', - :'role_key' => :'roleKey', - :'display_name' => :'displayName', - :'group' => :'group' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'project_id' => :'String', - :'role_key' => :'String', - :'display_name' => :'String', - :'group' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'display_name', - :'group' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceUpdateProjectRoleRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceUpdateProjectRoleRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'project_id') - self.project_id = attributes[:'project_id'] - end - - if attributes.key?(:'role_key') - self.role_key = attributes[:'role_key'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - project_id == o.project_id && - role_key == o.role_key && - display_name == o.display_name && - group == o.group - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [project_id, role_key, display_name, group].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceUpdateProjectRoleRequest. + class ProjectServiceUpdateProjectRoleRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + project_id: 'projectId', + role_key: 'roleKey', + display_name: 'displayName', + group: 'group' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + project_id: 'String', + role_key: 'String', + display_name: 'String', + group: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ProjectID is the unique identifier of the project. + # @example null + attribute :project_id, Types::Any.optional.meta(omittable: true) + # RoleKey identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. It cannot be changed. If you need a different key, remove the role and create a new one. + # @example null + attribute :role_key, Types::Any.optional.meta(omittable: true) + # DisplayName is the human readable name for the role, which might be displayed to users. If omitted, the name will remain unchanged. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. If omitted, the group will remain unchanged. This attribute is not to be confused with groups as a collection of users. + # @example null + attribute :group, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/project_service_update_project_role_response.rb b/lib/zitadel/client/models/project_service_update_project_role_response.rb index 77db53f6..afa96dbc 100644 --- a/lib/zitadel/client/models/project_service_update_project_role_response.rb +++ b/lib/zitadel/client/models/project_service_update_project_role_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class ProjectServiceUpdateProjectRoleResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::ProjectServiceUpdateProjectRoleResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::ProjectServiceUpdateProjectRoleResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for ProjectServiceUpdateProjectRoleResponse. + class ProjectServiceUpdateProjectRoleResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/s_a_m_l_service_any.rb b/lib/zitadel/client/models/s_a_m_l_service_any.rb deleted file mode 100644 index 13b25c92..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_any.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class SAMLServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_authorization_error.rb b/lib/zitadel/client/models/s_a_m_l_service_authorization_error.rb deleted file mode 100644 index ffef5e09..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_authorization_error.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServiceAuthorizationError - attr_accessor :error - - attr_accessor :error_description - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error' => :'error', - :'error_description' => :'errorDescription' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error' => :'SAMLServiceErrorReason', - :'error_description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error_description' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceAuthorizationError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceAuthorizationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'error_description') - self.error_description = attributes[:'error_description'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error == o.error && - error_description == o.error_description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error, error_description].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_connect_error.rb b/lib/zitadel/client/models/s_a_m_l_service_connect_error.rb deleted file mode 100644 index bc37bd9e..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_connect_error.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class SAMLServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_create_response_request.rb b/lib/zitadel/client/models/s_a_m_l_service_create_response_request.rb deleted file mode 100644 index d0814d26..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_create_response_request.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServiceCreateResponseRequest - # ID of the SAML Request. - attr_accessor :saml_request_id - - attr_accessor :error - - attr_accessor :session - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'saml_request_id' => :'samlRequestId', - :'error' => :'error', - :'session' => :'session' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'saml_request_id' => :'String', - :'error' => :'SAMLServiceAuthorizationError', - :'session' => :'SAMLServiceSession' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceCreateResponseRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceCreateResponseRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'saml_request_id') - self.saml_request_id = attributes[:'saml_request_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'session') - self.session = attributes[:'session'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - saml_request_id == o.saml_request_id && - error == o.error && - session == o.session - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [saml_request_id, error, session].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_create_response_response.rb b/lib/zitadel/client/models/s_a_m_l_service_create_response_response.rb deleted file mode 100644 index 6bd8bd8a..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_create_response_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServiceCreateResponseResponse - attr_accessor :details - - # URL including the Assertion Consumer Service where the user should be redirected or has to call per POST, depending on the binding. Contains details for the application to obtain the response on success, or error details on failure. Note that this field must be treated as credentials, as the contained SAMLResponse or code can be used on behalve of the user. - attr_accessor :url - - attr_accessor :post - - attr_accessor :redirect - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'url' => :'url', - :'post' => :'post', - :'redirect' => :'redirect' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SAMLServiceDetails', - :'url' => :'String', - :'post' => :'SAMLServicePostResponse', - :'redirect' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceCreateResponseResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceCreateResponseResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'post') - self.post = attributes[:'post'] - end - - if attributes.key?(:'redirect') - self.redirect = attributes[:'redirect'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - url == o.url && - post == o.post && - redirect == o.redirect - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, url, post, redirect].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_details.rb b/lib/zitadel/client/models/s_a_m_l_service_details.rb deleted file mode 100644 index bcaad3f7..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_details.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_error_reason.rb b/lib/zitadel/client/models/s_a_m_l_service_error_reason.rb deleted file mode 100644 index d0dff7d3..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_error_reason.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServiceErrorReason - ERROR_REASON_UNSPECIFIED = "ERROR_REASON_UNSPECIFIED".freeze - ERROR_REASON_VERSION_MISSMATCH = "ERROR_REASON_VERSION_MISSMATCH".freeze - ERROR_REASON_AUTH_N_FAILED = "ERROR_REASON_AUTH_N_FAILED".freeze - ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE = "ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE".freeze - ERROR_REASON_INVALID_NAMEID_POLICY = "ERROR_REASON_INVALID_NAMEID_POLICY".freeze - ERROR_REASON_REQUEST_DENIED = "ERROR_REASON_REQUEST_DENIED".freeze - ERROR_REASON_REQUEST_UNSUPPORTED = "ERROR_REASON_REQUEST_UNSUPPORTED".freeze - ERROR_REASON_UNSUPPORTED_BINDING = "ERROR_REASON_UNSUPPORTED_BINDING".freeze - - def self.all_vars - @all_vars ||= [ERROR_REASON_UNSPECIFIED, ERROR_REASON_VERSION_MISSMATCH, ERROR_REASON_AUTH_N_FAILED, ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE, ERROR_REASON_INVALID_NAMEID_POLICY, ERROR_REASON_REQUEST_DENIED, ERROR_REASON_REQUEST_UNSUPPORTED, ERROR_REASON_UNSUPPORTED_BINDING].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SAMLServiceErrorReason.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SAMLServiceErrorReason" - end - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_get_s_a_m_l_request_request.rb b/lib/zitadel/client/models/s_a_m_l_service_get_s_a_m_l_request_request.rb deleted file mode 100644 index 2ae8ae59..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_get_s_a_m_l_request_request.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServiceGetSAMLRequestRequest - # ID of the SAML Request, as obtained from the redirect URL. - attr_accessor :saml_request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'saml_request_id' => :'samlRequestId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'saml_request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceGetSAMLRequestRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceGetSAMLRequestRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'saml_request_id') - self.saml_request_id = attributes[:'saml_request_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - saml_request_id == o.saml_request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [saml_request_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_get_s_a_m_l_request_response.rb b/lib/zitadel/client/models/s_a_m_l_service_get_s_a_m_l_request_response.rb deleted file mode 100644 index 979d038c..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_get_s_a_m_l_request_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServiceGetSAMLRequestResponse - attr_accessor :saml_request - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'saml_request' => :'samlRequest' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'saml_request' => :'SAMLServiceSAMLRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceGetSAMLRequestResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceGetSAMLRequestResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'saml_request') - self.saml_request = attributes[:'saml_request'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - saml_request == o.saml_request - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [saml_request].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_post_response.rb b/lib/zitadel/client/models/s_a_m_l_service_post_response.rb deleted file mode 100644 index 544d5e30..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_post_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServicePostResponse - # The SAML RelaySate, that needs to be returned to the application to match the response to the request. - attr_accessor :relay_state - - # The SAML Response, that needs to be returned to the application to complete the SAML flow. - attr_accessor :saml_response - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'relay_state' => :'relayState', - :'saml_response' => :'samlResponse' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'relay_state' => :'String', - :'saml_response' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServicePostResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServicePostResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'relay_state') - self.relay_state = attributes[:'relay_state'] - end - - if attributes.key?(:'saml_response') - self.saml_response = attributes[:'saml_response'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - relay_state == o.relay_state && - saml_response == o.saml_response - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [relay_state, saml_response].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_s_a_m_l_request.rb b/lib/zitadel/client/models/s_a_m_l_service_s_a_m_l_request.rb deleted file mode 100644 index b31ec8bc..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_s_a_m_l_request.rb +++ /dev/null @@ -1,267 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # SAMLRequest contains information about a SAML authentication request. see: https://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html - class SAMLServiceSAMLRequest - # ID of the created SAMLRequest. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # SAML entityID of the application that created the SAMLRequest. - attr_accessor :issuer - - # URL which points back to the assertion consumer service of the application that created the SAMLRequest. - attr_accessor :assertion_consumer_service - - # RelayState provided by the application for the request. - attr_accessor :relay_state - - # Binding used by the application for the request. - attr_accessor :binding - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'issuer' => :'issuer', - :'assertion_consumer_service' => :'assertionConsumerService', - :'relay_state' => :'relayState', - :'binding' => :'binding' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'issuer' => :'String', - :'assertion_consumer_service' => :'String', - :'relay_state' => :'String', - :'binding' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceSAMLRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceSAMLRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'issuer') - self.issuer = attributes[:'issuer'] - end - - if attributes.key?(:'assertion_consumer_service') - self.assertion_consumer_service = attributes[:'assertion_consumer_service'] - end - - if attributes.key?(:'relay_state') - self.relay_state = attributes[:'relay_state'] - end - - if attributes.key?(:'binding') - self.binding = attributes[:'binding'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - issuer == o.issuer && - assertion_consumer_service == o.assertion_consumer_service && - relay_state == o.relay_state && - binding == o.binding - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, issuer, assertion_consumer_service, relay_state, binding].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/s_a_m_l_service_session.rb b/lib/zitadel/client/models/s_a_m_l_service_session.rb deleted file mode 100644 index d89be42a..00000000 --- a/lib/zitadel/client/models/s_a_m_l_service_session.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SAMLServiceSession - # ID of the session, used to login the user. Connects the session to the SAML Request. - attr_accessor :session_id - - # Token to verify the session is valid. - attr_accessor :session_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'session_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SAMLServiceSession` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SAMLServiceSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - session_token == o.session_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, session_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/saml_service_any.rb b/lib/zitadel/client/models/saml_service_any.rb new file mode 100644 index 00000000..63eba40a --- /dev/null +++ b/lib/zitadel/client/models/saml_service_any.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class SAMLServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_authorization_error.rb b/lib/zitadel/client/models/saml_service_authorization_error.rb new file mode 100644 index 00000000..4f1c64e6 --- /dev/null +++ b/lib/zitadel/client/models/saml_service_authorization_error.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SAMLServiceAuthorizationError. + class SAMLServiceAuthorizationError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + error: 'error', + error_description: 'errorDescription' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + error: 'SAMLServiceErrorReason', + error_description: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :error_description, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_connect_error.rb b/lib/zitadel/client/models/saml_service_connect_error.rb new file mode 100644 index 00000000..7b0cd080 --- /dev/null +++ b/lib/zitadel/client/models/saml_service_connect_error.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class SAMLServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_create_response_request.rb b/lib/zitadel/client/models/saml_service_create_response_request.rb new file mode 100644 index 00000000..fc4411b3 --- /dev/null +++ b/lib/zitadel/client/models/saml_service_create_response_request.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SAMLServiceCreateResponseRequest. + class SAMLServiceCreateResponseRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + saml_request_id: 'samlRequestId', + error: 'error', + session: 'session' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + saml_request_id: 'String', + error: 'SAMLServiceAuthorizationError', + session: 'SAMLServiceSession' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # ID of the SAML Request. + # @example null + attribute :saml_request_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :error, Types::Any.optional.meta(omittable: true) + # @example null + attribute :session, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_create_response_response.rb b/lib/zitadel/client/models/saml_service_create_response_response.rb new file mode 100644 index 00000000..3a9ba24e --- /dev/null +++ b/lib/zitadel/client/models/saml_service_create_response_response.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SAMLServiceCreateResponseResponse. + class SAMLServiceCreateResponseResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + url: 'url', + post: 'post', + redirect: 'redirect' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SAMLServiceDetails', + url: 'String', + post: 'SAMLServicePostResponse', + redirect: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # URL including the Assertion Consumer Service where the user should be redirected or has to call per POST, depending on the binding. Contains details for the application to obtain the response on success, or error details on failure. Note that this field must be treated as credentials, as the contained SAMLResponse or code can be used on behalve of the user. + # @example null + attribute :url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :post, Types::Any.optional.meta(omittable: true) + # @example null + attribute :redirect, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_details.rb b/lib/zitadel/client/models/saml_service_details.rb new file mode 100644 index 00000000..a626985f --- /dev/null +++ b/lib/zitadel/client/models/saml_service_details.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SAMLServiceDetails. + class SAMLServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_error_reason.rb b/lib/zitadel/client/models/saml_service_error_reason.rb new file mode 100644 index 00000000..48125351 --- /dev/null +++ b/lib/zitadel/client/models/saml_service_error_reason.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SAMLServiceErrorReason. + class SAMLServiceErrorReason + ERROR_REASON_UNSPECIFIED = 'ERROR_REASON_UNSPECIFIED' + ERROR_REASON_VERSION_MISSMATCH = 'ERROR_REASON_VERSION_MISSMATCH' + ERROR_REASON_AUTH_N_FAILED = 'ERROR_REASON_AUTH_N_FAILED' + ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE = 'ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE' + ERROR_REASON_INVALID_NAMEID_POLICY = 'ERROR_REASON_INVALID_NAMEID_POLICY' + ERROR_REASON_REQUEST_DENIED = 'ERROR_REASON_REQUEST_DENIED' + ERROR_REASON_REQUEST_UNSUPPORTED = 'ERROR_REASON_REQUEST_UNSUPPORTED' + ERROR_REASON_UNSUPPORTED_BINDING = 'ERROR_REASON_UNSUPPORTED_BINDING' + + # Frozen set of all allowed values, used for validation. + VALUES = [ERROR_REASON_UNSPECIFIED, ERROR_REASON_VERSION_MISSMATCH, ERROR_REASON_AUTH_N_FAILED, ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE, ERROR_REASON_INVALID_NAMEID_POLICY, ERROR_REASON_REQUEST_DENIED, ERROR_REASON_REQUEST_UNSUPPORTED, ERROR_REASON_UNSUPPORTED_BINDING].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SAMLServiceErrorReason: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/saml_service_get_saml_request_request.rb b/lib/zitadel/client/models/saml_service_get_saml_request_request.rb new file mode 100644 index 00000000..cc486048 --- /dev/null +++ b/lib/zitadel/client/models/saml_service_get_saml_request_request.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SAMLServiceGetSAMLRequestRequest. + class SAMLServiceGetSAMLRequestRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + saml_request_id: 'samlRequestId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + saml_request_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # ID of the SAML Request, as obtained from the redirect URL. + # @example null + attribute :saml_request_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_get_saml_request_response.rb b/lib/zitadel/client/models/saml_service_get_saml_request_response.rb new file mode 100644 index 00000000..31ae9e9e --- /dev/null +++ b/lib/zitadel/client/models/saml_service_get_saml_request_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SAMLServiceGetSAMLRequestResponse. + class SAMLServiceGetSAMLRequestResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + saml_request: 'samlRequest' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + saml_request: 'SAMLServiceSAMLRequest' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :saml_request, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_post_response.rb b/lib/zitadel/client/models/saml_service_post_response.rb new file mode 100644 index 00000000..cd0f0fe5 --- /dev/null +++ b/lib/zitadel/client/models/saml_service_post_response.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SAMLServicePostResponse. + class SAMLServicePostResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + relay_state: 'relayState', + saml_response: 'samlResponse' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + relay_state: 'String', + saml_response: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The SAML RelaySate, that needs to be returned to the application to match the response to the request. + # @example null + attribute :relay_state, Types::Any.optional.meta(omittable: true) + # The SAML Response, that needs to be returned to the application to complete the SAML flow. + # @example null + attribute :saml_response, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_saml_request.rb b/lib/zitadel/client/models/saml_service_saml_request.rb new file mode 100644 index 00000000..78f1a1fb --- /dev/null +++ b/lib/zitadel/client/models/saml_service_saml_request.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # SAMLRequest contains information about a SAML authentication request. see: https://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html + class SAMLServiceSAMLRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + issuer: 'issuer', + assertion_consumer_service: 'assertionConsumerService', + relay_state: 'relayState', + binding: 'binding' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + issuer: 'String', + assertion_consumer_service: 'String', + relay_state: 'String', + binding: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # ID of the created SAMLRequest. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # SAML entityID of the application that created the SAMLRequest. + # @example null + attribute :issuer, Types::Any.optional.meta(omittable: true) + # URL which points back to the assertion consumer service of the application that created the SAMLRequest. + # @example null + attribute :assertion_consumer_service, Types::Any.optional.meta(omittable: true) + # RelayState provided by the application for the request. + # @example null + attribute :relay_state, Types::Any.optional.meta(omittable: true) + # Binding used by the application for the request. + # @example null + attribute :binding, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/saml_service_session.rb b/lib/zitadel/client/models/saml_service_session.rb new file mode 100644 index 00000000..091deedb --- /dev/null +++ b/lib/zitadel/client/models/saml_service_session.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SAMLServiceSession. + class SAMLServiceSession < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session_id: 'sessionId', + session_token: 'sessionToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session_id: 'String', + session_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # ID of the session, used to login the user. Connects the session to the SAML Request. + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # Token to verify the session is valid. + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_any.rb b/lib/zitadel/client/models/session_service_any.rb index 13daf874..3380c1e4 100644 --- a/lib/zitadel/client/models/session_service_any.rb +++ b/lib/zitadel/client/models/session_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class SessionServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class SessionServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_challenges.rb b/lib/zitadel/client/models/session_service_challenges.rb index 3ae0eab8..6edce1a8 100644 --- a/lib/zitadel/client/models/session_service_challenges.rb +++ b/lib/zitadel/client/models/session_service_challenges.rb @@ -1,235 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceChallenges - attr_accessor :web_auth_n - - attr_accessor :otp_sms - - attr_accessor :otp_email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'web_auth_n' => :'webAuthN', - :'otp_sms' => :'otpSms', - :'otp_email' => :'otpEmail' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'web_auth_n' => :'SessionServiceWebAuthN', - :'otp_sms' => :'String', - :'otp_email' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'otp_sms', - :'otp_email' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceChallenges` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceChallenges`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'web_auth_n') - self.web_auth_n = attributes[:'web_auth_n'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] - end - - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - web_auth_n == o.web_auth_n && - otp_sms == o.otp_sms && - otp_email == o.otp_email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [web_auth_n, otp_sms, otp_email].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceChallenges. + class SessionServiceChallenges < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + web_auth_n: 'webAuthN', + otp_sms: 'otpSms', + otp_email: 'otpEmail' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + web_auth_n: 'SessionServiceWebAuthN', + otp_sms: 'String', + otp_email: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :web_auth_n, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_sms, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_email, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_check_i_d_p_intent.rb b/lib/zitadel/client/models/session_service_check_i_d_p_intent.rb deleted file mode 100644 index 16d6aac3..00000000 --- a/lib/zitadel/client/models/session_service_check_i_d_p_intent.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceCheckIDPIntent - # The ID of the idp intent, previously returned on the success response of the IDP callback. - attr_accessor :idp_intent_id - - # The token of the idp intent, previously returned on the success response of the IDP callback. - attr_accessor :idp_intent_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_intent_id' => :'idpIntentId', - :'idp_intent_token' => :'idpIntentToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_intent_id' => :'String', - :'idp_intent_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCheckIDPIntent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCheckIDPIntent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_intent_id') - self.idp_intent_id = attributes[:'idp_intent_id'] - end - - if attributes.key?(:'idp_intent_token') - self.idp_intent_token = attributes[:'idp_intent_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_intent_id == o.idp_intent_id && - idp_intent_token == o.idp_intent_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_intent_id, idp_intent_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_check_idp_intent.rb b/lib/zitadel/client/models/session_service_check_idp_intent.rb new file mode 100644 index 00000000..237fe502 --- /dev/null +++ b/lib/zitadel/client/models/session_service_check_idp_intent.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCheckIDPIntent. + class SessionServiceCheckIDPIntent < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_intent_id: 'idpIntentId', + idp_intent_token: 'idpIntentToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_intent_id: 'String', + idp_intent_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The ID of the idp intent, previously returned on the success response of the IDP callback. + # @example null + attribute :idp_intent_id, Types::Any.optional.meta(omittable: true) + # The token of the idp intent, previously returned on the success response of the IDP callback. + # @example null + attribute :idp_intent_token, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_check_o_t_p.rb b/lib/zitadel/client/models/session_service_check_o_t_p.rb deleted file mode 100644 index ba4fa213..00000000 --- a/lib/zitadel/client/models/session_service_check_o_t_p.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceCheckOTP - # The One-Time Password sent over SMS or Email of the user to be checked. - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCheckOTP` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCheckOTP`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_check_otp.rb b/lib/zitadel/client/models/session_service_check_otp.rb new file mode 100644 index 00000000..2ef9a2a4 --- /dev/null +++ b/lib/zitadel/client/models/session_service_check_otp.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCheckOTP. + class SessionServiceCheckOTP < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The One-Time Password sent over SMS or Email of the user to be checked. + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_check_password.rb b/lib/zitadel/client/models/session_service_check_password.rb index 0ef79286..6c6bfa8f 100644 --- a/lib/zitadel/client/models/session_service_check_password.rb +++ b/lib/zitadel/client/models/session_service_check_password.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceCheckPassword - # The password of the user to be checked. - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'password' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCheckPassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCheckPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCheckPassword. + class SessionServiceCheckPassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + password: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The password of the user to be checked. + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_check_recovery_code.rb b/lib/zitadel/client/models/session_service_check_recovery_code.rb index 93896694..319bc1bf 100644 --- a/lib/zitadel/client/models/session_service_check_recovery_code.rb +++ b/lib/zitadel/client/models/session_service_check_recovery_code.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceCheckRecoveryCode - # The Recovery Code of the user to be checked. The code must match the exact code previously generated for the user, including dashes if any. On successful check, the recovery code will be invalidated and cannot be used again. - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCheckRecoveryCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCheckRecoveryCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCheckRecoveryCode. + class SessionServiceCheckRecoveryCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The Recovery Code of the user to be checked. The code must match the exact code previously generated for the user, including dashes if any. On successful check, the recovery code will be invalidated and cannot be used again. + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_check_t_o_t_p.rb b/lib/zitadel/client/models/session_service_check_t_o_t_p.rb deleted file mode 100644 index babb111a..00000000 --- a/lib/zitadel/client/models/session_service_check_t_o_t_p.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceCheckTOTP - # The Time-based One-Time Password generated by the user's TOTP authenticator app. - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCheckTOTP` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCheckTOTP`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_check_totp.rb b/lib/zitadel/client/models/session_service_check_totp.rb new file mode 100644 index 00000000..99304f74 --- /dev/null +++ b/lib/zitadel/client/models/session_service_check_totp.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCheckTOTP. + class SessionServiceCheckTOTP < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # The Time-based One-Time Password generated by the user's TOTP authenticator app. + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_check_user.rb b/lib/zitadel/client/models/session_service_check_user.rb index 5c070181..4f29851b 100644 --- a/lib/zitadel/client/models/session_service_check_user.rb +++ b/lib/zitadel/client/models/session_service_check_user.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceCheckUser - # The login name of the user to be checked. It will search case insensitive. Note this only checks for the computed login name and not for any organization scoped usernames. Also note that it will not check for emails or phone numbers, even if the corresponding setting is enabled. Use the user service ListUsers method to find a user by email or phone number first to obtain the user ID or login name. - attr_accessor :login_name - - # The unique identifier of the user to be checked. - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_name' => :'loginName', - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_name' => :'String', - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCheckUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCheckUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_name') - self.login_name = attributes[:'login_name'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_name == o.login_name && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_name, user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCheckUser. + class SessionServiceCheckUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_name: 'loginName', + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_name: 'String', + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The login name of the user to be checked. It will search case insensitive. Note this only checks for the computed login name and not for any organization scoped usernames. Also note that it will not check for emails or phone numbers, even if the corresponding setting is enabled. Use the user service ListUsers method to find a user by email or phone number first to obtain the user ID or login name. + # @example null + attribute :login_name, Types::Any.optional.meta(omittable: true) + # The unique identifier of the user to be checked. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_check_web_auth_n.rb b/lib/zitadel/client/models/session_service_check_web_auth_n.rb index 82fcbdf4..9a297933 100644 --- a/lib/zitadel/client/models/session_service_check_web_auth_n.rb +++ b/lib/zitadel/client/models/session_service_check_web_auth_n.rb @@ -1,218 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceCheckWebAuthN - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :credential_assertion_data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'credential_assertion_data' => :'credentialAssertionData' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'credential_assertion_data' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCheckWebAuthN` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCheckWebAuthN`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'credential_assertion_data') - if (value = attributes[:'credential_assertion_data']).is_a?(Hash) - self.credential_assertion_data = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - credential_assertion_data == o.credential_assertion_data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [credential_assertion_data].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCheckWebAuthN. + class SessionServiceCheckWebAuthN < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + credential_assertion_data: 'credentialAssertionData' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + credential_assertion_data: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :credential_assertion_data, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_checks.rb b/lib/zitadel/client/models/session_service_checks.rb index 0d82a45e..c8b4dc77 100644 --- a/lib/zitadel/client/models/session_service_checks.rb +++ b/lib/zitadel/client/models/session_service_checks.rb @@ -1,278 +1,101 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceChecks - attr_accessor :user - - attr_accessor :password - - attr_accessor :web_auth_n - - attr_accessor :idp_intent - - attr_accessor :totp - - attr_accessor :otp_sms - - attr_accessor :otp_email - - attr_accessor :recovery_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user' => :'user', - :'password' => :'password', - :'web_auth_n' => :'webAuthN', - :'idp_intent' => :'idpIntent', - :'totp' => :'totp', - :'otp_sms' => :'otpSms', - :'otp_email' => :'otpEmail', - :'recovery_code' => :'recoveryCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user' => :'SessionServiceCheckUser', - :'password' => :'SessionServiceCheckPassword', - :'web_auth_n' => :'SessionServiceCheckWebAuthN', - :'idp_intent' => :'SessionServiceCheckIDPIntent', - :'totp' => :'SessionServiceCheckTOTP', - :'otp_sms' => :'SessionServiceCheckOTP', - :'otp_email' => :'SessionServiceCheckOTP', - :'recovery_code' => :'SessionServiceCheckRecoveryCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceChecks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceChecks`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'web_auth_n') - self.web_auth_n = attributes[:'web_auth_n'] - end - - if attributes.key?(:'idp_intent') - self.idp_intent = attributes[:'idp_intent'] - end - - if attributes.key?(:'totp') - self.totp = attributes[:'totp'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] - end - - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - - if attributes.key?(:'recovery_code') - self.recovery_code = attributes[:'recovery_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user == o.user && - password == o.password && - web_auth_n == o.web_auth_n && - idp_intent == o.idp_intent && - totp == o.totp && - otp_sms == o.otp_sms && - otp_email == o.otp_email && - recovery_code == o.recovery_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user, password, web_auth_n, idp_intent, totp, otp_sms, otp_email, recovery_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceChecks. + class SessionServiceChecks < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user: 'user', + password: 'password', + web_auth_n: 'webAuthN', + idp_intent: 'idpIntent', + totp: 'totp', + otp_sms: 'otpSms', + otp_email: 'otpEmail', + recovery_code: 'recoveryCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user: 'SessionServiceCheckUser', + password: 'SessionServiceCheckPassword', + web_auth_n: 'SessionServiceCheckWebAuthN', + idp_intent: 'SessionServiceCheckIDPIntent', + totp: 'SessionServiceCheckTOTP', + otp_sms: 'SessionServiceCheckOTP', + otp_email: 'SessionServiceCheckOTP', + recovery_code: 'SessionServiceCheckRecoveryCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :web_auth_n, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_intent, Types::Any.optional.meta(omittable: true) + # @example null + attribute :totp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_sms, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :recovery_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_connect_error.rb b/lib/zitadel/client/models/session_service_connect_error.rb index b823cadb..2f79fa6b 100644 --- a/lib/zitadel/client/models/session_service_connect_error.rb +++ b/lib/zitadel/client/models/session_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class SessionServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class SessionServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_create_session_request.rb b/lib/zitadel/client/models/session_service_create_session_request.rb index 46eeda29..1cd2423b 100644 --- a/lib/zitadel/client/models/session_service_create_session_request.rb +++ b/lib/zitadel/client/models/session_service_create_session_request.rb @@ -1,255 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceCreateSessionRequest - attr_accessor :checks - - # Custom key value list to be stored on the session. - attr_accessor :metadata - - attr_accessor :challenges - - attr_accessor :user_agent - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :lifetime - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'checks' => :'checks', - :'metadata' => :'metadata', - :'challenges' => :'challenges', - :'user_agent' => :'userAgent', - :'lifetime' => :'lifetime' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'checks' => :'SessionServiceChecks', - :'metadata' => :'Hash', - :'challenges' => :'SessionServiceRequestChallenges', - :'user_agent' => :'SessionServiceUserAgent', - :'lifetime' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCreateSessionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCreateSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'checks') - self.checks = attributes[:'checks'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'challenges') - self.challenges = attributes[:'challenges'] - end - - if attributes.key?(:'user_agent') - self.user_agent = attributes[:'user_agent'] - end - - if attributes.key?(:'lifetime') - self.lifetime = attributes[:'lifetime'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - checks == o.checks && - metadata == o.metadata && - challenges == o.challenges && - user_agent == o.user_agent && - lifetime == o.lifetime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [checks, metadata, challenges, user_agent, lifetime].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCreateSessionRequest. + class SessionServiceCreateSessionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + checks: 'checks', + metadata: 'metadata', + challenges: 'challenges', + user_agent: 'userAgent', + lifetime: 'lifetime' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + checks: 'SessionServiceChecks', + metadata: 'Hash', + challenges: 'SessionServiceRequestChallenges', + user_agent: 'SessionServiceUserAgent', + lifetime: 'ISO8601::Duration' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + inner: 'byte[]', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :checks, Types::Any.optional.meta(omittable: true) + # Custom key value list to be stored on the session. + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :challenges, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_agent, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :lifetime, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_create_session_response.rb b/lib/zitadel/client/models/session_service_create_session_response.rb index ca4fbd1c..eb544ef1 100644 --- a/lib/zitadel/client/models/session_service_create_session_response.rb +++ b/lib/zitadel/client/models/session_service_create_session_response.rb @@ -1,244 +1,87 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceCreateSessionResponse - attr_accessor :details - - # Unique identifier of the session. - attr_accessor :session_id - - # The current token of the session, which is required for using the session as authentication, e.g.when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. - attr_accessor :session_token - - attr_accessor :challenges - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken', - :'challenges' => :'challenges' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SessionServiceDetails', - :'session_id' => :'String', - :'session_token' => :'String', - :'challenges' => :'SessionServiceChallenges' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCreateSessionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCreateSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - - if attributes.key?(:'challenges') - self.challenges = attributes[:'challenges'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - session_id == o.session_id && - session_token == o.session_token && - challenges == o.challenges - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, session_id, session_token, challenges].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCreateSessionResponse. + class SessionServiceCreateSessionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + session_id: 'sessionId', + session_token: 'sessionToken', + challenges: 'challenges' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SessionServiceDetails', + session_id: 'String', + session_token: 'String', + challenges: 'SessionServiceChallenges' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # Unique identifier of the session. + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # The current token of the session, which is required for using the session as authentication, e.g.when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :challenges, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_creation_date_query.rb b/lib/zitadel/client/models/session_service_creation_date_query.rb index 3a88cfd5..cd25c40e 100644 --- a/lib/zitadel/client/models/session_service_creation_date_query.rb +++ b/lib/zitadel/client/models/session_service_creation_date_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceCreationDateQuery - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'method' => :'SessionServiceTimestampQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCreationDateQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCreationDateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCreationDateQuery. + class SessionServiceCreationDateQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + method: 'SessionServiceTimestampQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_creator_query.rb b/lib/zitadel/client/models/session_service_creator_query.rb index 8d409f81..dfabeb66 100644 --- a/lib/zitadel/client/models/session_service_creator_query.rb +++ b/lib/zitadel/client/models/session_service_creator_query.rb @@ -1,217 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceCreatorQuery - # ID of the user who created the session. If empty, the calling user's ID is used. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceCreatorQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceCreatorQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceCreatorQuery. + class SessionServiceCreatorQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the user who created the session. If empty, the calling user's ID is used. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_delete_session_request.rb b/lib/zitadel/client/models/session_service_delete_session_request.rb index 16a1b8fb..42f7239b 100644 --- a/lib/zitadel/client/models/session_service_delete_session_request.rb +++ b/lib/zitadel/client/models/session_service_delete_session_request.rb @@ -1,227 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceDeleteSessionRequest - # The unique identifier of the session to be terminated. - attr_accessor :session_id - - # The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.delete permission on either the instance or on the checked user's organization - attr_accessor :session_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'session_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'session_token' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceDeleteSessionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceDeleteSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - session_token == o.session_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, session_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceDeleteSessionRequest. + class SessionServiceDeleteSessionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session_id: 'sessionId', + session_token: 'sessionToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session_id: 'String', + session_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the session to be terminated. + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.delete permission on either the instance or on the checked user's organization + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_delete_session_response.rb b/lib/zitadel/client/models/session_service_delete_session_response.rb index bc9dd343..04362107 100644 --- a/lib/zitadel/client/models/session_service_delete_session_response.rb +++ b/lib/zitadel/client/models/session_service_delete_session_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceDeleteSessionResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SessionServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceDeleteSessionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceDeleteSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceDeleteSessionResponse. + class SessionServiceDeleteSessionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SessionServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_details.rb b/lib/zitadel/client/models/session_service_details.rb index c3a24d93..ccf9bba1 100644 --- a/lib/zitadel/client/models/session_service_details.rb +++ b/lib/zitadel/client/models/session_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceDetails. + class SessionServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_expiration_date_query.rb b/lib/zitadel/client/models/session_service_expiration_date_query.rb index 2bdd11ec..dba41cf3 100644 --- a/lib/zitadel/client/models/session_service_expiration_date_query.rb +++ b/lib/zitadel/client/models/session_service_expiration_date_query.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceExpirationDateQuery - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'expiration_date' => :'expirationDate', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'expiration_date' => :'Time', - :'method' => :'SessionServiceTimestampQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceExpirationDateQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceExpirationDateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - expiration_date == o.expiration_date && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [expiration_date, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceExpirationDateQuery. + class SessionServiceExpirationDateQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + expiration_date: 'expirationDate', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + expiration_date: 'Time', + method: 'SessionServiceTimestampQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_factors.rb b/lib/zitadel/client/models/session_service_factors.rb index ce8e87a7..1d6ba300 100644 --- a/lib/zitadel/client/models/session_service_factors.rb +++ b/lib/zitadel/client/models/session_service_factors.rb @@ -1,278 +1,101 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceFactors - attr_accessor :user - - attr_accessor :password - - attr_accessor :web_auth_n - - attr_accessor :intent - - attr_accessor :totp - - attr_accessor :otp_sms - - attr_accessor :otp_email - - attr_accessor :recovery_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user' => :'user', - :'password' => :'password', - :'web_auth_n' => :'webAuthN', - :'intent' => :'intent', - :'totp' => :'totp', - :'otp_sms' => :'otpSms', - :'otp_email' => :'otpEmail', - :'recovery_code' => :'recoveryCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user' => :'SessionServiceUserFactor', - :'password' => :'SessionServicePasswordFactor', - :'web_auth_n' => :'SessionServiceWebAuthNFactor', - :'intent' => :'SessionServiceIntentFactor', - :'totp' => :'SessionServiceTOTPFactor', - :'otp_sms' => :'SessionServiceOTPFactor', - :'otp_email' => :'SessionServiceOTPFactor', - :'recovery_code' => :'SessionServiceRecoveryCodeFactor' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceFactors` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceFactors`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'web_auth_n') - self.web_auth_n = attributes[:'web_auth_n'] - end - - if attributes.key?(:'intent') - self.intent = attributes[:'intent'] - end - - if attributes.key?(:'totp') - self.totp = attributes[:'totp'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] - end - - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - - if attributes.key?(:'recovery_code') - self.recovery_code = attributes[:'recovery_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user == o.user && - password == o.password && - web_auth_n == o.web_auth_n && - intent == o.intent && - totp == o.totp && - otp_sms == o.otp_sms && - otp_email == o.otp_email && - recovery_code == o.recovery_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user, password, web_auth_n, intent, totp, otp_sms, otp_email, recovery_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceFactors. + class SessionServiceFactors < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user: 'user', + password: 'password', + web_auth_n: 'webAuthN', + intent: 'intent', + totp: 'totp', + otp_sms: 'otpSms', + otp_email: 'otpEmail', + recovery_code: 'recoveryCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user: 'SessionServiceUserFactor', + password: 'SessionServicePasswordFactor', + web_auth_n: 'SessionServiceWebAuthNFactor', + intent: 'SessionServiceIntentFactor', + totp: 'SessionServiceTOTPFactor', + otp_sms: 'SessionServiceOTPFactor', + otp_email: 'SessionServiceOTPFactor', + recovery_code: 'SessionServiceRecoveryCodeFactor' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :web_auth_n, Types::Any.optional.meta(omittable: true) + # @example null + attribute :intent, Types::Any.optional.meta(omittable: true) + # @example null + attribute :totp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_sms, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :recovery_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_get_session_request.rb b/lib/zitadel/client/models/session_service_get_session_request.rb index bda95142..a326987d 100644 --- a/lib/zitadel/client/models/session_service_get_session_request.rb +++ b/lib/zitadel/client/models/session_service_get_session_request.rb @@ -1,227 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceGetSessionRequest - # The unique identifier of the session to be retrieved. - attr_accessor :session_id - - # The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.read permission on either the instance or on the checked user's organization - attr_accessor :session_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'session_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'session_token' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceGetSessionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceGetSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - session_token == o.session_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, session_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceGetSessionRequest. + class SessionServiceGetSessionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session_id: 'sessionId', + session_token: 'sessionToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session_id: 'String', + session_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the session to be retrieved. + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.read permission on either the instance or on the checked user's organization + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_get_session_response.rb b/lib/zitadel/client/models/session_service_get_session_response.rb index df1f8871..ff0eaabd 100644 --- a/lib/zitadel/client/models/session_service_get_session_response.rb +++ b/lib/zitadel/client/models/session_service_get_session_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceGetSessionResponse - attr_accessor :session - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session' => :'session' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session' => :'SessionServiceSession' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceGetSessionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceGetSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session') - self.session = attributes[:'session'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session == o.session - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceGetSessionResponse. + class SessionServiceGetSessionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session: 'session' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session: 'SessionServiceSession' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :session, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_header_values.rb b/lib/zitadel/client/models/session_service_header_values.rb index 25afca36..51897099 100644 --- a/lib/zitadel/client/models/session_service_header_values.rb +++ b/lib/zitadel/client/models/session_service_header_values.rb @@ -1,218 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # A header may have multiple values. In Go, headers are defined as map[string][]string, but protobuf doesn't allow this scheme. - class SessionServiceHeaderValues - attr_accessor :values - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'values' => :'values' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'values' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceHeaderValues` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceHeaderValues`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'values') - if (value = attributes[:'values']).is_a?(Array) - self.values = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - values == o.values - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [values].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # A header may have multiple values. In Go, headers are defined as map[string][]string, but protobuf doesn't allow this scheme. + class SessionServiceHeaderValues < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + values: 'values' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + values: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :values, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_i_ds_query.rb b/lib/zitadel/client/models/session_service_i_ds_query.rb deleted file mode 100644 index fd76189f..00000000 --- a/lib/zitadel/client/models/session_service_i_ds_query.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceIDsQuery - # List of session IDs to search for. If multiple IDs are provided, sessions matching any of the IDs will be returned. - attr_accessor :ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ids' => :'ids' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceIDsQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceIDsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ids') - if (value = attributes[:'ids']).is_a?(Array) - self.ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ids == o.ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_ids_query.rb b/lib/zitadel/client/models/session_service_ids_query.rb new file mode 100644 index 00000000..91562178 --- /dev/null +++ b/lib/zitadel/client/models/session_service_ids_query.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceIDsQuery. + class SessionServiceIDsQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ids: 'ids' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # List of session IDs to search for. If multiple IDs are provided, sessions matching any of the IDs will be returned. + # @example null + attribute :ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_intent_factor.rb b/lib/zitadel/client/models/session_service_intent_factor.rb index 698419bd..f3505121 100644 --- a/lib/zitadel/client/models/session_service_intent_factor.rb +++ b/lib/zitadel/client/models/session_service_intent_factor.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceIntentFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceIntentFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceIntentFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceIntentFactor. + class SessionServiceIntentFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_list_details.rb b/lib/zitadel/client/models/session_service_list_details.rb index 2d635915..b03034b1 100644 --- a/lib/zitadel/client/models/session_service_list_details.rb +++ b/lib/zitadel/client/models/session_service_list_details.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceListDetails - attr_accessor :total_result - - attr_accessor :processed_sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'processed_sequence' => :'processedSequence', - :'timestamp' => :'timestamp' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'processed_sequence' => :'Object', - :'timestamp' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'processed_sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceListDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'processed_sequence') - self.processed_sequence = attributes[:'processed_sequence'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - processed_sequence == o.processed_sequence && - timestamp == o.timestamp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, processed_sequence, timestamp].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceListDetails. + class SessionServiceListDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + processed_sequence: 'processedSequence', + timestamp: 'timestamp' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + processed_sequence: 'Object', + timestamp: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # @example null + attribute :processed_sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_list_query.rb b/lib/zitadel/client/models/session_service_list_query.rb index 9cd30558..7b360f83 100644 --- a/lib/zitadel/client/models/session_service_list_query.rb +++ b/lib/zitadel/client/models/session_service_list_query.rb @@ -1,234 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceListQuery - attr_accessor :offset - - attr_accessor :limit - - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceListQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceListQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceListQuery. + class SessionServiceListQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_list_sessions_request.rb b/lib/zitadel/client/models/session_service_list_sessions_request.rb index 84d1cc89..a76230f0 100644 --- a/lib/zitadel/client/models/session_service_list_sessions_request.rb +++ b/lib/zitadel/client/models/session_service_list_sessions_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceListSessionsRequest - attr_accessor :query - - # The criteria to be used when searching for sessions. Multiple queries will be combined with a logical AND. - attr_accessor :queries - - attr_accessor :sorting_column - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'query' => :'query', - :'queries' => :'queries', - :'sorting_column' => :'sortingColumn' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'query' => :'SessionServiceListQuery', - :'queries' => :'Array', - :'sorting_column' => :'SessionServiceSessionFieldName' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceListSessionsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceListSessionsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - query == o.query && - queries == o.queries && - sorting_column == o.sorting_column - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [query, queries, sorting_column].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceListSessionsRequest. + class SessionServiceListSessionsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + query: 'query', + queries: 'queries', + sorting_column: 'sortingColumn' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + query: 'SessionServiceListQuery', + queries: 'Array', + sorting_column: 'SessionServiceSessionFieldName' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) + # The criteria to be used when searching for sessions. Multiple queries will be combined with a logical AND. + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_list_sessions_response.rb b/lib/zitadel/client/models/session_service_list_sessions_response.rb index 03332d35..5ebe3507 100644 --- a/lib/zitadel/client/models/session_service_list_sessions_response.rb +++ b/lib/zitadel/client/models/session_service_list_sessions_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceListSessionsResponse - attr_accessor :details - - # The sessions matching the search query. There might be more sessions available than returned in this response. Use the details field to see if there are more sessions available and to get the total count of sessions matching the query. - attr_accessor :sessions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'sessions' => :'sessions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SessionServiceListDetails', - :'sessions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceListSessionsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceListSessionsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'sessions') - if (value = attributes[:'sessions']).is_a?(Array) - self.sessions = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - sessions == o.sessions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, sessions].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceListSessionsResponse. + class SessionServiceListSessionsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + sessions: 'sessions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SessionServiceListDetails', + sessions: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # The sessions matching the search query. There might be more sessions available than returned in this response. Use the details field to see if there are more sessions available and to get the total count of sessions matching the query. + # @example null + attribute :sessions, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_o_t_p_email.rb b/lib/zitadel/client/models/session_service_o_t_p_email.rb deleted file mode 100644 index e3d79b23..00000000 --- a/lib/zitadel/client/models/session_service_o_t_p_email.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceOTPEmail - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'return_code' => :'Object', - :'send_code' => :'SessionServiceSendCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceOTPEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceOTPEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_o_t_p_factor.rb b/lib/zitadel/client/models/session_service_o_t_p_factor.rb deleted file mode 100644 index a03cc92d..00000000 --- a/lib/zitadel/client/models/session_service_o_t_p_factor.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceOTPFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceOTPFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceOTPFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_o_t_p_s_m_s.rb b/lib/zitadel/client/models/session_service_o_t_p_s_m_s.rb deleted file mode 100644 index 386e3e47..00000000 --- a/lib/zitadel/client/models/session_service_o_t_p_s_m_s.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceOTPSMS - # Request the code to be returned instead of sending an SMS. This is useful for testing or in case you want to send the code yourself. - attr_accessor :return_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'return_code' => :'returnCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'return_code' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceOTPSMS` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceOTPSMS`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - return_code == o.return_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [return_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_otp_email.rb b/lib/zitadel/client/models/session_service_otp_email.rb new file mode 100644 index 00000000..8e74393d --- /dev/null +++ b/lib/zitadel/client/models/session_service_otp_email.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceOTPEmail. + class SessionServiceOTPEmail < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + return_code: 'Object', + send_code: 'SessionServiceSendCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_otp_factor.rb b/lib/zitadel/client/models/session_service_otp_factor.rb new file mode 100644 index 00000000..6844f42e --- /dev/null +++ b/lib/zitadel/client/models/session_service_otp_factor.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceOTPFactor. + class SessionServiceOTPFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_otpsms.rb b/lib/zitadel/client/models/session_service_otpsms.rb new file mode 100644 index 00000000..2ae2a488 --- /dev/null +++ b/lib/zitadel/client/models/session_service_otpsms.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceOTPSMS. + class SessionServiceOTPSMS < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + return_code: 'returnCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + return_code: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Request the code to be returned instead of sending an SMS. This is useful for testing or in case you want to send the code yourself. + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_password_factor.rb b/lib/zitadel/client/models/session_service_password_factor.rb index 7afaf590..6a20b9dd 100644 --- a/lib/zitadel/client/models/session_service_password_factor.rb +++ b/lib/zitadel/client/models/session_service_password_factor.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServicePasswordFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServicePasswordFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServicePasswordFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServicePasswordFactor. + class SessionServicePasswordFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_recovery_code_factor.rb b/lib/zitadel/client/models/session_service_recovery_code_factor.rb index 3e15b6aa..eab9fe53 100644 --- a/lib/zitadel/client/models/session_service_recovery_code_factor.rb +++ b/lib/zitadel/client/models/session_service_recovery_code_factor.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceRecoveryCodeFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceRecoveryCodeFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceRecoveryCodeFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceRecoveryCodeFactor. + class SessionServiceRecoveryCodeFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_request_challenges.rb b/lib/zitadel/client/models/session_service_request_challenges.rb index a8b8b844..ee9fe09a 100644 --- a/lib/zitadel/client/models/session_service_request_challenges.rb +++ b/lib/zitadel/client/models/session_service_request_challenges.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceRequestChallenges - attr_accessor :web_auth_n - - attr_accessor :otp_sms - - attr_accessor :otp_email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'web_auth_n' => :'webAuthN', - :'otp_sms' => :'otpSms', - :'otp_email' => :'otpEmail' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'web_auth_n' => :'SessionServiceWebAuthN', - :'otp_sms' => :'SessionServiceOTPSMS', - :'otp_email' => :'SessionServiceOTPEmail' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceRequestChallenges` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceRequestChallenges`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'web_auth_n') - self.web_auth_n = attributes[:'web_auth_n'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] - end - - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - web_auth_n == o.web_auth_n && - otp_sms == o.otp_sms && - otp_email == o.otp_email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [web_auth_n, otp_sms, otp_email].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceRequestChallenges. + class SessionServiceRequestChallenges < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + web_auth_n: 'webAuthN', + otp_sms: 'otpSms', + otp_email: 'otpEmail' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + web_auth_n: 'SessionServiceWebAuthN', + otp_sms: 'SessionServiceOTPSMS', + otp_email: 'SessionServiceOTPEmail' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :web_auth_n, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_sms, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_email, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_search_query.rb b/lib/zitadel/client/models/session_service_search_query.rb index a0b62dc5..ba04b227 100644 --- a/lib/zitadel/client/models/session_service_search_query.rb +++ b/lib/zitadel/client/models/session_service_search_query.rb @@ -1,260 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceSearchQuery - attr_accessor :creation_date_query - - attr_accessor :creator_query - - attr_accessor :expiration_date_query - - attr_accessor :ids_query - - attr_accessor :user_agent_query - - attr_accessor :user_id_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date_query' => :'creationDateQuery', - :'creator_query' => :'creatorQuery', - :'expiration_date_query' => :'expirationDateQuery', - :'ids_query' => :'idsQuery', - :'user_agent_query' => :'userAgentQuery', - :'user_id_query' => :'userIdQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date_query' => :'SessionServiceCreationDateQuery', - :'creator_query' => :'SessionServiceCreatorQuery', - :'expiration_date_query' => :'SessionServiceExpirationDateQuery', - :'ids_query' => :'SessionServiceIDsQuery', - :'user_agent_query' => :'SessionServiceUserAgentQuery', - :'user_id_query' => :'SessionServiceUserIDQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date_query') - self.creation_date_query = attributes[:'creation_date_query'] - end - - if attributes.key?(:'creator_query') - self.creator_query = attributes[:'creator_query'] - end - - if attributes.key?(:'expiration_date_query') - self.expiration_date_query = attributes[:'expiration_date_query'] - end - - if attributes.key?(:'ids_query') - self.ids_query = attributes[:'ids_query'] - end - - if attributes.key?(:'user_agent_query') - self.user_agent_query = attributes[:'user_agent_query'] - end - - if attributes.key?(:'user_id_query') - self.user_id_query = attributes[:'user_id_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date_query == o.creation_date_query && - creator_query == o.creator_query && - expiration_date_query == o.expiration_date_query && - ids_query == o.ids_query && - user_agent_query == o.user_agent_query && - user_id_query == o.user_id_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date_query, creator_query, expiration_date_query, ids_query, user_agent_query, user_id_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceSearchQuery. + class SessionServiceSearchQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date_query: 'creationDateQuery', + creator_query: 'creatorQuery', + expiration_date_query: 'expirationDateQuery', + ids_query: 'idsQuery', + user_agent_query: 'userAgentQuery', + user_id_query: 'userIdQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date_query: 'SessionServiceCreationDateQuery', + creator_query: 'SessionServiceCreatorQuery', + expiration_date_query: 'SessionServiceExpirationDateQuery', + ids_query: 'SessionServiceIDsQuery', + user_agent_query: 'SessionServiceUserAgentQuery', + user_id_query: 'SessionServiceUserIDQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :creation_date_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :creator_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :expiration_date_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ids_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_agent_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_send_code.rb b/lib/zitadel/client/models/session_service_send_code.rb index 7589b75e..86aa3ef9 100644 --- a/lib/zitadel/client/models/session_service_send_code.rb +++ b/lib/zitadel/client/models/session_service_send_code.rb @@ -1,217 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceSendCode - # Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: Code, UserID, LoginName, DisplayName, PreferredLanguage, SessionID - attr_accessor :url_template - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceSendCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceSendCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceSendCode. + class SessionServiceSendCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: Code, UserID, LoginName, DisplayName, PreferredLanguage, SessionID + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_session.rb b/lib/zitadel/client/models/session_service_session.rb index 0aa85fe9..334d49b2 100644 --- a/lib/zitadel/client/models/session_service_session.rb +++ b/lib/zitadel/client/models/session_service_session.rb @@ -1,287 +1,109 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceSession - # Unique identifier of the session. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # The sequence of the session represents the change sequence of the session. - attr_accessor :sequence - - attr_accessor :factors - - # Metadata contains custom key value pairs set by the user. The metadata is not interpreted by ZITADEL and can be used to store any information relevant to the session. - attr_accessor :metadata - - attr_accessor :user_agent - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'sequence' => :'sequence', - :'factors' => :'factors', - :'metadata' => :'metadata', - :'user_agent' => :'userAgent', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'sequence' => :'Object', - :'factors' => :'SessionServiceFactors', - :'metadata' => :'Hash', - :'user_agent' => :'SessionServiceUserAgent', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceSession` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceSession`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'factors') - self.factors = attributes[:'factors'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'user_agent') - self.user_agent = attributes[:'user_agent'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - change_date == o.change_date && - sequence == o.sequence && - factors == o.factors && - metadata == o.metadata && - user_agent == o.user_agent && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, change_date, sequence, factors, metadata, user_agent, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceSession. + class SessionServiceSession < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + change_date: 'changeDate', + sequence: 'sequence', + factors: 'factors', + metadata: 'metadata', + user_agent: 'userAgent', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + change_date: 'Time', + sequence: 'Object', + factors: 'SessionServiceFactors', + metadata: 'Hash', + user_agent: 'SessionServiceUserAgent', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + inner: 'byte[]', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Unique identifier of the session. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # The sequence of the session represents the change sequence of the session. + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # @example null + attribute :factors, Types::Any.optional.meta(omittable: true) + # Metadata contains custom key value pairs set by the user. The metadata is not interpreted by ZITADEL and can be used to store any information relevant to the session. + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_agent, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_session_field_name.rb b/lib/zitadel/client/models/session_service_session_field_name.rb index 806917f5..ef547fc6 100644 --- a/lib/zitadel/client/models/session_service_session_field_name.rb +++ b/lib/zitadel/client/models/session_service_session_field_name.rb @@ -1,41 +1,61 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class SessionServiceSessionFieldName - SESSION_FIELD_NAME_UNSPECIFIED = "SESSION_FIELD_NAME_UNSPECIFIED".freeze - SESSION_FIELD_NAME_CREATION_DATE = "SESSION_FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [SESSION_FIELD_NAME_UNSPECIFIED, SESSION_FIELD_NAME_CREATION_DATE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SessionServiceSessionFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SessionServiceSessionFieldName" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SessionServiceSessionFieldName. + class SessionServiceSessionFieldName + SESSION_FIELD_NAME_UNSPECIFIED = 'SESSION_FIELD_NAME_UNSPECIFIED' + SESSION_FIELD_NAME_CREATION_DATE = 'SESSION_FIELD_NAME_CREATION_DATE' + + # Frozen set of all allowed values, used for validation. + VALUES = [SESSION_FIELD_NAME_UNSPECIFIED, SESSION_FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SessionServiceSessionFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/session_service_set_session_request.rb b/lib/zitadel/client/models/session_service_set_session_request.rb index 0a08df73..7e6c67f5 100644 --- a/lib/zitadel/client/models/session_service_set_session_request.rb +++ b/lib/zitadel/client/models/session_service_set_session_request.rb @@ -1,266 +1,100 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceSetSessionRequest - # The unique identifier of the session to be updated. - attr_accessor :session_id - - # Deprecated: the session token is no longer required when updating a session and will be ignored when provided. - attr_accessor :session_token - - attr_accessor :checks - - # Additional custom key value pairs to be stored on the session. Existing keys will be overwritten. To delete a key, set its value to an empty byte array. Note that metadata keys cannot be changed once the session has been created. You need to create a new entry and delete the old one instead. - attr_accessor :metadata - - attr_accessor :challenges - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :lifetime - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'session_id' => :'sessionId', - :'session_token' => :'sessionToken', - :'checks' => :'checks', - :'metadata' => :'metadata', - :'challenges' => :'challenges', - :'lifetime' => :'lifetime' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'session_id' => :'String', - :'session_token' => :'String', - :'checks' => :'SessionServiceChecks', - :'metadata' => :'Hash', - :'challenges' => :'SessionServiceRequestChallenges', - :'lifetime' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceSetSessionRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceSetSessionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'session_id') - self.session_id = attributes[:'session_id'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - - if attributes.key?(:'checks') - self.checks = attributes[:'checks'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'challenges') - self.challenges = attributes[:'challenges'] - end - - if attributes.key?(:'lifetime') - self.lifetime = attributes[:'lifetime'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_id == o.session_id && - session_token == o.session_token && - checks == o.checks && - metadata == o.metadata && - challenges == o.challenges && - lifetime == o.lifetime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [session_id, session_token, checks, metadata, challenges, lifetime].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceSetSessionRequest. + class SessionServiceSetSessionRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + session_id: 'sessionId', + session_token: 'sessionToken', + checks: 'checks', + metadata: 'metadata', + challenges: 'challenges', + lifetime: 'lifetime' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + session_id: 'String', + session_token: 'String', + checks: 'SessionServiceChecks', + metadata: 'Hash', + challenges: 'SessionServiceRequestChallenges', + lifetime: 'ISO8601::Duration' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + inner: 'byte[]', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the session to be updated. + # @example null + attribute :session_id, Types::Any.optional.meta(omittable: true) + # Deprecated: the session token is no longer required when updating a session and will be ignored when provided. + # @example null + # @deprecated This property is deprecated. + attribute :session_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :checks, Types::Any.optional.meta(omittable: true) + # Additional custom key value pairs to be stored on the session. Existing keys will be overwritten. To delete a key, set its value to an empty byte array. Note that metadata keys cannot be changed once the session has been created. You need to create a new entry and delete the old one instead. + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :challenges, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :lifetime, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_set_session_response.rb b/lib/zitadel/client/models/session_service_set_session_response.rb index 4b616919..30459b36 100644 --- a/lib/zitadel/client/models/session_service_set_session_response.rb +++ b/lib/zitadel/client/models/session_service_set_session_response.rb @@ -1,234 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceSetSessionResponse - attr_accessor :details - - # The current token of the session, which is required for using the session as authentication, e.g.when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. The previous token was invalidated and can no longer be used. - attr_accessor :session_token - - attr_accessor :challenges - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'session_token' => :'sessionToken', - :'challenges' => :'challenges' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SessionServiceDetails', - :'session_token' => :'String', - :'challenges' => :'SessionServiceChallenges' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceSetSessionResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceSetSessionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'session_token') - self.session_token = attributes[:'session_token'] - end - - if attributes.key?(:'challenges') - self.challenges = attributes[:'challenges'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - session_token == o.session_token && - challenges == o.challenges - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, session_token, challenges].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceSetSessionResponse. + class SessionServiceSetSessionResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + session_token: 'sessionToken', + challenges: 'challenges' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SessionServiceDetails', + session_token: 'String', + challenges: 'SessionServiceChallenges' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # The current token of the session, which is required for using the session as authentication, e.g.when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. The previous token was invalidated and can no longer be used. + # @example null + attribute :session_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :challenges, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_t_o_t_p_factor.rb b/lib/zitadel/client/models/session_service_t_o_t_p_factor.rb deleted file mode 100644 index 1b4a027a..00000000 --- a/lib/zitadel/client/models/session_service_t_o_t_p_factor.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceTOTPFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceTOTPFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceTOTPFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_timestamp_query_method.rb b/lib/zitadel/client/models/session_service_timestamp_query_method.rb index ae773017..0d8b336f 100644 --- a/lib/zitadel/client/models/session_service_timestamp_query_method.rb +++ b/lib/zitadel/client/models/session_service_timestamp_query_method.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class SessionServiceTimestampQueryMethod - TIMESTAMP_QUERY_METHOD_EQUALS = "TIMESTAMP_QUERY_METHOD_EQUALS".freeze - TIMESTAMP_QUERY_METHOD_GREATER = "TIMESTAMP_QUERY_METHOD_GREATER".freeze - TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS = "TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS".freeze - TIMESTAMP_QUERY_METHOD_LESS = "TIMESTAMP_QUERY_METHOD_LESS".freeze - TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS = "TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SessionServiceTimestampQueryMethod. + class SessionServiceTimestampQueryMethod + TIMESTAMP_QUERY_METHOD_EQUALS = 'TIMESTAMP_QUERY_METHOD_EQUALS' + TIMESTAMP_QUERY_METHOD_GREATER = 'TIMESTAMP_QUERY_METHOD_GREATER' + TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS = 'TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS' + TIMESTAMP_QUERY_METHOD_LESS = 'TIMESTAMP_QUERY_METHOD_LESS' + TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS = 'TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS' - def self.all_vars - @all_vars ||= [TIMESTAMP_QUERY_METHOD_EQUALS, TIMESTAMP_QUERY_METHOD_GREATER, TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS, TIMESTAMP_QUERY_METHOD_LESS, TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [TIMESTAMP_QUERY_METHOD_EQUALS, TIMESTAMP_QUERY_METHOD_GREATER, TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS, TIMESTAMP_QUERY_METHOD_LESS, TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SessionServiceTimestampQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SessionServiceTimestampQueryMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SessionServiceTimestampQueryMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/session_service_totp_factor.rb b/lib/zitadel/client/models/session_service_totp_factor.rb new file mode 100644 index 00000000..c107bc9b --- /dev/null +++ b/lib/zitadel/client/models/session_service_totp_factor.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceTOTPFactor. + class SessionServiceTOTPFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_user_agent.rb b/lib/zitadel/client/models/session_service_user_agent.rb index 8a31f325..f295866f 100644 --- a/lib/zitadel/client/models/session_service_user_agent.rb +++ b/lib/zitadel/client/models/session_service_user_agent.rb @@ -1,250 +1,88 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceUserAgent - # FingerprintID is a unique identifier for the user agent's fingerprint. It can be used to group sessions by device or browser. - attr_accessor :fingerprint_id - - # IP is the IP address from which the session was created. - attr_accessor :ip - - # Description is a human-readable description of the user agent. - attr_accessor :description - - attr_accessor :header - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fingerprint_id' => :'fingerprintId', - :'ip' => :'ip', - :'description' => :'description', - :'header' => :'header' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'fingerprint_id' => :'String', - :'ip' => :'String', - :'description' => :'String', - :'header' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'fingerprint_id', - :'ip', - :'description', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceUserAgent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceUserAgent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fingerprint_id') - self.fingerprint_id = attributes[:'fingerprint_id'] - end - - if attributes.key?(:'ip') - self.ip = attributes[:'ip'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'header') - if (value = attributes[:'header']).is_a?(Hash) - self.header = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fingerprint_id == o.fingerprint_id && - ip == o.ip && - description == o.description && - header == o.header - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fingerprint_id, ip, description, header].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceUserAgent. + class SessionServiceUserAgent < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + fingerprint_id: 'fingerprintId', + ip: 'ip', + description: 'description', + header: 'header' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + fingerprint_id: 'String', + ip: 'String', + description: 'String', + header: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # FingerprintID is a unique identifier for the user agent's fingerprint. It can be used to group sessions by device or browser. + # @example null + attribute :fingerprint_id, Types::Any.optional.meta(omittable: true) + # IP is the IP address from which the session was created. + # @example null + attribute :ip, Types::Any.optional.meta(omittable: true) + # Description is a human-readable description of the user agent. + # @example null + attribute :description, Types::Any.optional.meta(omittable: true) + # @example null + attribute :header, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_user_agent_query.rb b/lib/zitadel/client/models/session_service_user_agent_query.rb index 9e40625f..41aa2997 100644 --- a/lib/zitadel/client/models/session_service_user_agent_query.rb +++ b/lib/zitadel/client/models/session_service_user_agent_query.rb @@ -1,217 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceUserAgentQuery - # Finger print id of the user agent used for the session. Set an empty fingerprint_id to use the user agent from the call. If the user agent is not available from the current token, an error will be returned. - attr_accessor :fingerprint_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'fingerprint_id' => :'fingerprintId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'fingerprint_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'fingerprint_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceUserAgentQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceUserAgentQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'fingerprint_id') - self.fingerprint_id = attributes[:'fingerprint_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - fingerprint_id == o.fingerprint_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [fingerprint_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceUserAgentQuery. + class SessionServiceUserAgentQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + fingerprint_id: 'fingerprintId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + fingerprint_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Finger print id of the user agent used for the session. Set an empty fingerprint_id to use the user agent from the call. If the user agent is not available from the current token, an error will be returned. + # @example null + attribute :fingerprint_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/session_service_user_factor.rb b/lib/zitadel/client/models/session_service_user_factor.rb index d291b9e0..1f377cd9 100644 --- a/lib/zitadel/client/models/session_service_user_factor.rb +++ b/lib/zitadel/client/models/session_service_user_factor.rb @@ -1,256 +1,94 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceUserFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # The unique identifier of the user that was verified. - attr_accessor :id - - # The login name of the user that was verified. - attr_accessor :login_name - - # The display name of the user that was verified. - attr_accessor :display_name - - # The id of the organization the user belongs to. - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt', - :'id' => :'id', - :'login_name' => :'loginName', - :'display_name' => :'displayName', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time', - :'id' => :'String', - :'login_name' => :'String', - :'display_name' => :'String', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceUserFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceUserFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'login_name') - self.login_name = attributes[:'login_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at && - id == o.id && - login_name == o.login_name && - display_name == o.display_name && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at, id, login_name, display_name, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceUserFactor. + class SessionServiceUserFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt', + id: 'id', + login_name: 'loginName', + display_name: 'displayName', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time', + id: 'String', + login_name: 'String', + display_name: 'String', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) + # The unique identifier of the user that was verified. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # The login name of the user that was verified. + # @example null + attribute :login_name, Types::Any.optional.meta(omittable: true) + # The display name of the user that was verified. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # The id of the organization the user belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_user_i_d_query.rb b/lib/zitadel/client/models/session_service_user_i_d_query.rb deleted file mode 100644 index 188bed9b..00000000 --- a/lib/zitadel/client/models/session_service_user_i_d_query.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class SessionServiceUserIDQuery - # ID of the user whose sessions are being searched for. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceUserIDQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceUserIDQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/session_service_user_id_query.rb b/lib/zitadel/client/models/session_service_user_id_query.rb new file mode 100644 index 00000000..875f2e4b --- /dev/null +++ b/lib/zitadel/client/models/session_service_user_id_query.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceUserIDQuery. + class SessionServiceUserIDQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # ID of the user whose sessions are being searched for. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/session_service_user_verification_requirement.rb b/lib/zitadel/client/models/session_service_user_verification_requirement.rb index 29d076c0..c30b296a 100644 --- a/lib/zitadel/client/models/session_service_user_verification_requirement.rb +++ b/lib/zitadel/client/models/session_service_user_verification_requirement.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class SessionServiceUserVerificationRequirement - USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED".freeze - USER_VERIFICATION_REQUIREMENT_REQUIRED = "USER_VERIFICATION_REQUIREMENT_REQUIRED".freeze - USER_VERIFICATION_REQUIREMENT_PREFERRED = "USER_VERIFICATION_REQUIREMENT_PREFERRED".freeze - USER_VERIFICATION_REQUIREMENT_DISCOURAGED = "USER_VERIFICATION_REQUIREMENT_DISCOURAGED".freeze - - def self.all_vars - @all_vars ||= [USER_VERIFICATION_REQUIREMENT_UNSPECIFIED, USER_VERIFICATION_REQUIREMENT_REQUIRED, USER_VERIFICATION_REQUIREMENT_PREFERRED, USER_VERIFICATION_REQUIREMENT_DISCOURAGED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SessionServiceUserVerificationRequirement.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SessionServiceUserVerificationRequirement" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SessionServiceUserVerificationRequirement. + class SessionServiceUserVerificationRequirement + USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED' + USER_VERIFICATION_REQUIREMENT_REQUIRED = 'USER_VERIFICATION_REQUIREMENT_REQUIRED' + USER_VERIFICATION_REQUIREMENT_PREFERRED = 'USER_VERIFICATION_REQUIREMENT_PREFERRED' + USER_VERIFICATION_REQUIREMENT_DISCOURAGED = 'USER_VERIFICATION_REQUIREMENT_DISCOURAGED' + + # Frozen set of all allowed values, used for validation. + VALUES = [USER_VERIFICATION_REQUIREMENT_UNSPECIFIED, USER_VERIFICATION_REQUIREMENT_REQUIRED, USER_VERIFICATION_REQUIREMENT_PREFERRED, USER_VERIFICATION_REQUIREMENT_DISCOURAGED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SessionServiceUserVerificationRequirement: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/session_service_web_auth_n.rb b/lib/zitadel/client/models/session_service_web_auth_n.rb index 68756616..88060928 100644 --- a/lib/zitadel/client/models/session_service_web_auth_n.rb +++ b/lib/zitadel/client/models/session_service_web_auth_n.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceWebAuthN - # The domain on which the session was created. Will be used in the WebAuthN challenge. It must be either the exact domain or a top-level domain of the origin of the request. For example if the request is coming from \"login.example.com\", the domain can be \"login.example.com\" or \"example.com\", but not \"other.com\" or \"sub.login.example.com\". See also: https://www.w3.org/TR/webauthn/#relying-party-identifier - attr_accessor :domain - - attr_accessor :user_verification_requirement - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'domain' => :'domain', - :'user_verification_requirement' => :'userVerificationRequirement' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'domain' => :'String', - :'user_verification_requirement' => :'SessionServiceUserVerificationRequirement' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceWebAuthN` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceWebAuthN`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - - if attributes.key?(:'user_verification_requirement') - self.user_verification_requirement = attributes[:'user_verification_requirement'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - domain == o.domain && - user_verification_requirement == o.user_verification_requirement - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [domain, user_verification_requirement].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceWebAuthN. + class SessionServiceWebAuthN < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + domain: 'domain', + user_verification_requirement: 'userVerificationRequirement' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + domain: 'String', + user_verification_requirement: 'SessionServiceUserVerificationRequirement' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The domain on which the session was created. Will be used in the WebAuthN challenge. It must be either the exact domain or a top-level domain of the origin of the request. For example if the request is coming from \"login.example.com\", the domain can be \"login.example.com\" or \"example.com\", but not \"other.com\" or \"sub.login.example.com\". See also: https://www.w3.org/TR/webauthn/#relying-party-identifier + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_verification_requirement, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/session_service_web_auth_n_factor.rb b/lib/zitadel/client/models/session_service_web_auth_n_factor.rb index ce872214..050e538d 100644 --- a/lib/zitadel/client/models/session_service_web_auth_n_factor.rb +++ b/lib/zitadel/client/models/session_service_web_auth_n_factor.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SessionServiceWebAuthNFactor - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :verified_at - - # Indicates if the user presence was verified during the last challenge. This can be used to determine if the factor can be considered as multi-factor authentication. - attr_accessor :user_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verified_at' => :'verifiedAt', - :'user_verified' => :'userVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verified_at' => :'Time', - :'user_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SessionServiceWebAuthNFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SessionServiceWebAuthNFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verified_at') - self.verified_at = attributes[:'verified_at'] - end - - if attributes.key?(:'user_verified') - self.user_verified = attributes[:'user_verified'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verified_at == o.verified_at && - user_verified == o.user_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verified_at, user_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SessionServiceWebAuthNFactor. + class SessionServiceWebAuthNFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + verified_at: 'verifiedAt', + user_verified: 'userVerified' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + verified_at: 'Time', + user_verified: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :verified_at, Types::Any.optional.meta(omittable: true) + # Indicates if the user presence was verified during the last challenge. This can be used to determine if the factor can be considered as multi-factor authentication. + # @example null + attribute :user_verified, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_any.rb b/lib/zitadel/client/models/settings_service_any.rb index 9f1e4f71..d6f31de5 100644 --- a/lib/zitadel/client/models/settings_service_any.rb +++ b/lib/zitadel/client/models/settings_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class SettingsServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class SettingsServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_auto_linking_option.rb b/lib/zitadel/client/models/settings_service_auto_linking_option.rb index da310d66..3d1140f8 100644 --- a/lib/zitadel/client/models/settings_service_auto_linking_option.rb +++ b/lib/zitadel/client/models/settings_service_auto_linking_option.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class SettingsServiceAutoLinkingOption - AUTO_LINKING_OPTION_UNSPECIFIED = "AUTO_LINKING_OPTION_UNSPECIFIED".freeze - AUTO_LINKING_OPTION_USERNAME = "AUTO_LINKING_OPTION_USERNAME".freeze - AUTO_LINKING_OPTION_EMAIL = "AUTO_LINKING_OPTION_EMAIL".freeze - - def self.all_vars - @all_vars ||= [AUTO_LINKING_OPTION_UNSPECIFIED, AUTO_LINKING_OPTION_USERNAME, AUTO_LINKING_OPTION_EMAIL].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SettingsServiceAutoLinkingOption.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SettingsServiceAutoLinkingOption" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SettingsServiceAutoLinkingOption. + class SettingsServiceAutoLinkingOption + AUTO_LINKING_OPTION_UNSPECIFIED = 'AUTO_LINKING_OPTION_UNSPECIFIED' + AUTO_LINKING_OPTION_USERNAME = 'AUTO_LINKING_OPTION_USERNAME' + AUTO_LINKING_OPTION_EMAIL = 'AUTO_LINKING_OPTION_EMAIL' + + # Frozen set of all allowed values, used for validation. + VALUES = [AUTO_LINKING_OPTION_UNSPECIFIED, AUTO_LINKING_OPTION_USERNAME, AUTO_LINKING_OPTION_EMAIL].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SettingsServiceAutoLinkingOption: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/settings_service_branding_settings.rb b/lib/zitadel/client/models/settings_service_branding_settings.rb index fe6faa71..6475f1d8 100644 --- a/lib/zitadel/client/models/settings_service_branding_settings.rb +++ b/lib/zitadel/client/models/settings_service_branding_settings.rb @@ -1,294 +1,100 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceBrandingSettings - attr_accessor :light_theme - - attr_accessor :dark_theme - - # The url where the font is served. - attr_accessor :font_url - - # If enabled, the organization suffix will be hidden on the login form if the scope \\\"urn:zitadel:iam:org:domain:primary:{domainname}\\\" is used. - attr_accessor :hide_login_name_suffix - - # If enabled, the Zitadel logo will not be displayed on the login screen. - attr_accessor :disable_watermark - - attr_accessor :resource_owner_type - - attr_accessor :theme_mode - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'light_theme' => :'lightTheme', - :'dark_theme' => :'darkTheme', - :'font_url' => :'fontUrl', - :'hide_login_name_suffix' => :'hideLoginNameSuffix', - :'disable_watermark' => :'disableWatermark', - :'resource_owner_type' => :'resourceOwnerType', - :'theme_mode' => :'themeMode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'light_theme' => :'SettingsServiceTheme', - :'dark_theme' => :'SettingsServiceTheme', - :'font_url' => :'String', - :'hide_login_name_suffix' => :'Boolean', - :'disable_watermark' => :'Boolean', - :'resource_owner_type' => :'SettingsServiceResourceOwnerType', - :'theme_mode' => :'SettingsServiceThemeMode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceBrandingSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceBrandingSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'light_theme') - self.light_theme = attributes[:'light_theme'] - end - - if attributes.key?(:'dark_theme') - self.dark_theme = attributes[:'dark_theme'] - end - - if attributes.key?(:'font_url') - self.font_url = attributes[:'font_url'] - end - - if attributes.key?(:'hide_login_name_suffix') - self.hide_login_name_suffix = attributes[:'hide_login_name_suffix'] - end - - if attributes.key?(:'disable_watermark') - self.disable_watermark = attributes[:'disable_watermark'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - - if attributes.key?(:'theme_mode') - self.theme_mode = attributes[:'theme_mode'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - light_theme == o.light_theme && - dark_theme == o.dark_theme && - font_url == o.font_url && - hide_login_name_suffix == o.hide_login_name_suffix && - disable_watermark == o.disable_watermark && - resource_owner_type == o.resource_owner_type && - theme_mode == o.theme_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [light_theme, dark_theme, font_url, hide_login_name_suffix, disable_watermark, resource_owner_type, theme_mode].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceBrandingSettings. + class SettingsServiceBrandingSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + light_theme: 'lightTheme', + dark_theme: 'darkTheme', + font_url: 'fontUrl', + hide_login_name_suffix: 'hideLoginNameSuffix', + disable_watermark: 'disableWatermark', + resource_owner_type: 'resourceOwnerType', + theme_mode: 'themeMode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + light_theme: 'SettingsServiceTheme', + dark_theme: 'SettingsServiceTheme', + font_url: 'String', + hide_login_name_suffix: 'Boolean', + disable_watermark: 'Boolean', + resource_owner_type: 'SettingsServiceResourceOwnerType', + theme_mode: 'SettingsServiceThemeMode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :light_theme, Types::Any.optional.meta(omittable: true) + # @example null + attribute :dark_theme, Types::Any.optional.meta(omittable: true) + # The url where the font is served. + # @example null + attribute :font_url, Types::Any.optional.meta(omittable: true) + # If enabled, the organization suffix will be hidden on the login form if the scope \\\"urn:zitadel:iam:org:domain:primary:{domainname}\\\" is used. + # @example null + attribute :hide_login_name_suffix, Types::Any.optional.meta(omittable: true) + # If enabled, the Zitadel logo will not be displayed on the login screen. + # @example null + attribute :disable_watermark, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :theme_mode, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_connect_error.rb b/lib/zitadel/client/models/settings_service_connect_error.rb index baee712e..612d88e3 100644 --- a/lib/zitadel/client/models/settings_service_connect_error.rb +++ b/lib/zitadel/client/models/settings_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class SettingsServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class SettingsServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_details.rb b/lib/zitadel/client/models/settings_service_details.rb index 9a155bd1..01a253e9 100644 --- a/lib/zitadel/client/models/settings_service_details.rb +++ b/lib/zitadel/client/models/settings_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceDetails. + class SettingsServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_domain_settings.rb b/lib/zitadel/client/models/settings_service_domain_settings.rb index 878c9e1a..50846a82 100644 --- a/lib/zitadel/client/models/settings_service_domain_settings.rb +++ b/lib/zitadel/client/models/settings_service_domain_settings.rb @@ -1,267 +1,88 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceDomainSettings - # If enabled, the login name will automatically be suffixed with the domain of the organization. This ensures that the login name is unique across the instance. - attr_accessor :login_name_includes_domain - - # If enabled, organization domains must be verified (through an DNS or HTTP challenge) upon creation. If disabled, organization domains will be created as already verified automatically. - attr_accessor :require_org_domain_verification - - # If enabled, the SMTP sender address domain must match custom domain on the instance. - attr_accessor :smtp_sender_address_matches_instance_domain - - attr_accessor :resource_owner_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_name_includes_domain' => :'loginNameIncludesDomain', - :'require_org_domain_verification' => :'requireOrgDomainVerification', - :'smtp_sender_address_matches_instance_domain' => :'smtpSenderAddressMatchesInstanceDomain', - :'resource_owner_type' => :'resourceOwnerType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_name_includes_domain' => :'Boolean', - :'require_org_domain_verification' => :'Boolean', - :'smtp_sender_address_matches_instance_domain' => :'Boolean', - :'resource_owner_type' => :'SettingsServiceResourceOwnerType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceDomainSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceDomainSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_name_includes_domain') - self.login_name_includes_domain = attributes[:'login_name_includes_domain'] - end - - if attributes.key?(:'require_org_domain_verification') - self.require_org_domain_verification = attributes[:'require_org_domain_verification'] - end - - if attributes.key?(:'smtp_sender_address_matches_instance_domain') - self.smtp_sender_address_matches_instance_domain = attributes[:'smtp_sender_address_matches_instance_domain'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_name_includes_domain == o.login_name_includes_domain && - require_org_domain_verification == o.require_org_domain_verification && - smtp_sender_address_matches_instance_domain == o.smtp_sender_address_matches_instance_domain && - resource_owner_type == o.resource_owner_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_name_includes_domain, require_org_domain_verification, smtp_sender_address_matches_instance_domain, resource_owner_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceDomainSettings. + class SettingsServiceDomainSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_name_includes_domain: 'loginNameIncludesDomain', + require_org_domain_verification: 'requireOrgDomainVerification', + smtp_sender_address_matches_instance_domain: 'smtpSenderAddressMatchesInstanceDomain', + resource_owner_type: 'resourceOwnerType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_name_includes_domain: 'Boolean', + require_org_domain_verification: 'Boolean', + smtp_sender_address_matches_instance_domain: 'Boolean', + resource_owner_type: 'SettingsServiceResourceOwnerType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # If enabled, the login name will automatically be suffixed with the domain of the organization. This ensures that the login name is unique across the instance. + # @example null + attribute :login_name_includes_domain, Types::Any.optional.meta(omittable: true) + # If enabled, organization domains must be verified (through an DNS or HTTP challenge) upon creation. If disabled, organization domains will be created as already verified automatically. + # @example null + attribute :require_org_domain_verification, Types::Any.optional.meta(omittable: true) + # If enabled, the SMTP sender address domain must match custom domain on the instance. + # @example null + attribute :smtp_sender_address_matches_instance_domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_embedded_iframe_settings.rb b/lib/zitadel/client/models/settings_service_embedded_iframe_settings.rb index cf67e19b..773f2894 100644 --- a/lib/zitadel/client/models/settings_service_embedded_iframe_settings.rb +++ b/lib/zitadel/client/models/settings_service_embedded_iframe_settings.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceEmbeddedIframeSettings - # Enabled states if iframe embedding is enabled or disabled. - attr_accessor :enabled - - # AllowedOrigins defines which origins are allowed to embed ZITADEL in an iframe. - attr_accessor :allowed_origins - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enabled' => :'enabled', - :'allowed_origins' => :'allowedOrigins' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'enabled' => :'Boolean', - :'allowed_origins' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceEmbeddedIframeSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceEmbeddedIframeSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enabled') - self.enabled = attributes[:'enabled'] - end - - if attributes.key?(:'allowed_origins') - if (value = attributes[:'allowed_origins']).is_a?(Array) - self.allowed_origins = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enabled == o.enabled && - allowed_origins == o.allowed_origins - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enabled, allowed_origins].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceEmbeddedIframeSettings. + class SettingsServiceEmbeddedIframeSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + enabled: 'enabled', + allowed_origins: 'allowedOrigins' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + enabled: 'Boolean', + allowed_origins: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Enabled states if iframe embedding is enabled or disabled. + # @example null + attribute :enabled, Types::Any.optional.meta(omittable: true) + # AllowedOrigins defines which origins are allowed to embed ZITADEL in an iframe. + # @example null + attribute :allowed_origins, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_active_identity_providers_request.rb b/lib/zitadel/client/models/settings_service_get_active_identity_providers_request.rb index 8a6c0e25..6046347d 100644 --- a/lib/zitadel/client/models/settings_service_get_active_identity_providers_request.rb +++ b/lib/zitadel/client/models/settings_service_get_active_identity_providers_request.rb @@ -1,255 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetActiveIdentityProvidersRequest - attr_accessor :ctx - - attr_accessor :creation_allowed - - attr_accessor :linking_allowed - - attr_accessor :auto_creation - - attr_accessor :auto_linking - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx', - :'creation_allowed' => :'creationAllowed', - :'linking_allowed' => :'linkingAllowed', - :'auto_creation' => :'autoCreation', - :'auto_linking' => :'autoLinking' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'SettingsServiceRequestContext', - :'creation_allowed' => :'Boolean', - :'linking_allowed' => :'Boolean', - :'auto_creation' => :'Boolean', - :'auto_linking' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'creation_allowed', - :'linking_allowed', - :'auto_creation', - :'auto_linking' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetActiveIdentityProvidersRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetActiveIdentityProvidersRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - - if attributes.key?(:'creation_allowed') - self.creation_allowed = attributes[:'creation_allowed'] - end - - if attributes.key?(:'linking_allowed') - self.linking_allowed = attributes[:'linking_allowed'] - end - - if attributes.key?(:'auto_creation') - self.auto_creation = attributes[:'auto_creation'] - end - - if attributes.key?(:'auto_linking') - self.auto_linking = attributes[:'auto_linking'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx && - creation_allowed == o.creation_allowed && - linking_allowed == o.linking_allowed && - auto_creation == o.auto_creation && - auto_linking == o.auto_linking - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx, creation_allowed, linking_allowed, auto_creation, auto_linking].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetActiveIdentityProvidersRequest. + class SettingsServiceGetActiveIdentityProvidersRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx', + creation_allowed: 'creationAllowed', + linking_allowed: 'linkingAllowed', + auto_creation: 'autoCreation', + auto_linking: 'autoLinking' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'SettingsServiceRequestContext', + creation_allowed: 'Boolean', + linking_allowed: 'Boolean', + auto_creation: 'Boolean', + auto_linking: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) + # @example null + attribute :creation_allowed, Types::Any.optional.meta(omittable: true) + # @example null + attribute :linking_allowed, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auto_creation, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auto_linking, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_get_active_identity_providers_response.rb b/lib/zitadel/client/models/settings_service_get_active_identity_providers_response.rb index ada48086..38d95dd3 100644 --- a/lib/zitadel/client/models/settings_service_get_active_identity_providers_response.rb +++ b/lib/zitadel/client/models/settings_service_get_active_identity_providers_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetActiveIdentityProvidersResponse - attr_accessor :details - - attr_accessor :identity_providers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'identity_providers' => :'identityProviders' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceListDetails', - :'identity_providers' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetActiveIdentityProvidersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetActiveIdentityProvidersResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'identity_providers') - if (value = attributes[:'identity_providers']).is_a?(Array) - self.identity_providers = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - identity_providers == o.identity_providers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, identity_providers].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetActiveIdentityProvidersResponse. + class SettingsServiceGetActiveIdentityProvidersResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + identity_providers: 'identityProviders' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceListDetails', + identity_providers: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :identity_providers, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_branding_settings_request.rb b/lib/zitadel/client/models/settings_service_get_branding_settings_request.rb index f7f29d03..7ae71890 100644 --- a/lib/zitadel/client/models/settings_service_get_branding_settings_request.rb +++ b/lib/zitadel/client/models/settings_service_get_branding_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetBrandingSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'SettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetBrandingSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetBrandingSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetBrandingSettingsRequest. + class SettingsServiceGetBrandingSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'SettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_branding_settings_response.rb b/lib/zitadel/client/models/settings_service_get_branding_settings_response.rb index 52bb601b..f739af8c 100644 --- a/lib/zitadel/client/models/settings_service_get_branding_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_branding_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetBrandingSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceDetails', - :'settings' => :'SettingsServiceBrandingSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetBrandingSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetBrandingSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetBrandingSettingsResponse. + class SettingsServiceGetBrandingSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceDetails', + settings: 'SettingsServiceBrandingSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_domain_settings_request.rb b/lib/zitadel/client/models/settings_service_get_domain_settings_request.rb index dc35c3d6..96f357a9 100644 --- a/lib/zitadel/client/models/settings_service_get_domain_settings_request.rb +++ b/lib/zitadel/client/models/settings_service_get_domain_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetDomainSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'SettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetDomainSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetDomainSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetDomainSettingsRequest. + class SettingsServiceGetDomainSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'SettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_domain_settings_response.rb b/lib/zitadel/client/models/settings_service_get_domain_settings_response.rb index 182867ff..261b12a2 100644 --- a/lib/zitadel/client/models/settings_service_get_domain_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_domain_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetDomainSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceDetails', - :'settings' => :'SettingsServiceDomainSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetDomainSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetDomainSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetDomainSettingsResponse. + class SettingsServiceGetDomainSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceDetails', + settings: 'SettingsServiceDomainSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_general_settings_response.rb b/lib/zitadel/client/models/settings_service_get_general_settings_response.rb index 25ad0b26..730f58f2 100644 --- a/lib/zitadel/client/models/settings_service_get_general_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_general_settings_response.rb @@ -1,260 +1,94 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetGeneralSettingsResponse - # The unique identifier of the default organization. The default organization is used to assign new users to an organization if no other organization is specified. Deprecated: use default_organization_id instead. - attr_accessor :default_org_id - - # The default language is use if no other language is specified or detected. The format is a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). - attr_accessor :default_language - - # The list of supported languages. Note that the instance might restrict the languages further only allowing a subset of these languages to be used. The format is a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). - attr_accessor :supported_languages - - # The unique identifier of the default organization. The default organization is used to assign new users to an organization if no other organization is specified. - attr_accessor :default_organization_id - - # The list of allowed languages for the instance. This is a subset of the supported languages to be used in the instance e.g. for user selection during registration or language detection in the UI. The format is a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). - attr_accessor :allowed_languages - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'default_org_id' => :'defaultOrgId', - :'default_language' => :'defaultLanguage', - :'supported_languages' => :'supportedLanguages', - :'default_organization_id' => :'defaultOrganizationId', - :'allowed_languages' => :'allowedLanguages' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'default_org_id' => :'String', - :'default_language' => :'String', - :'supported_languages' => :'Array', - :'default_organization_id' => :'String', - :'allowed_languages' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetGeneralSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetGeneralSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'default_org_id') - self.default_org_id = attributes[:'default_org_id'] - end - - if attributes.key?(:'default_language') - self.default_language = attributes[:'default_language'] - end - - if attributes.key?(:'supported_languages') - if (value = attributes[:'supported_languages']).is_a?(Array) - self.supported_languages = value - end - end - - if attributes.key?(:'default_organization_id') - self.default_organization_id = attributes[:'default_organization_id'] - end - - if attributes.key?(:'allowed_languages') - if (value = attributes[:'allowed_languages']).is_a?(Array) - self.allowed_languages = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - default_org_id == o.default_org_id && - default_language == o.default_language && - supported_languages == o.supported_languages && - default_organization_id == o.default_organization_id && - allowed_languages == o.allowed_languages - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [default_org_id, default_language, supported_languages, default_organization_id, allowed_languages].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetGeneralSettingsResponse. + class SettingsServiceGetGeneralSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + default_org_id: 'defaultOrgId', + default_language: 'defaultLanguage', + supported_languages: 'supportedLanguages', + default_organization_id: 'defaultOrganizationId', + allowed_languages: 'allowedLanguages' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + default_org_id: 'String', + default_language: 'String', + supported_languages: 'Array', + default_organization_id: 'String', + allowed_languages: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the default organization. The default organization is used to assign new users to an organization if no other organization is specified. Deprecated: use default_organization_id instead. + # @example null + attribute :default_org_id, Types::Any.optional.meta(omittable: true) + # The default language is use if no other language is specified or detected. The format is a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). + # @example null + attribute :default_language, Types::Any.optional.meta(omittable: true) + # The list of supported languages. Note that the instance might restrict the languages further only allowing a subset of these languages to be used. The format is a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). + # @example null + attribute :supported_languages, Types::Any.optional.meta(omittable: true) + # The unique identifier of the default organization. The default organization is used to assign new users to an organization if no other organization is specified. + # @example null + attribute :default_organization_id, Types::Any.optional.meta(omittable: true) + # The list of allowed languages for the instance. This is a subset of the supported languages to be used in the instance e.g. for user selection during registration or language detection in the UI. The format is a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). + # @example null + attribute :allowed_languages, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_get_hosted_login_translation_request.rb b/lib/zitadel/client/models/settings_service_get_hosted_login_translation_request.rb index d8f777b7..670b1f6a 100644 --- a/lib/zitadel/client/models/settings_service_get_hosted_login_translation_request.rb +++ b/lib/zitadel/client/models/settings_service_get_hosted_login_translation_request.rb @@ -1,253 +1,91 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetHostedLoginTranslationRequest - # The locale of the translations to be returned. Needs to be a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). - attr_accessor :locale - - # if set to true, higher levels are ignored, if false higher levels are merged into the file - attr_accessor :ignore_inheritance - - attr_accessor :instance - - attr_accessor :organization_id - - attr_accessor :system - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'locale' => :'locale', - :'ignore_inheritance' => :'ignoreInheritance', - :'instance' => :'instance', - :'organization_id' => :'organizationId', - :'system' => :'system' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'locale' => :'String', - :'ignore_inheritance' => :'Boolean', - :'instance' => :'Boolean', - :'organization_id' => :'String', - :'system' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetHostedLoginTranslationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetHostedLoginTranslationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'locale') - self.locale = attributes[:'locale'] - end - - if attributes.key?(:'ignore_inheritance') - self.ignore_inheritance = attributes[:'ignore_inheritance'] - end - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'system') - self.system = attributes[:'system'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - locale == o.locale && - ignore_inheritance == o.ignore_inheritance && - instance == o.instance && - organization_id == o.organization_id && - system == o.system - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [locale, ignore_inheritance, instance, organization_id, system].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetHostedLoginTranslationRequest. + class SettingsServiceGetHostedLoginTranslationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + locale: 'locale', + ignore_inheritance: 'ignoreInheritance', + instance: 'instance', + organization_id: 'organizationId', + system: 'system' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + locale: 'String', + ignore_inheritance: 'Boolean', + instance: 'Boolean', + organization_id: 'String', + system: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The locale of the translations to be returned. Needs to be a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). + # @example null + attribute :locale, Types::Any.optional.meta(omittable: true) + # if set to true, higher levels are ignored, if false higher levels are merged into the file + # @example null + attribute :ignore_inheritance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :system, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_get_hosted_login_translation_response.rb b/lib/zitadel/client/models/settings_service_get_hosted_login_translation_response.rb index 44c86729..714079df 100644 --- a/lib/zitadel/client/models/settings_service_get_hosted_login_translation_response.rb +++ b/lib/zitadel/client/models/settings_service_get_hosted_login_translation_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetHostedLoginTranslationResponse - # hash of the payload - attr_accessor :etag - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :translations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'etag' => :'etag', - :'translations' => :'translations' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'etag' => :'String', - :'translations' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetHostedLoginTranslationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetHostedLoginTranslationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'etag') - self.etag = attributes[:'etag'] - end - - if attributes.key?(:'translations') - if (value = attributes[:'translations']).is_a?(Hash) - self.translations = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - etag == o.etag && - translations == o.translations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [etag, translations].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetHostedLoginTranslationResponse. + class SettingsServiceGetHostedLoginTranslationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + etag: 'etag', + translations: 'translations' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + etag: 'String', + translations: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # hash of the payload + # @example null + attribute :etag, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :translations, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rb b/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rb index 221ab426..fe743d31 100644 --- a/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rb +++ b/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetLegalAndSupportSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'SettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetLegalAndSupportSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetLegalAndSupportSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetLegalAndSupportSettingsRequest. + class SettingsServiceGetLegalAndSupportSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'SettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_response.rb b/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_response.rb index 50335f16..91820ee4 100644 --- a/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_legal_and_support_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetLegalAndSupportSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceDetails', - :'settings' => :'SettingsServiceLegalAndSupportSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetLegalAndSupportSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetLegalAndSupportSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetLegalAndSupportSettingsResponse. + class SettingsServiceGetLegalAndSupportSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceDetails', + settings: 'SettingsServiceLegalAndSupportSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_lockout_settings_request.rb b/lib/zitadel/client/models/settings_service_get_lockout_settings_request.rb index df8fadce..10cc6c51 100644 --- a/lib/zitadel/client/models/settings_service_get_lockout_settings_request.rb +++ b/lib/zitadel/client/models/settings_service_get_lockout_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetLockoutSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'SettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetLockoutSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetLockoutSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetLockoutSettingsRequest. + class SettingsServiceGetLockoutSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'SettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_lockout_settings_response.rb b/lib/zitadel/client/models/settings_service_get_lockout_settings_response.rb index 583ff8a5..a6033661 100644 --- a/lib/zitadel/client/models/settings_service_get_lockout_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_lockout_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetLockoutSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceDetails', - :'settings' => :'SettingsServiceLockoutSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetLockoutSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetLockoutSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetLockoutSettingsResponse. + class SettingsServiceGetLockoutSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceDetails', + settings: 'SettingsServiceLockoutSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_login_settings_request.rb b/lib/zitadel/client/models/settings_service_get_login_settings_request.rb index dd844756..c9954bdf 100644 --- a/lib/zitadel/client/models/settings_service_get_login_settings_request.rb +++ b/lib/zitadel/client/models/settings_service_get_login_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetLoginSettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'SettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetLoginSettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetLoginSettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetLoginSettingsRequest. + class SettingsServiceGetLoginSettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'SettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_login_settings_response.rb b/lib/zitadel/client/models/settings_service_get_login_settings_response.rb index 41bc19cb..466064db 100644 --- a/lib/zitadel/client/models/settings_service_get_login_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_login_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetLoginSettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceDetails', - :'settings' => :'SettingsServiceLoginSettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetLoginSettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetLoginSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetLoginSettingsResponse. + class SettingsServiceGetLoginSettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceDetails', + settings: 'SettingsServiceLoginSettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_password_complexity_settings_request.rb b/lib/zitadel/client/models/settings_service_get_password_complexity_settings_request.rb index 5e4d2af6..b77487ed 100644 --- a/lib/zitadel/client/models/settings_service_get_password_complexity_settings_request.rb +++ b/lib/zitadel/client/models/settings_service_get_password_complexity_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetPasswordComplexitySettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'SettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetPasswordComplexitySettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetPasswordComplexitySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetPasswordComplexitySettingsRequest. + class SettingsServiceGetPasswordComplexitySettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'SettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_password_complexity_settings_response.rb b/lib/zitadel/client/models/settings_service_get_password_complexity_settings_response.rb index 639ee873..65c5ff13 100644 --- a/lib/zitadel/client/models/settings_service_get_password_complexity_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_password_complexity_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetPasswordComplexitySettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceDetails', - :'settings' => :'SettingsServicePasswordComplexitySettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetPasswordComplexitySettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetPasswordComplexitySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetPasswordComplexitySettingsResponse. + class SettingsServiceGetPasswordComplexitySettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceDetails', + settings: 'SettingsServicePasswordComplexitySettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_password_expiry_settings_request.rb b/lib/zitadel/client/models/settings_service_get_password_expiry_settings_request.rb index 40c24d09..aa94014e 100644 --- a/lib/zitadel/client/models/settings_service_get_password_expiry_settings_request.rb +++ b/lib/zitadel/client/models/settings_service_get_password_expiry_settings_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetPasswordExpirySettingsRequest - attr_accessor :ctx - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ctx' => :'ctx' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ctx' => :'SettingsServiceRequestContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetPasswordExpirySettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetPasswordExpirySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ctx') - self.ctx = attributes[:'ctx'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ctx == o.ctx - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ctx].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetPasswordExpirySettingsRequest. + class SettingsServiceGetPasswordExpirySettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ctx: 'ctx' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ctx: 'SettingsServiceRequestContext' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ctx, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_password_expiry_settings_response.rb b/lib/zitadel/client/models/settings_service_get_password_expiry_settings_response.rb index d3f86c0b..6e569921 100644 --- a/lib/zitadel/client/models/settings_service_get_password_expiry_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_password_expiry_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetPasswordExpirySettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceDetails', - :'settings' => :'SettingsServicePasswordExpirySettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetPasswordExpirySettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetPasswordExpirySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetPasswordExpirySettingsResponse. + class SettingsServiceGetPasswordExpirySettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceDetails', + settings: 'SettingsServicePasswordExpirySettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_get_security_settings_response.rb b/lib/zitadel/client/models/settings_service_get_security_settings_response.rb index df117d89..0aa306c2 100644 --- a/lib/zitadel/client/models/settings_service_get_security_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_get_security_settings_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceGetSecuritySettingsResponse - attr_accessor :details - - attr_accessor :settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'settings' => :'settings' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceDetails', - :'settings' => :'SettingsServiceSecuritySettings' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceGetSecuritySettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceGetSecuritySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'settings') - self.settings = attributes[:'settings'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - settings == o.settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, settings].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceGetSecuritySettingsResponse. + class SettingsServiceGetSecuritySettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + settings: 'settings' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceDetails', + settings: 'SettingsServiceSecuritySettings' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :settings, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_identity_provider.rb b/lib/zitadel/client/models/settings_service_identity_provider.rb index 27c7efd2..9bac1663 100644 --- a/lib/zitadel/client/models/settings_service_identity_provider.rb +++ b/lib/zitadel/client/models/settings_service_identity_provider.rb @@ -1,264 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceIdentityProvider - attr_accessor :id - - attr_accessor :name - - attr_accessor :type - - attr_accessor :options - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'type' => :'type', - :'options' => :'options' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'type' => :'SettingsServiceIdentityProviderType', - :'options' => :'SettingsServiceOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceIdentityProvider` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceIdentityProvider`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - type == o.type && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, type, options].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceIdentityProvider. + class SettingsServiceIdentityProvider < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name', + type: 'type', + options: 'options' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String', + type: 'SettingsServiceIdentityProviderType', + options: 'SettingsServiceOptions' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # @example null + attribute :options, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_identity_provider_type.rb b/lib/zitadel/client/models/settings_service_identity_provider_type.rb index dae3f71f..d3380d8e 100644 --- a/lib/zitadel/client/models/settings_service_identity_provider_type.rb +++ b/lib/zitadel/client/models/settings_service_identity_provider_type.rb @@ -1,52 +1,72 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class SettingsServiceIdentityProviderType - IDENTITY_PROVIDER_TYPE_UNSPECIFIED = "IDENTITY_PROVIDER_TYPE_UNSPECIFIED".freeze - IDENTITY_PROVIDER_TYPE_OIDC = "IDENTITY_PROVIDER_TYPE_OIDC".freeze - IDENTITY_PROVIDER_TYPE_JWT = "IDENTITY_PROVIDER_TYPE_JWT".freeze - IDENTITY_PROVIDER_TYPE_LDAP = "IDENTITY_PROVIDER_TYPE_LDAP".freeze - IDENTITY_PROVIDER_TYPE_OAUTH = "IDENTITY_PROVIDER_TYPE_OAUTH".freeze - IDENTITY_PROVIDER_TYPE_AZURE_AD = "IDENTITY_PROVIDER_TYPE_AZURE_AD".freeze - IDENTITY_PROVIDER_TYPE_GITHUB = "IDENTITY_PROVIDER_TYPE_GITHUB".freeze - IDENTITY_PROVIDER_TYPE_GITHUB_ES = "IDENTITY_PROVIDER_TYPE_GITHUB_ES".freeze - IDENTITY_PROVIDER_TYPE_GITLAB = "IDENTITY_PROVIDER_TYPE_GITLAB".freeze - IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED = "IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED".freeze - IDENTITY_PROVIDER_TYPE_GOOGLE = "IDENTITY_PROVIDER_TYPE_GOOGLE".freeze - IDENTITY_PROVIDER_TYPE_SAML = "IDENTITY_PROVIDER_TYPE_SAML".freeze - IDENTITY_PROVIDER_TYPE_APPLE = "IDENTITY_PROVIDER_TYPE_APPLE".freeze - - def self.all_vars - @all_vars ||= [IDENTITY_PROVIDER_TYPE_UNSPECIFIED, IDENTITY_PROVIDER_TYPE_OIDC, IDENTITY_PROVIDER_TYPE_JWT, IDENTITY_PROVIDER_TYPE_LDAP, IDENTITY_PROVIDER_TYPE_OAUTH, IDENTITY_PROVIDER_TYPE_AZURE_AD, IDENTITY_PROVIDER_TYPE_GITHUB, IDENTITY_PROVIDER_TYPE_GITHUB_ES, IDENTITY_PROVIDER_TYPE_GITLAB, IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED, IDENTITY_PROVIDER_TYPE_GOOGLE, IDENTITY_PROVIDER_TYPE_SAML, IDENTITY_PROVIDER_TYPE_APPLE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SettingsServiceIdentityProviderType. + class SettingsServiceIdentityProviderType + IDENTITY_PROVIDER_TYPE_UNSPECIFIED = 'IDENTITY_PROVIDER_TYPE_UNSPECIFIED' + IDENTITY_PROVIDER_TYPE_OIDC = 'IDENTITY_PROVIDER_TYPE_OIDC' + IDENTITY_PROVIDER_TYPE_JWT = 'IDENTITY_PROVIDER_TYPE_JWT' + IDENTITY_PROVIDER_TYPE_LDAP = 'IDENTITY_PROVIDER_TYPE_LDAP' + IDENTITY_PROVIDER_TYPE_OAUTH = 'IDENTITY_PROVIDER_TYPE_OAUTH' + IDENTITY_PROVIDER_TYPE_AZURE_AD = 'IDENTITY_PROVIDER_TYPE_AZURE_AD' + IDENTITY_PROVIDER_TYPE_GITHUB = 'IDENTITY_PROVIDER_TYPE_GITHUB' + IDENTITY_PROVIDER_TYPE_GITHUB_ES = 'IDENTITY_PROVIDER_TYPE_GITHUB_ES' + IDENTITY_PROVIDER_TYPE_GITLAB = 'IDENTITY_PROVIDER_TYPE_GITLAB' + IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED = 'IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED' + IDENTITY_PROVIDER_TYPE_GOOGLE = 'IDENTITY_PROVIDER_TYPE_GOOGLE' + IDENTITY_PROVIDER_TYPE_SAML = 'IDENTITY_PROVIDER_TYPE_SAML' + IDENTITY_PROVIDER_TYPE_APPLE = 'IDENTITY_PROVIDER_TYPE_APPLE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [IDENTITY_PROVIDER_TYPE_UNSPECIFIED, IDENTITY_PROVIDER_TYPE_OIDC, IDENTITY_PROVIDER_TYPE_JWT, IDENTITY_PROVIDER_TYPE_LDAP, IDENTITY_PROVIDER_TYPE_OAUTH, IDENTITY_PROVIDER_TYPE_AZURE_AD, IDENTITY_PROVIDER_TYPE_GITHUB, IDENTITY_PROVIDER_TYPE_GITHUB_ES, IDENTITY_PROVIDER_TYPE_GITLAB, IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED, IDENTITY_PROVIDER_TYPE_GOOGLE, IDENTITY_PROVIDER_TYPE_SAML, IDENTITY_PROVIDER_TYPE_APPLE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SettingsServiceIdentityProviderType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SettingsServiceIdentityProviderType" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SettingsServiceIdentityProviderType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/settings_service_legal_and_support_settings.rb b/lib/zitadel/client/models/settings_service_legal_and_support_settings.rb index 78c70db5..2a7e34ba 100644 --- a/lib/zitadel/client/models/settings_service_legal_and_support_settings.rb +++ b/lib/zitadel/client/models/settings_service_legal_and_support_settings.rb @@ -1,307 +1,108 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceLegalAndSupportSettings - # Link to the Terms of Service. Can be a relative or absolute URL. - attr_accessor :tos_link - - # Link to the Privacy Policy. Can be a relative or absolute URL. - attr_accessor :privacy_policy_link - - # Link to a help page. Can be a relative or absolute URL. - attr_accessor :help_link - - # Email address for support issues. - attr_accessor :support_email - - attr_accessor :resource_owner_type - - # Link to documentation to be shown in the console. - attr_accessor :docs_link - - # Link to an external resource that will be available to users in the console. - attr_accessor :custom_link - - # The button text that would be shown in console pointing to custom link. - attr_accessor :custom_link_text - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tos_link' => :'tosLink', - :'privacy_policy_link' => :'privacyPolicyLink', - :'help_link' => :'helpLink', - :'support_email' => :'supportEmail', - :'resource_owner_type' => :'resourceOwnerType', - :'docs_link' => :'docsLink', - :'custom_link' => :'customLink', - :'custom_link_text' => :'customLinkText' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'tos_link' => :'String', - :'privacy_policy_link' => :'String', - :'help_link' => :'String', - :'support_email' => :'String', - :'resource_owner_type' => :'SettingsServiceResourceOwnerType', - :'docs_link' => :'String', - :'custom_link' => :'String', - :'custom_link_text' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceLegalAndSupportSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceLegalAndSupportSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tos_link') - self.tos_link = attributes[:'tos_link'] - end - - if attributes.key?(:'privacy_policy_link') - self.privacy_policy_link = attributes[:'privacy_policy_link'] - end - - if attributes.key?(:'help_link') - self.help_link = attributes[:'help_link'] - end - - if attributes.key?(:'support_email') - self.support_email = attributes[:'support_email'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - - if attributes.key?(:'docs_link') - self.docs_link = attributes[:'docs_link'] - end - - if attributes.key?(:'custom_link') - self.custom_link = attributes[:'custom_link'] - end - - if attributes.key?(:'custom_link_text') - self.custom_link_text = attributes[:'custom_link_text'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tos_link == o.tos_link && - privacy_policy_link == o.privacy_policy_link && - help_link == o.help_link && - support_email == o.support_email && - resource_owner_type == o.resource_owner_type && - docs_link == o.docs_link && - custom_link == o.custom_link && - custom_link_text == o.custom_link_text - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tos_link, privacy_policy_link, help_link, support_email, resource_owner_type, docs_link, custom_link, custom_link_text].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceLegalAndSupportSettings. + class SettingsServiceLegalAndSupportSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + tos_link: 'tosLink', + privacy_policy_link: 'privacyPolicyLink', + help_link: 'helpLink', + support_email: 'supportEmail', + resource_owner_type: 'resourceOwnerType', + docs_link: 'docsLink', + custom_link: 'customLink', + custom_link_text: 'customLinkText' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + tos_link: 'String', + privacy_policy_link: 'String', + help_link: 'String', + support_email: 'String', + resource_owner_type: 'SettingsServiceResourceOwnerType', + docs_link: 'String', + custom_link: 'String', + custom_link_text: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Link to the Terms of Service. Can be a relative or absolute URL. + # @example null + attribute :tos_link, Types::Any.optional.meta(omittable: true) + # Link to the Privacy Policy. Can be a relative or absolute URL. + # @example null + attribute :privacy_policy_link, Types::Any.optional.meta(omittable: true) + # Link to a help page. Can be a relative or absolute URL. + # @example null + attribute :help_link, Types::Any.optional.meta(omittable: true) + # Email address for support issues. + # @example null + attribute :support_email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) + # Link to documentation to be shown in the console. + # @example null + attribute :docs_link, Types::Any.optional.meta(omittable: true) + # Link to an external resource that will be available to users in the console. + # @example null + attribute :custom_link, Types::Any.optional.meta(omittable: true) + # The button text that would be shown in console pointing to custom link. + # @example null + attribute :custom_link_text, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_list_details.rb b/lib/zitadel/client/models/settings_service_list_details.rb index c35bccd1..93a368b7 100644 --- a/lib/zitadel/client/models/settings_service_list_details.rb +++ b/lib/zitadel/client/models/settings_service_list_details.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceListDetails - attr_accessor :total_result - - attr_accessor :processed_sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'processed_sequence' => :'processedSequence', - :'timestamp' => :'timestamp' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'processed_sequence' => :'Object', - :'timestamp' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'processed_sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceListDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'processed_sequence') - self.processed_sequence = attributes[:'processed_sequence'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - processed_sequence == o.processed_sequence && - timestamp == o.timestamp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, processed_sequence, timestamp].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceListDetails. + class SettingsServiceListDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + processed_sequence: 'processedSequence', + timestamp: 'timestamp' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + processed_sequence: 'Object', + timestamp: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # @example null + attribute :processed_sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_lockout_settings.rb b/lib/zitadel/client/models/settings_service_lockout_settings.rb index b35980f3..a0a6ba4d 100644 --- a/lib/zitadel/client/models/settings_service_lockout_settings.rb +++ b/lib/zitadel/client/models/settings_service_lockout_settings.rb @@ -1,259 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceLockoutSettings - # The amount of failed password attempts before the account gets locked. Attempts are reset as soon as the password is entered correctly or the password is reset. If set to 0 the account will never be locked. - attr_accessor :max_password_attempts - - attr_accessor :resource_owner_type - - # THe amount of failed OTP (TOTP, SMS, Email) attempts before the account gets locked. Attempts are reset as soon as the OTP is entered correctly. If set to 0 the account will never be locked. - attr_accessor :max_otp_attempts - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'max_password_attempts' => :'maxPasswordAttempts', - :'resource_owner_type' => :'resourceOwnerType', - :'max_otp_attempts' => :'maxOtpAttempts' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'max_password_attempts' => :'Object', - :'resource_owner_type' => :'SettingsServiceResourceOwnerType', - :'max_otp_attempts' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'max_password_attempts', - :'max_otp_attempts' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceLockoutSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceLockoutSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'max_password_attempts') - self.max_password_attempts = attributes[:'max_password_attempts'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - - if attributes.key?(:'max_otp_attempts') - self.max_otp_attempts = attributes[:'max_otp_attempts'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - max_password_attempts == o.max_password_attempts && - resource_owner_type == o.resource_owner_type && - max_otp_attempts == o.max_otp_attempts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [max_password_attempts, resource_owner_type, max_otp_attempts].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceLockoutSettings. + class SettingsServiceLockoutSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + max_password_attempts: 'maxPasswordAttempts', + resource_owner_type: 'resourceOwnerType', + max_otp_attempts: 'maxOtpAttempts' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + max_password_attempts: 'Object', + resource_owner_type: 'SettingsServiceResourceOwnerType', + max_otp_attempts: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The amount of failed password attempts before the account gets locked. Attempts are reset as soon as the password is entered correctly or the password is reset. If set to 0 the account will never be locked. + # @example null + attribute :max_password_attempts, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) + # THe amount of failed OTP (TOTP, SMS, Email) attempts before the account gets locked. Attempts are reset as soon as the OTP is entered correctly. If set to 0 the account will never be locked. + # @example null + attribute :max_otp_attempts, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_login_settings.rb b/lib/zitadel/client/models/settings_service_login_settings.rb index 65238647..7d4d1aed 100644 --- a/lib/zitadel/client/models/settings_service_login_settings.rb +++ b/lib/zitadel/client/models/settings_service_login_settings.rb @@ -1,440 +1,173 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceLoginSettings - # If enabled, users can log in locally with their username and passkeys or password. Disabling this option will require users to log in with an external identity provider. Be sure to allow at least one external identity provider if this option is disabled. Deprecated: check allow_local_authentication instead. - attr_accessor :allow_username_password - - # If enabled, users can log in locally with their username and passkeys or password. Disabling this option will require users to log in with an external identity provider. Be sure to allow at least one external identity provider if this option is disabled. - attr_accessor :allow_local_authentication - - # If enabled, users can register a local account by themself. This option does not effect external identity providers. Each identity provider can be configured to allow or disallow registration. - attr_accessor :allow_register - - # If enabled, users will generally be allowed to use an external identity provider to log in. Be sure to allow at least one external identity provider if this option is enabled. - attr_accessor :allow_external_idp - - # If enabled, users will be forced to use a multi-factor to log in. This also applies to federated logins through an external identity provider. Users will be required to set up a second factor if they have not done so already. - attr_accessor :force_mfa - - attr_accessor :passkeys_type - - # If enabled, the password reset link will be hidden on the login screen. - attr_accessor :hide_password_reset - - # If enabled, an unknown username on the login screen will not return an error directly, but will always display the password screen. This prevents user enumeration attacks. - attr_accessor :ignore_unknown_usernames - - # Defines where the user will be redirected to if the login is started without app context (e.g. from mail). - attr_accessor :default_redirect_uri - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :password_check_lifetime - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :external_login_check_lifetime - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :mfa_init_skip_lifetime - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :second_factor_check_lifetime - - # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". - attr_accessor :multi_factor_check_lifetime - - # The list of allowed second factors. - attr_accessor :second_factors - - # The list of allowed multi factors. - attr_accessor :multi_factors - - # Allow discovery of the organization and its authentication option by domain. If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the organization domains and will redirect to the registration of that organization on success. The registration can either be locally (requires allow_register to be true) or through an external identity provider. In case only one identity provider is configured for the organization, the user will be redirected directly to the identity provider. - attr_accessor :allow_domain_discovery - - # By default, users can login with their verified email address additionally to their login name. Setting this to true disables the email login. Note: If the email is set as the login name, this setting has no effect. - attr_accessor :disable_login_with_email - - # By default, users can login with their verified phone number additionally to their login name. Setting this to true disables the phone number login. Note: If the phone number is set as the login name, this setting has no effect. - attr_accessor :disable_login_with_phone - - attr_accessor :resource_owner_type - - # If enabled, users will be forced to use a multi-factor to log in if they authenticated locally. This does not apply to federated logins through an external identity provider. Users will be required to set up a second factor if they have not done so already. If both force_mfa and force_mfa_local_only are enabled, force_mfa takes precedence and all logins will require a second factor. - attr_accessor :force_mfa_local_only - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'allow_username_password' => :'allowUsernamePassword', - :'allow_local_authentication' => :'allowLocalAuthentication', - :'allow_register' => :'allowRegister', - :'allow_external_idp' => :'allowExternalIdp', - :'force_mfa' => :'forceMfa', - :'passkeys_type' => :'passkeysType', - :'hide_password_reset' => :'hidePasswordReset', - :'ignore_unknown_usernames' => :'ignoreUnknownUsernames', - :'default_redirect_uri' => :'defaultRedirectUri', - :'password_check_lifetime' => :'passwordCheckLifetime', - :'external_login_check_lifetime' => :'externalLoginCheckLifetime', - :'mfa_init_skip_lifetime' => :'mfaInitSkipLifetime', - :'second_factor_check_lifetime' => :'secondFactorCheckLifetime', - :'multi_factor_check_lifetime' => :'multiFactorCheckLifetime', - :'second_factors' => :'secondFactors', - :'multi_factors' => :'multiFactors', - :'allow_domain_discovery' => :'allowDomainDiscovery', - :'disable_login_with_email' => :'disableLoginWithEmail', - :'disable_login_with_phone' => :'disableLoginWithPhone', - :'resource_owner_type' => :'resourceOwnerType', - :'force_mfa_local_only' => :'forceMfaLocalOnly' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'allow_username_password' => :'Boolean', - :'allow_local_authentication' => :'Boolean', - :'allow_register' => :'Boolean', - :'allow_external_idp' => :'Boolean', - :'force_mfa' => :'Boolean', - :'passkeys_type' => :'SettingsServicePasskeysType', - :'hide_password_reset' => :'Boolean', - :'ignore_unknown_usernames' => :'Boolean', - :'default_redirect_uri' => :'String', - :'password_check_lifetime' => :'String', - :'external_login_check_lifetime' => :'String', - :'mfa_init_skip_lifetime' => :'String', - :'second_factor_check_lifetime' => :'String', - :'multi_factor_check_lifetime' => :'String', - :'second_factors' => :'Array', - :'multi_factors' => :'Array', - :'allow_domain_discovery' => :'Boolean', - :'disable_login_with_email' => :'Boolean', - :'disable_login_with_phone' => :'Boolean', - :'resource_owner_type' => :'SettingsServiceResourceOwnerType', - :'force_mfa_local_only' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceLoginSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceLoginSettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'allow_username_password') - self.allow_username_password = attributes[:'allow_username_password'] - end - - if attributes.key?(:'allow_local_authentication') - self.allow_local_authentication = attributes[:'allow_local_authentication'] - end - - if attributes.key?(:'allow_register') - self.allow_register = attributes[:'allow_register'] - end - - if attributes.key?(:'allow_external_idp') - self.allow_external_idp = attributes[:'allow_external_idp'] - end - - if attributes.key?(:'force_mfa') - self.force_mfa = attributes[:'force_mfa'] - end - - if attributes.key?(:'passkeys_type') - self.passkeys_type = attributes[:'passkeys_type'] - end - - if attributes.key?(:'hide_password_reset') - self.hide_password_reset = attributes[:'hide_password_reset'] - end - - if attributes.key?(:'ignore_unknown_usernames') - self.ignore_unknown_usernames = attributes[:'ignore_unknown_usernames'] - end - - if attributes.key?(:'default_redirect_uri') - self.default_redirect_uri = attributes[:'default_redirect_uri'] - end - - if attributes.key?(:'password_check_lifetime') - self.password_check_lifetime = attributes[:'password_check_lifetime'] - end - - if attributes.key?(:'external_login_check_lifetime') - self.external_login_check_lifetime = attributes[:'external_login_check_lifetime'] - end - - if attributes.key?(:'mfa_init_skip_lifetime') - self.mfa_init_skip_lifetime = attributes[:'mfa_init_skip_lifetime'] - end - - if attributes.key?(:'second_factor_check_lifetime') - self.second_factor_check_lifetime = attributes[:'second_factor_check_lifetime'] - end - - if attributes.key?(:'multi_factor_check_lifetime') - self.multi_factor_check_lifetime = attributes[:'multi_factor_check_lifetime'] - end - - if attributes.key?(:'second_factors') - if (value = attributes[:'second_factors']).is_a?(Array) - self.second_factors = value - end - end - - if attributes.key?(:'multi_factors') - if (value = attributes[:'multi_factors']).is_a?(Array) - self.multi_factors = value - end - end - - if attributes.key?(:'allow_domain_discovery') - self.allow_domain_discovery = attributes[:'allow_domain_discovery'] - end - - if attributes.key?(:'disable_login_with_email') - self.disable_login_with_email = attributes[:'disable_login_with_email'] - end - - if attributes.key?(:'disable_login_with_phone') - self.disable_login_with_phone = attributes[:'disable_login_with_phone'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - - if attributes.key?(:'force_mfa_local_only') - self.force_mfa_local_only = attributes[:'force_mfa_local_only'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - allow_username_password == o.allow_username_password && - allow_local_authentication == o.allow_local_authentication && - allow_register == o.allow_register && - allow_external_idp == o.allow_external_idp && - force_mfa == o.force_mfa && - passkeys_type == o.passkeys_type && - hide_password_reset == o.hide_password_reset && - ignore_unknown_usernames == o.ignore_unknown_usernames && - default_redirect_uri == o.default_redirect_uri && - password_check_lifetime == o.password_check_lifetime && - external_login_check_lifetime == o.external_login_check_lifetime && - mfa_init_skip_lifetime == o.mfa_init_skip_lifetime && - second_factor_check_lifetime == o.second_factor_check_lifetime && - multi_factor_check_lifetime == o.multi_factor_check_lifetime && - second_factors == o.second_factors && - multi_factors == o.multi_factors && - allow_domain_discovery == o.allow_domain_discovery && - disable_login_with_email == o.disable_login_with_email && - disable_login_with_phone == o.disable_login_with_phone && - resource_owner_type == o.resource_owner_type && - force_mfa_local_only == o.force_mfa_local_only - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [allow_username_password, allow_local_authentication, allow_register, allow_external_idp, force_mfa, passkeys_type, hide_password_reset, ignore_unknown_usernames, default_redirect_uri, password_check_lifetime, external_login_check_lifetime, mfa_init_skip_lifetime, second_factor_check_lifetime, multi_factor_check_lifetime, second_factors, multi_factors, allow_domain_discovery, disable_login_with_email, disable_login_with_phone, resource_owner_type, force_mfa_local_only].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceLoginSettings. + class SettingsServiceLoginSettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + allow_username_password: 'allowUsernamePassword', + allow_local_authentication: 'allowLocalAuthentication', + allow_register: 'allowRegister', + allow_external_idp: 'allowExternalIdp', + force_mfa: 'forceMfa', + passkeys_type: 'passkeysType', + hide_password_reset: 'hidePasswordReset', + ignore_unknown_usernames: 'ignoreUnknownUsernames', + default_redirect_uri: 'defaultRedirectUri', + password_check_lifetime: 'passwordCheckLifetime', + external_login_check_lifetime: 'externalLoginCheckLifetime', + mfa_init_skip_lifetime: 'mfaInitSkipLifetime', + second_factor_check_lifetime: 'secondFactorCheckLifetime', + multi_factor_check_lifetime: 'multiFactorCheckLifetime', + second_factors: 'secondFactors', + multi_factors: 'multiFactors', + allow_domain_discovery: 'allowDomainDiscovery', + disable_login_with_email: 'disableLoginWithEmail', + disable_login_with_phone: 'disableLoginWithPhone', + resource_owner_type: 'resourceOwnerType', + force_mfa_local_only: 'forceMfaLocalOnly' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + allow_username_password: 'Boolean', + allow_local_authentication: 'Boolean', + allow_register: 'Boolean', + allow_external_idp: 'Boolean', + force_mfa: 'Boolean', + passkeys_type: 'SettingsServicePasskeysType', + hide_password_reset: 'Boolean', + ignore_unknown_usernames: 'Boolean', + default_redirect_uri: 'String', + password_check_lifetime: 'ISO8601::Duration', + external_login_check_lifetime: 'ISO8601::Duration', + mfa_init_skip_lifetime: 'ISO8601::Duration', + second_factor_check_lifetime: 'ISO8601::Duration', + multi_factor_check_lifetime: 'ISO8601::Duration', + second_factors: 'Array', + multi_factors: 'Array', + allow_domain_discovery: 'Boolean', + disable_login_with_email: 'Boolean', + disable_login_with_phone: 'Boolean', + resource_owner_type: 'SettingsServiceResourceOwnerType', + force_mfa_local_only: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # If enabled, users can log in locally with their username and passkeys or password. Disabling this option will require users to log in with an external identity provider. Be sure to allow at least one external identity provider if this option is disabled. Deprecated: check allow_local_authentication instead. + # @example null + # @deprecated This property is deprecated. + attribute :allow_username_password, Types::Any.optional.meta(omittable: true) + # If enabled, users can log in locally with their username and passkeys or password. Disabling this option will require users to log in with an external identity provider. Be sure to allow at least one external identity provider if this option is disabled. + # @example null + attribute :allow_local_authentication, Types::Any.optional.meta(omittable: true) + # If enabled, users can register a local account by themself. This option does not effect external identity providers. Each identity provider can be configured to allow or disallow registration. + # @example null + attribute :allow_register, Types::Any.optional.meta(omittable: true) + # If enabled, users will generally be allowed to use an external identity provider to log in. Be sure to allow at least one external identity provider if this option is enabled. + # @example null + attribute :allow_external_idp, Types::Any.optional.meta(omittable: true) + # If enabled, users will be forced to use a multi-factor to log in. This also applies to federated logins through an external identity provider. Users will be required to set up a second factor if they have not done so already. + # @example null + attribute :force_mfa, Types::Any.optional.meta(omittable: true) + # @example null + attribute :passkeys_type, Types::Any.optional.meta(omittable: true) + # If enabled, the password reset link will be hidden on the login screen. + # @example null + attribute :hide_password_reset, Types::Any.optional.meta(omittable: true) + # If enabled, an unknown username on the login screen will not return an error directly, but will always display the password screen. This prevents user enumeration attacks. + # @example null + attribute :ignore_unknown_usernames, Types::Any.optional.meta(omittable: true) + # Defines where the user will be redirected to if the login is started without app context (e.g. from mail). + # @example null + attribute :default_redirect_uri, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :password_check_lifetime, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :external_login_check_lifetime, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :mfa_init_skip_lifetime, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :second_factor_check_lifetime, Types::Any.optional.meta(omittable: true) + # A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\". + # @example null + attribute :multi_factor_check_lifetime, Types::Any.optional.meta(omittable: true) + # The list of allowed second factors. + # @example null + attribute :second_factors, Types::Any.optional.meta(omittable: true) + # The list of allowed multi factors. + # @example null + attribute :multi_factors, Types::Any.optional.meta(omittable: true) + # Allow discovery of the organization and its authentication option by domain. If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the organization domains and will redirect to the registration of that organization on success. The registration can either be locally (requires allow_register to be true) or through an external identity provider. In case only one identity provider is configured for the organization, the user will be redirected directly to the identity provider. + # @example null + attribute :allow_domain_discovery, Types::Any.optional.meta(omittable: true) + # By default, users can login with their verified email address additionally to their login name. Setting this to true disables the email login. Note: If the email is set as the login name, this setting has no effect. + # @example null + attribute :disable_login_with_email, Types::Any.optional.meta(omittable: true) + # By default, users can login with their verified phone number additionally to their login name. Setting this to true disables the phone number login. Note: If the phone number is set as the login name, this setting has no effect. + # @example null + attribute :disable_login_with_phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) + # If enabled, users will be forced to use a multi-factor to log in if they authenticated locally. This does not apply to federated logins through an external identity provider. Users will be required to set up a second factor if they have not done so already. If both force_mfa and force_mfa_local_only are enabled, force_mfa takes precedence and all logins will require a second factor. + # @example null + attribute :force_mfa_local_only, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_multi_factor_type.rb b/lib/zitadel/client/models/settings_service_multi_factor_type.rb index 3b5778da..c818a4b9 100644 --- a/lib/zitadel/client/models/settings_service_multi_factor_type.rb +++ b/lib/zitadel/client/models/settings_service_multi_factor_type.rb @@ -1,41 +1,61 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class SettingsServiceMultiFactorType - MULTI_FACTOR_TYPE_UNSPECIFIED = "MULTI_FACTOR_TYPE_UNSPECIFIED".freeze - MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION = "MULTI_FACTOR_TYPE_U2F_WITH_VERIFICATION".freeze - - def self.all_vars - @all_vars ||= [MULTI_FACTOR_TYPE_UNSPECIFIED, MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SettingsServiceMultiFactorType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SettingsServiceMultiFactorType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SettingsServiceMultiFactorType. + class SettingsServiceMultiFactorType + MULTI_FACTOR_TYPE_UNSPECIFIED = 'MULTI_FACTOR_TYPE_UNSPECIFIED' + MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION = 'MULTI_FACTOR_TYPE_U2F_WITH_VERIFICATION' + + # Frozen set of all allowed values, used for validation. + VALUES = [MULTI_FACTOR_TYPE_UNSPECIFIED, MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SettingsServiceMultiFactorType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/settings_service_options.rb b/lib/zitadel/client/models/settings_service_options.rb index ed93a9a1..7e101ed3 100644 --- a/lib/zitadel/client/models/settings_service_options.rb +++ b/lib/zitadel/client/models/settings_service_options.rb @@ -1,277 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceOptions - # Enable if users should be able to link an existing ZITADEL user with an external account. - attr_accessor :is_linking_allowed - - # Enable if users should be able to create a new account in ZITADEL when using an external account. - attr_accessor :is_creation_allowed - - # Enable if a new account in ZITADEL should be created automatically when login with an external account. - attr_accessor :is_auto_creation - - # Enable if a the ZITADEL account fields should be updated automatically on each login. - attr_accessor :is_auto_update - - attr_accessor :auto_linking - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_linking_allowed' => :'isLinkingAllowed', - :'is_creation_allowed' => :'isCreationAllowed', - :'is_auto_creation' => :'isAutoCreation', - :'is_auto_update' => :'isAutoUpdate', - :'auto_linking' => :'autoLinking' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_linking_allowed' => :'Boolean', - :'is_creation_allowed' => :'Boolean', - :'is_auto_creation' => :'Boolean', - :'is_auto_update' => :'Boolean', - :'auto_linking' => :'SettingsServiceAutoLinkingOption' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceOptions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_linking_allowed') - self.is_linking_allowed = attributes[:'is_linking_allowed'] - end - - if attributes.key?(:'is_creation_allowed') - self.is_creation_allowed = attributes[:'is_creation_allowed'] - end - - if attributes.key?(:'is_auto_creation') - self.is_auto_creation = attributes[:'is_auto_creation'] - end - - if attributes.key?(:'is_auto_update') - self.is_auto_update = attributes[:'is_auto_update'] - end - - if attributes.key?(:'auto_linking') - self.auto_linking = attributes[:'auto_linking'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_linking_allowed == o.is_linking_allowed && - is_creation_allowed == o.is_creation_allowed && - is_auto_creation == o.is_auto_creation && - is_auto_update == o.is_auto_update && - auto_linking == o.auto_linking - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_linking_allowed, is_creation_allowed, is_auto_creation, is_auto_update, auto_linking].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceOptions. + class SettingsServiceOptions < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + is_linking_allowed: 'isLinkingAllowed', + is_creation_allowed: 'isCreationAllowed', + is_auto_creation: 'isAutoCreation', + is_auto_update: 'isAutoUpdate', + auto_linking: 'autoLinking' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + is_linking_allowed: 'Boolean', + is_creation_allowed: 'Boolean', + is_auto_creation: 'Boolean', + is_auto_update: 'Boolean', + auto_linking: 'SettingsServiceAutoLinkingOption' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Enable if users should be able to link an existing ZITADEL user with an external account. + # @example null + attribute :is_linking_allowed, Types::Any.optional.meta(omittable: true) + # Enable if users should be able to create a new account in ZITADEL when using an external account. + # @example null + attribute :is_creation_allowed, Types::Any.optional.meta(omittable: true) + # Enable if a new account in ZITADEL should be created automatically when login with an external account. + # @example null + attribute :is_auto_creation, Types::Any.optional.meta(omittable: true) + # Enable if a the ZITADEL account fields should be updated automatically on each login. + # @example null + attribute :is_auto_update, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auto_linking, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_passkeys_type.rb b/lib/zitadel/client/models/settings_service_passkeys_type.rb index d2a1e46a..ad19fdec 100644 --- a/lib/zitadel/client/models/settings_service_passkeys_type.rb +++ b/lib/zitadel/client/models/settings_service_passkeys_type.rb @@ -1,41 +1,61 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class SettingsServicePasskeysType - PASSKEYS_TYPE_NOT_ALLOWED = "PASSKEYS_TYPE_NOT_ALLOWED".freeze - PASSKEYS_TYPE_ALLOWED = "PASSKEYS_TYPE_ALLOWED".freeze - - def self.all_vars - @all_vars ||= [PASSKEYS_TYPE_NOT_ALLOWED, PASSKEYS_TYPE_ALLOWED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SettingsServicePasskeysType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SettingsServicePasskeysType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SettingsServicePasskeysType. + class SettingsServicePasskeysType + PASSKEYS_TYPE_NOT_ALLOWED = 'PASSKEYS_TYPE_NOT_ALLOWED' + PASSKEYS_TYPE_ALLOWED = 'PASSKEYS_TYPE_ALLOWED' + + # Frozen set of all allowed values, used for validation. + VALUES = [PASSKEYS_TYPE_NOT_ALLOWED, PASSKEYS_TYPE_ALLOWED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SettingsServicePasskeysType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/settings_service_password_complexity_settings.rb b/lib/zitadel/client/models/settings_service_password_complexity_settings.rb index 2295725e..18dbd72e 100644 --- a/lib/zitadel/client/models/settings_service_password_complexity_settings.rb +++ b/lib/zitadel/client/models/settings_service_password_complexity_settings.rb @@ -1,288 +1,98 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServicePasswordComplexitySettings - # The minimum length a password must have. - attr_accessor :min_length - - # Defines if the password MUST contain an upper case letter. - attr_accessor :requires_uppercase - - # Defines if the password MUST contain a lowercase letter. - attr_accessor :requires_lowercase - - # Defines if the password MUST contain a number. - attr_accessor :requires_number - - # Defines if the password MUST contain a symbol or special character. E.g. \"$\" - attr_accessor :requires_symbol - - attr_accessor :resource_owner_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'min_length' => :'minLength', - :'requires_uppercase' => :'requiresUppercase', - :'requires_lowercase' => :'requiresLowercase', - :'requires_number' => :'requiresNumber', - :'requires_symbol' => :'requiresSymbol', - :'resource_owner_type' => :'resourceOwnerType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'min_length' => :'Object', - :'requires_uppercase' => :'Boolean', - :'requires_lowercase' => :'Boolean', - :'requires_number' => :'Boolean', - :'requires_symbol' => :'Boolean', - :'resource_owner_type' => :'SettingsServiceResourceOwnerType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'min_length', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServicePasswordComplexitySettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServicePasswordComplexitySettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'min_length') - self.min_length = attributes[:'min_length'] - end - - if attributes.key?(:'requires_uppercase') - self.requires_uppercase = attributes[:'requires_uppercase'] - end - - if attributes.key?(:'requires_lowercase') - self.requires_lowercase = attributes[:'requires_lowercase'] - end - - if attributes.key?(:'requires_number') - self.requires_number = attributes[:'requires_number'] - end - - if attributes.key?(:'requires_symbol') - self.requires_symbol = attributes[:'requires_symbol'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - min_length == o.min_length && - requires_uppercase == o.requires_uppercase && - requires_lowercase == o.requires_lowercase && - requires_number == o.requires_number && - requires_symbol == o.requires_symbol && - resource_owner_type == o.resource_owner_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [min_length, requires_uppercase, requires_lowercase, requires_number, requires_symbol, resource_owner_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServicePasswordComplexitySettings. + class SettingsServicePasswordComplexitySettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + min_length: 'minLength', + requires_uppercase: 'requiresUppercase', + requires_lowercase: 'requiresLowercase', + requires_number: 'requiresNumber', + requires_symbol: 'requiresSymbol', + resource_owner_type: 'resourceOwnerType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + min_length: 'Object', + requires_uppercase: 'Boolean', + requires_lowercase: 'Boolean', + requires_number: 'Boolean', + requires_symbol: 'Boolean', + resource_owner_type: 'SettingsServiceResourceOwnerType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The minimum length a password must have. + # @example null + attribute :min_length, Types::Any.optional.meta(omittable: true) + # Defines if the password MUST contain an upper case letter. + # @example null + attribute :requires_uppercase, Types::Any.optional.meta(omittable: true) + # Defines if the password MUST contain a lowercase letter. + # @example null + attribute :requires_lowercase, Types::Any.optional.meta(omittable: true) + # Defines if the password MUST contain a number. + # @example null + attribute :requires_number, Types::Any.optional.meta(omittable: true) + # Defines if the password MUST contain a symbol or special character. E.g. \"$\" + # @example null + attribute :requires_symbol, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_password_expiry_settings.rb b/lib/zitadel/client/models/settings_service_password_expiry_settings.rb index 4d47caa2..23e747db 100644 --- a/lib/zitadel/client/models/settings_service_password_expiry_settings.rb +++ b/lib/zitadel/client/models/settings_service_password_expiry_settings.rb @@ -1,259 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServicePasswordExpirySettings - # Amount of days after which a password will expire. The user will be forced to change the password on the following authentication. - attr_accessor :max_age_days - - # Amount of days after which the user should be notified of the upcoming expiry. ZITADEL will not notify the user. - attr_accessor :expire_warn_days - - attr_accessor :resource_owner_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'max_age_days' => :'maxAgeDays', - :'expire_warn_days' => :'expireWarnDays', - :'resource_owner_type' => :'resourceOwnerType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'max_age_days' => :'Object', - :'expire_warn_days' => :'Object', - :'resource_owner_type' => :'SettingsServiceResourceOwnerType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'max_age_days', - :'expire_warn_days', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServicePasswordExpirySettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServicePasswordExpirySettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'max_age_days') - self.max_age_days = attributes[:'max_age_days'] - end - - if attributes.key?(:'expire_warn_days') - self.expire_warn_days = attributes[:'expire_warn_days'] - end - - if attributes.key?(:'resource_owner_type') - self.resource_owner_type = attributes[:'resource_owner_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - max_age_days == o.max_age_days && - expire_warn_days == o.expire_warn_days && - resource_owner_type == o.resource_owner_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [max_age_days, expire_warn_days, resource_owner_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServicePasswordExpirySettings. + class SettingsServicePasswordExpirySettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + max_age_days: 'maxAgeDays', + expire_warn_days: 'expireWarnDays', + resource_owner_type: 'resourceOwnerType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + max_age_days: 'Object', + expire_warn_days: 'Object', + resource_owner_type: 'SettingsServiceResourceOwnerType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Amount of days after which a password will expire. The user will be forced to change the password on the following authentication. + # @example null + attribute :max_age_days, Types::Any.optional.meta(omittable: true) + # Amount of days after which the user should be notified of the upcoming expiry. ZITADEL will not notify the user. + # @example null + attribute :expire_warn_days, Types::Any.optional.meta(omittable: true) + # @example null + attribute :resource_owner_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_request_context.rb b/lib/zitadel/client/models/settings_service_request_context.rb index d6c0a93c..391cbd99 100644 --- a/lib/zitadel/client/models/settings_service_request_context.rb +++ b/lib/zitadel/client/models/settings_service_request_context.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceRequestContext - attr_accessor :instance - - attr_accessor :org_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instance' => :'instance', - :'org_id' => :'orgId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instance' => :'Boolean', - :'org_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceRequestContext` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceRequestContext`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instance == o.instance && - org_id == o.org_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instance, org_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceRequestContext. + class SettingsServiceRequestContext < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + instance: 'instance', + org_id: 'orgId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + instance: 'Boolean', + org_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :org_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_resource_owner_type.rb b/lib/zitadel/client/models/settings_service_resource_owner_type.rb index 92c8302b..2c45b168 100644 --- a/lib/zitadel/client/models/settings_service_resource_owner_type.rb +++ b/lib/zitadel/client/models/settings_service_resource_owner_type.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class SettingsServiceResourceOwnerType - RESOURCE_OWNER_TYPE_UNSPECIFIED = "RESOURCE_OWNER_TYPE_UNSPECIFIED".freeze - RESOURCE_OWNER_TYPE_INSTANCE = "RESOURCE_OWNER_TYPE_INSTANCE".freeze - RESOURCE_OWNER_TYPE_ORG = "RESOURCE_OWNER_TYPE_ORG".freeze - - def self.all_vars - @all_vars ||= [RESOURCE_OWNER_TYPE_UNSPECIFIED, RESOURCE_OWNER_TYPE_INSTANCE, RESOURCE_OWNER_TYPE_ORG].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SettingsServiceResourceOwnerType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SettingsServiceResourceOwnerType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SettingsServiceResourceOwnerType. + class SettingsServiceResourceOwnerType + RESOURCE_OWNER_TYPE_UNSPECIFIED = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' + RESOURCE_OWNER_TYPE_INSTANCE = 'RESOURCE_OWNER_TYPE_INSTANCE' + RESOURCE_OWNER_TYPE_ORG = 'RESOURCE_OWNER_TYPE_ORG' + + # Frozen set of all allowed values, used for validation. + VALUES = [RESOURCE_OWNER_TYPE_UNSPECIFIED, RESOURCE_OWNER_TYPE_INSTANCE, RESOURCE_OWNER_TYPE_ORG].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SettingsServiceResourceOwnerType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/settings_service_second_factor_type.rb b/lib/zitadel/client/models/settings_service_second_factor_type.rb index 43eaf53d..1f64898d 100644 --- a/lib/zitadel/client/models/settings_service_second_factor_type.rb +++ b/lib/zitadel/client/models/settings_service_second_factor_type.rb @@ -1,46 +1,66 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class SettingsServiceSecondFactorType - SECOND_FACTOR_TYPE_UNSPECIFIED = "SECOND_FACTOR_TYPE_UNSPECIFIED".freeze - SECOND_FACTOR_TYPE_OTP = "SECOND_FACTOR_TYPE_OTP".freeze - SECOND_FACTOR_TYPE_TOTP = "SECOND_FACTOR_TYPE_TOTP".freeze - SECOND_FACTOR_TYPE_U2_F = "SECOND_FACTOR_TYPE_U2F".freeze - SECOND_FACTOR_TYPE_OTP_EMAIL = "SECOND_FACTOR_TYPE_OTP_EMAIL".freeze - SECOND_FACTOR_TYPE_OTP_SMS = "SECOND_FACTOR_TYPE_OTP_SMS".freeze - SECOND_FACTOR_TYPE_RECOVERY_CODES = "SECOND_FACTOR_TYPE_RECOVERY_CODES".freeze - - def self.all_vars - @all_vars ||= [SECOND_FACTOR_TYPE_UNSPECIFIED, SECOND_FACTOR_TYPE_OTP, SECOND_FACTOR_TYPE_TOTP, SECOND_FACTOR_TYPE_U2_F, SECOND_FACTOR_TYPE_OTP_EMAIL, SECOND_FACTOR_TYPE_OTP_SMS, SECOND_FACTOR_TYPE_RECOVERY_CODES].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SettingsServiceSecondFactorType. + class SettingsServiceSecondFactorType + SECOND_FACTOR_TYPE_UNSPECIFIED = 'SECOND_FACTOR_TYPE_UNSPECIFIED' + SECOND_FACTOR_TYPE_OTP = 'SECOND_FACTOR_TYPE_OTP' + SECOND_FACTOR_TYPE_TOTP = 'SECOND_FACTOR_TYPE_TOTP' + SECOND_FACTOR_TYPE_U2_F = 'SECOND_FACTOR_TYPE_U2F' + SECOND_FACTOR_TYPE_OTP_EMAIL = 'SECOND_FACTOR_TYPE_OTP_EMAIL' + SECOND_FACTOR_TYPE_OTP_SMS = 'SECOND_FACTOR_TYPE_OTP_SMS' + SECOND_FACTOR_TYPE_RECOVERY_CODES = 'SECOND_FACTOR_TYPE_RECOVERY_CODES' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [SECOND_FACTOR_TYPE_UNSPECIFIED, SECOND_FACTOR_TYPE_OTP, SECOND_FACTOR_TYPE_TOTP, SECOND_FACTOR_TYPE_U2_F, SECOND_FACTOR_TYPE_OTP_EMAIL, SECOND_FACTOR_TYPE_OTP_SMS, SECOND_FACTOR_TYPE_RECOVERY_CODES].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SettingsServiceSecondFactorType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SettingsServiceSecondFactorType" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SettingsServiceSecondFactorType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/settings_service_security_settings.rb b/lib/zitadel/client/models/settings_service_security_settings.rb index d85423cb..cfeba161 100644 --- a/lib/zitadel/client/models/settings_service_security_settings.rb +++ b/lib/zitadel/client/models/settings_service_security_settings.rb @@ -1,225 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceSecuritySettings - attr_accessor :embedded_iframe - - # If enabled, users are allowed to impersonate other users. The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well\". - attr_accessor :enable_impersonation - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'embedded_iframe' => :'embeddedIframe', - :'enable_impersonation' => :'enableImpersonation' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'embedded_iframe' => :'SettingsServiceEmbeddedIframeSettings', - :'enable_impersonation' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceSecuritySettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceSecuritySettings`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'embedded_iframe') - self.embedded_iframe = attributes[:'embedded_iframe'] - end - - if attributes.key?(:'enable_impersonation') - self.enable_impersonation = attributes[:'enable_impersonation'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - embedded_iframe == o.embedded_iframe && - enable_impersonation == o.enable_impersonation - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [embedded_iframe, enable_impersonation].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceSecuritySettings. + class SettingsServiceSecuritySettings < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + embedded_iframe: 'embeddedIframe', + enable_impersonation: 'enableImpersonation' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + embedded_iframe: 'SettingsServiceEmbeddedIframeSettings', + enable_impersonation: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :embedded_iframe, Types::Any.optional.meta(omittable: true) + # If enabled, users are allowed to impersonate other users. The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well\". + # @example null + attribute :enable_impersonation, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_set_hosted_login_translation_request.rb b/lib/zitadel/client/models/settings_service_set_hosted_login_translation_request.rb index 74208602..5e4c2307 100644 --- a/lib/zitadel/client/models/settings_service_set_hosted_login_translation_request.rb +++ b/lib/zitadel/client/models/settings_service_set_hosted_login_translation_request.rb @@ -1,246 +1,87 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceSetHostedLoginTranslationRequest - # The locale of the translations to be set. Needs to be a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). - attr_accessor :locale - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :translations - - attr_accessor :instance - - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'locale' => :'locale', - :'translations' => :'translations', - :'instance' => :'instance', - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'locale' => :'String', - :'translations' => :'Hash', - :'instance' => :'Boolean', - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceSetHostedLoginTranslationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceSetHostedLoginTranslationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'locale') - self.locale = attributes[:'locale'] - end - - if attributes.key?(:'translations') - if (value = attributes[:'translations']).is_a?(Hash) - self.translations = value - end - end - - if attributes.key?(:'instance') - self.instance = attributes[:'instance'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - locale == o.locale && - translations == o.translations && - instance == o.instance && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [locale, translations, instance, organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceSetHostedLoginTranslationRequest. + class SettingsServiceSetHostedLoginTranslationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + locale: 'locale', + translations: 'translations', + instance: 'instance', + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + locale: 'String', + translations: 'Hash', + instance: 'Boolean', + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The locale of the translations to be set. Needs to be a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\"). + # @example null + attribute :locale, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :translations, Types::Any.optional.meta(omittable: true) + # @example null + attribute :instance, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_set_hosted_login_translation_response.rb b/lib/zitadel/client/models/settings_service_set_hosted_login_translation_response.rb index 05889df9..a648d9f8 100644 --- a/lib/zitadel/client/models/settings_service_set_hosted_login_translation_response.rb +++ b/lib/zitadel/client/models/settings_service_set_hosted_login_translation_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceSetHostedLoginTranslationResponse - # hash of the saved translation. Valid only when ignore_inheritance = true - attr_accessor :etag - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'etag' => :'etag' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'etag' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceSetHostedLoginTranslationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceSetHostedLoginTranslationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'etag') - self.etag = attributes[:'etag'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - etag == o.etag - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [etag].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceSetHostedLoginTranslationResponse. + class SettingsServiceSetHostedLoginTranslationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + etag: 'etag' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + etag: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # hash of the saved translation. Valid only when ignore_inheritance = true + # @example null + attribute :etag, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_set_security_settings_request.rb b/lib/zitadel/client/models/settings_service_set_security_settings_request.rb index 5ef65a56..80739cff 100644 --- a/lib/zitadel/client/models/settings_service_set_security_settings_request.rb +++ b/lib/zitadel/client/models/settings_service_set_security_settings_request.rb @@ -1,225 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceSetSecuritySettingsRequest - attr_accessor :embedded_iframe - - # If enabled, users are allowed to impersonate other users. The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well\". - attr_accessor :enable_impersonation - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'embedded_iframe' => :'embeddedIframe', - :'enable_impersonation' => :'enableImpersonation' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'embedded_iframe' => :'SettingsServiceEmbeddedIframeSettings', - :'enable_impersonation' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceSetSecuritySettingsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceSetSecuritySettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'embedded_iframe') - self.embedded_iframe = attributes[:'embedded_iframe'] - end - - if attributes.key?(:'enable_impersonation') - self.enable_impersonation = attributes[:'enable_impersonation'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - embedded_iframe == o.embedded_iframe && - enable_impersonation == o.enable_impersonation - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [embedded_iframe, enable_impersonation].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceSetSecuritySettingsRequest. + class SettingsServiceSetSecuritySettingsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + embedded_iframe: 'embeddedIframe', + enable_impersonation: 'enableImpersonation' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + embedded_iframe: 'SettingsServiceEmbeddedIframeSettings', + enable_impersonation: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :embedded_iframe, Types::Any.optional.meta(omittable: true) + # If enabled, users are allowed to impersonate other users. The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well\". + # @example null + attribute :enable_impersonation, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_set_security_settings_response.rb b/lib/zitadel/client/models/settings_service_set_security_settings_response.rb index 3ebbc9a7..3dfbf8d2 100644 --- a/lib/zitadel/client/models/settings_service_set_security_settings_response.rb +++ b/lib/zitadel/client/models/settings_service_set_security_settings_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceSetSecuritySettingsResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'SettingsServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceSetSecuritySettingsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceSetSecuritySettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceSetSecuritySettingsResponse. + class SettingsServiceSetSecuritySettingsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'SettingsServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/settings_service_theme.rb b/lib/zitadel/client/models/settings_service_theme.rb index e3e84afb..fd631214 100644 --- a/lib/zitadel/client/models/settings_service_theme.rb +++ b/lib/zitadel/client/models/settings_service_theme.rb @@ -1,266 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class SettingsServiceTheme - # The hex value for primary color. - attr_accessor :primary_color - - # The hex value for background color. - attr_accessor :background_color - - # The hex value for warning color. - attr_accessor :warn_color - - # The value for font color. - attr_accessor :font_color - - # The URL where the logo is served. - attr_accessor :logo_url - - # The URL where the icon is served. - attr_accessor :icon_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'primary_color' => :'primaryColor', - :'background_color' => :'backgroundColor', - :'warn_color' => :'warnColor', - :'font_color' => :'fontColor', - :'logo_url' => :'logoUrl', - :'icon_url' => :'iconUrl' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'primary_color' => :'String', - :'background_color' => :'String', - :'warn_color' => :'String', - :'font_color' => :'String', - :'logo_url' => :'String', - :'icon_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::SettingsServiceTheme` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::SettingsServiceTheme`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'primary_color') - self.primary_color = attributes[:'primary_color'] - end - - if attributes.key?(:'background_color') - self.background_color = attributes[:'background_color'] - end - - if attributes.key?(:'warn_color') - self.warn_color = attributes[:'warn_color'] - end - - if attributes.key?(:'font_color') - self.font_color = attributes[:'font_color'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'icon_url') - self.icon_url = attributes[:'icon_url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - primary_color == o.primary_color && - background_color == o.background_color && - warn_color == o.warn_color && - font_color == o.font_color && - logo_url == o.logo_url && - icon_url == o.icon_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [primary_color, background_color, warn_color, font_color, logo_url, icon_url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for SettingsServiceTheme. + class SettingsServiceTheme < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + primary_color: 'primaryColor', + background_color: 'backgroundColor', + warn_color: 'warnColor', + font_color: 'fontColor', + logo_url: 'logoUrl', + icon_url: 'iconUrl' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + primary_color: 'String', + background_color: 'String', + warn_color: 'String', + font_color: 'String', + logo_url: 'String', + icon_url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The hex value for primary color. + # @example null + attribute :primary_color, Types::Any.optional.meta(omittable: true) + # The hex value for background color. + # @example null + attribute :background_color, Types::Any.optional.meta(omittable: true) + # The hex value for warning color. + # @example null + attribute :warn_color, Types::Any.optional.meta(omittable: true) + # The value for font color. + # @example null + attribute :font_color, Types::Any.optional.meta(omittable: true) + # The URL where the logo is served. + # @example null + attribute :logo_url, Types::Any.optional.meta(omittable: true) + # The URL where the icon is served. + # @example null + attribute :icon_url, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/settings_service_theme_mode.rb b/lib/zitadel/client/models/settings_service_theme_mode.rb index 807b7833..2f8ba015 100644 --- a/lib/zitadel/client/models/settings_service_theme_mode.rb +++ b/lib/zitadel/client/models/settings_service_theme_mode.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class SettingsServiceThemeMode - THEME_MODE_UNSPECIFIED = "THEME_MODE_UNSPECIFIED".freeze - THEME_MODE_AUTO = "THEME_MODE_AUTO".freeze - THEME_MODE_LIGHT = "THEME_MODE_LIGHT".freeze - THEME_MODE_DARK = "THEME_MODE_DARK".freeze - - def self.all_vars - @all_vars ||= [THEME_MODE_UNSPECIFIED, THEME_MODE_AUTO, THEME_MODE_LIGHT, THEME_MODE_DARK].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if SettingsServiceThemeMode.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::SettingsServiceThemeMode" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for SettingsServiceThemeMode. + class SettingsServiceThemeMode + THEME_MODE_UNSPECIFIED = 'THEME_MODE_UNSPECIFIED' + THEME_MODE_AUTO = 'THEME_MODE_AUTO' + THEME_MODE_LIGHT = 'THEME_MODE_LIGHT' + THEME_MODE_DARK = 'THEME_MODE_DARK' + + # Frozen set of all allowed values, used for validation. + VALUES = [THEME_MODE_UNSPECIFIED, THEME_MODE_AUTO, THEME_MODE_LIGHT, THEME_MODE_DARK].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for SettingsServiceThemeMode: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_access_token_type.rb b/lib/zitadel/client/models/user_service_access_token_type.rb index a454d532..a2cbf290 100644 --- a/lib/zitadel/client/models/user_service_access_token_type.rb +++ b/lib/zitadel/client/models/user_service_access_token_type.rb @@ -1,41 +1,61 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class UserServiceAccessTokenType - ACCESS_TOKEN_TYPE_BEARER = "ACCESS_TOKEN_TYPE_BEARER".freeze - ACCESS_TOKEN_TYPE_JWT = "ACCESS_TOKEN_TYPE_JWT".freeze - - def self.all_vars - @all_vars ||= [ACCESS_TOKEN_TYPE_BEARER, ACCESS_TOKEN_TYPE_JWT].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceAccessTokenType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceAccessTokenType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceAccessTokenType. + class UserServiceAccessTokenType + ACCESS_TOKEN_TYPE_BEARER = 'ACCESS_TOKEN_TYPE_BEARER' + ACCESS_TOKEN_TYPE_JWT = 'ACCESS_TOKEN_TYPE_JWT' + + # Frozen set of all allowed values, used for validation. + VALUES = [ACCESS_TOKEN_TYPE_BEARER, ACCESS_TOKEN_TYPE_JWT].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceAccessTokenType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_add_human_user_request.rb b/lib/zitadel/client/models/user_service_add_human_user_request.rb index 54ec08f5..97ab22ca 100644 --- a/lib/zitadel/client/models/user_service_add_human_user_request.rb +++ b/lib/zitadel/client/models/user_service_add_human_user_request.rb @@ -1,315 +1,116 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAddHumanUserRequest - # optionally set your own id unique for the user. - attr_accessor :user_id - - # optionally set a unique username, if none is provided the email will be used. - attr_accessor :username - - attr_accessor :organization - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - attr_accessor :metadata - - attr_accessor :idp_links - - # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. - attr_accessor :totp_secret - - attr_accessor :hashed_password - - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'username' => :'username', - :'organization' => :'organization', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'metadata' => :'metadata', - :'idp_links' => :'idpLinks', - :'totp_secret' => :'totpSecret', - :'hashed_password' => :'hashedPassword', - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'username' => :'String', - :'organization' => :'UserServiceOrganization', - :'profile' => :'UserServiceSetHumanProfile', - :'email' => :'UserServiceSetHumanEmail', - :'phone' => :'UserServiceSetHumanPhone', - :'metadata' => :'Array', - :'idp_links' => :'Array', - :'totp_secret' => :'String', - :'hashed_password' => :'UserServiceHashedPassword', - :'password' => :'UserServicePassword' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user_id', - :'username', - :'totp_secret', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddHumanUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddHumanUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'organization') - self.organization = attributes[:'organization'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - - if attributes.key?(:'idp_links') - if (value = attributes[:'idp_links']).is_a?(Array) - self.idp_links = value - end - end - - if attributes.key?(:'totp_secret') - self.totp_secret = attributes[:'totp_secret'] - end - - if attributes.key?(:'hashed_password') - self.hashed_password = attributes[:'hashed_password'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - username == o.username && - organization == o.organization && - profile == o.profile && - email == o.email && - phone == o.phone && - metadata == o.metadata && - idp_links == o.idp_links && - totp_secret == o.totp_secret && - hashed_password == o.hashed_password && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, username, organization, profile, email, phone, metadata, idp_links, totp_secret, hashed_password, password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddHumanUserRequest. + class UserServiceAddHumanUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + username: 'username', + organization: 'organization', + profile: 'profile', + email: 'email', + phone: 'phone', + metadata: 'metadata', + idp_links: 'idpLinks', + totp_secret: 'totpSecret', + hashed_password: 'hashedPassword', + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + username: 'String', + organization: 'UserServiceOrganization', + profile: 'UserServiceSetHumanProfile', + email: 'UserServiceSetHumanEmail', + phone: 'UserServiceSetHumanPhone', + metadata: 'Array', + idp_links: 'Array', + totp_secret: 'String', + hashed_password: 'UserServiceHashedPassword', + password: 'UserServicePassword' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # optionally set your own id unique for the user. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # optionally set a unique username, if none is provided the email will be used. + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization, Types::Any.optional.meta(omittable: true) + # @example null + attribute :profile, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_links, Types::Any.optional.meta(omittable: true) + # An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail. + # @example null + attribute :totp_secret, Types::Any.optional.meta(omittable: true) + # @example null + attribute :hashed_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_add_human_user_response.rb b/lib/zitadel/client/models/user_service_add_human_user_response.rb index 2c79ba54..ba55ccc3 100644 --- a/lib/zitadel/client/models/user_service_add_human_user_response.rb +++ b/lib/zitadel/client/models/user_service_add_human_user_response.rb @@ -1,244 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAddHumanUserResponse - attr_accessor :user_id - - attr_accessor :details - - attr_accessor :email_code - - attr_accessor :phone_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'details' => :'details', - :'email_code' => :'emailCode', - :'phone_code' => :'phoneCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'details' => :'UserServiceDetails', - :'email_code' => :'String', - :'phone_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_code', - :'phone_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddHumanUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddHumanUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'email_code') - self.email_code = attributes[:'email_code'] - end - - if attributes.key?(:'phone_code') - self.phone_code = attributes[:'phone_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - details == o.details && - email_code == o.email_code && - phone_code == o.phone_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, details, email_code, phone_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddHumanUserResponse. + class UserServiceAddHumanUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + details: 'details', + email_code: 'emailCode', + phone_code: 'phoneCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + details: 'UserServiceDetails', + email_code: 'String', + phone_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_add_i_d_p_link_request.rb b/lib/zitadel/client/models/user_service_add_i_d_p_link_request.rb deleted file mode 100644 index cff5c425..00000000 --- a/lib/zitadel/client/models/user_service_add_i_d_p_link_request.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceAddIDPLinkRequest - attr_accessor :user_id - - attr_accessor :idp_link - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'idp_link' => :'idpLink' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'idp_link' => :'UserServiceIDPLink' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddIDPLinkRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddIDPLinkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'idp_link') - self.idp_link = attributes[:'idp_link'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - idp_link == o.idp_link - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, idp_link].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_add_i_d_p_link_response.rb b/lib/zitadel/client/models/user_service_add_i_d_p_link_response.rb deleted file mode 100644 index 79921743..00000000 --- a/lib/zitadel/client/models/user_service_add_i_d_p_link_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceAddIDPLinkResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddIDPLinkResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddIDPLinkResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_add_idp_link_request.rb b/lib/zitadel/client/models/user_service_add_idp_link_request.rb new file mode 100644 index 00000000..fc21a4de --- /dev/null +++ b/lib/zitadel/client/models/user_service_add_idp_link_request.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddIDPLinkRequest. + class UserServiceAddIDPLinkRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + idp_link: 'idpLink' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + idp_link: 'UserServiceIDPLink' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_link, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_add_idp_link_response.rb b/lib/zitadel/client/models/user_service_add_idp_link_response.rb new file mode 100644 index 00000000..4c55d522 --- /dev/null +++ b/lib/zitadel/client/models/user_service_add_idp_link_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddIDPLinkResponse. + class UserServiceAddIDPLinkResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_add_key_request.rb b/lib/zitadel/client/models/user_service_add_key_request.rb index 11e2b86c..996c7bde 100644 --- a/lib/zitadel/client/models/user_service_add_key_request.rb +++ b/lib/zitadel/client/models/user_service_add_key_request.rb @@ -1,236 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAddKeyRequest - # The users resource ID. - attr_accessor :user_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Optionally provide a public key of your own generated RSA private key. - attr_accessor :public_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'expiration_date' => :'expirationDate', - :'public_key' => :'publicKey' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'expiration_date' => :'Time', - :'public_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - - if attributes.key?(:'public_key') - self.public_key = attributes[:'public_key'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - expiration_date == o.expiration_date && - public_key == o.public_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, expiration_date, public_key].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddKeyRequest. + class UserServiceAddKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + expiration_date: 'expirationDate', + public_key: 'publicKey' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + expiration_date: 'Time', + public_key: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + public_key: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The users resource ID. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) + # Optionally provide a public key of your own generated RSA private key. + # @example null + attribute :public_key, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_add_key_response.rb b/lib/zitadel/client/models/user_service_add_key_response.rb index a6e32c84..d62d8823 100644 --- a/lib/zitadel/client/models/user_service_add_key_response.rb +++ b/lib/zitadel/client/models/user_service_add_key_response.rb @@ -1,236 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAddKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # The keys ID. - attr_accessor :key_id - - # The key which is usable to authenticate against the API. - attr_accessor :key_content - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'key_id' => :'keyId', - :'key_content' => :'keyContent' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'key_id' => :'String', - :'key_content' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - - if attributes.key?(:'key_content') - self.key_content = attributes[:'key_content'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - key_id == o.key_id && - key_content == o.key_content - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, key_id, key_content].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddKeyResponse. + class UserServiceAddKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + key_id: 'keyId', + key_content: 'keyContent' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + key_id: 'String', + key_content: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + key_content: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # The keys ID. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) + # The key which is usable to authenticate against the API. + # @example null + attribute :key_content, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_add_o_t_p_email_request.rb b/lib/zitadel/client/models/user_service_add_o_t_p_email_request.rb deleted file mode 100644 index 8f61be20..00000000 --- a/lib/zitadel/client/models/user_service_add_o_t_p_email_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceAddOTPEmailRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddOTPEmailRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddOTPEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_add_o_t_p_email_response.rb b/lib/zitadel/client/models/user_service_add_o_t_p_email_response.rb deleted file mode 100644 index a3e8eeed..00000000 --- a/lib/zitadel/client/models/user_service_add_o_t_p_email_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceAddOTPEmailResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddOTPEmailResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddOTPEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_add_o_t_p_s_m_s_request.rb b/lib/zitadel/client/models/user_service_add_o_t_p_s_m_s_request.rb deleted file mode 100644 index fad3832c..00000000 --- a/lib/zitadel/client/models/user_service_add_o_t_p_s_m_s_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceAddOTPSMSRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddOTPSMSRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddOTPSMSRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_add_o_t_p_s_m_s_response.rb b/lib/zitadel/client/models/user_service_add_o_t_p_s_m_s_response.rb deleted file mode 100644 index 49991a8f..00000000 --- a/lib/zitadel/client/models/user_service_add_o_t_p_s_m_s_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceAddOTPSMSResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddOTPSMSResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddOTPSMSResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_add_otp_email_request.rb b/lib/zitadel/client/models/user_service_add_otp_email_request.rb new file mode 100644 index 00000000..5f0b618e --- /dev/null +++ b/lib/zitadel/client/models/user_service_add_otp_email_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddOTPEmailRequest. + class UserServiceAddOTPEmailRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_add_otp_email_response.rb b/lib/zitadel/client/models/user_service_add_otp_email_response.rb new file mode 100644 index 00000000..f2184a56 --- /dev/null +++ b/lib/zitadel/client/models/user_service_add_otp_email_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddOTPEmailResponse. + class UserServiceAddOTPEmailResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_add_otpsms_request.rb b/lib/zitadel/client/models/user_service_add_otpsms_request.rb new file mode 100644 index 00000000..42816eee --- /dev/null +++ b/lib/zitadel/client/models/user_service_add_otpsms_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddOTPSMSRequest. + class UserServiceAddOTPSMSRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_add_otpsms_response.rb b/lib/zitadel/client/models/user_service_add_otpsms_response.rb new file mode 100644 index 00000000..ee33b463 --- /dev/null +++ b/lib/zitadel/client/models/user_service_add_otpsms_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddOTPSMSResponse. + class UserServiceAddOTPSMSResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_add_personal_access_token_request.rb b/lib/zitadel/client/models/user_service_add_personal_access_token_request.rb index 13e1dfbe..5b839abe 100644 --- a/lib/zitadel/client/models/user_service_add_personal_access_token_request.rb +++ b/lib/zitadel/client/models/user_service_add_personal_access_token_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAddPersonalAccessTokenRequest - # The users resource ID. - attr_accessor :user_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddPersonalAccessTokenRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddPersonalAccessTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddPersonalAccessTokenRequest. + class UserServiceAddPersonalAccessTokenRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The users resource ID. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_add_personal_access_token_response.rb b/lib/zitadel/client/models/user_service_add_personal_access_token_response.rb index ed87e1cc..a5e3f48e 100644 --- a/lib/zitadel/client/models/user_service_add_personal_access_token_response.rb +++ b/lib/zitadel/client/models/user_service_add_personal_access_token_response.rb @@ -1,236 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAddPersonalAccessTokenResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # The tokens ID. - attr_accessor :token_id - - # The personal access token that can be used to authenticate against the API - attr_accessor :token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'token_id' => :'tokenId', - :'token' => :'token' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'token_id' => :'String', - :'token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddPersonalAccessTokenResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddPersonalAccessTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'token_id') - self.token_id = attributes[:'token_id'] - end - - if attributes.key?(:'token') - self.token = attributes[:'token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - token_id == o.token_id && - token == o.token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, token_id, token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddPersonalAccessTokenResponse. + class UserServiceAddPersonalAccessTokenResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + token_id: 'tokenId', + token: 'token' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + token_id: 'String', + token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # The tokens ID. + # @example null + attribute :token_id, Types::Any.optional.meta(omittable: true) + # The personal access token that can be used to authenticate against the API + # @example null + attribute :token, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_add_secret_request.rb b/lib/zitadel/client/models/user_service_add_secret_request.rb index b035cdd1..32e95669 100644 --- a/lib/zitadel/client/models/user_service_add_secret_request.rb +++ b/lib/zitadel/client/models/user_service_add_secret_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAddSecretRequest - # The users resource ID. - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddSecretRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddSecretRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddSecretRequest. + class UserServiceAddSecretRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The users resource ID. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_add_secret_response.rb b/lib/zitadel/client/models/user_service_add_secret_response.rb index cfa311fb..e32cac89 100644 --- a/lib/zitadel/client/models/user_service_add_secret_response.rb +++ b/lib/zitadel/client/models/user_service_add_secret_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAddSecretResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # The client secret. Store this secret in a secure place. It is not possible to retrieve it again. - attr_accessor :client_secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'client_secret' => :'clientSecret' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'client_secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAddSecretResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAddSecretResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'client_secret') - self.client_secret = attributes[:'client_secret'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - client_secret == o.client_secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, client_secret].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAddSecretResponse. + class UserServiceAddSecretResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + client_secret: 'clientSecret' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + client_secret: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # The client secret. Store this secret in a secure place. It is not possible to retrieve it again. + # @example null + attribute :client_secret, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_and_query.rb b/lib/zitadel/client/models/user_service_and_query.rb index 140e98e5..45182ae9 100644 --- a/lib/zitadel/client/models/user_service_and_query.rb +++ b/lib/zitadel/client/models/user_service_and_query.rb @@ -1,218 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Connect multiple sub-condition with and AND operator. - class UserServiceAndQuery - attr_accessor :queries - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAndQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAndQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Connect multiple sub-condition with and AND operator. + class UserServiceAndQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_any.rb b/lib/zitadel/client/models/user_service_any.rb index 86821f5c..65b5851b 100644 --- a/lib/zitadel/client/models/user_service_any.rb +++ b/lib/zitadel/client/models/user_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class UserServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class UserServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_auth_factor.rb b/lib/zitadel/client/models/user_service_auth_factor.rb index aad61699..00038a74 100644 --- a/lib/zitadel/client/models/user_service_auth_factor.rb +++ b/lib/zitadel/client/models/user_service_auth_factor.rb @@ -1,273 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAuthFactor - attr_accessor :state - - attr_accessor :otp - - attr_accessor :otp_email - - attr_accessor :otp_sms - - attr_accessor :u2f - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'state', - :'otp' => :'otp', - :'otp_email' => :'otpEmail', - :'otp_sms' => :'otpSms', - :'u2f' => :'u2f' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'UserServiceAuthFactorState', - :'otp' => :'Object', - :'otp_email' => :'Object', - :'otp_sms' => :'Object', - :'u2f' => :'UserServiceAuthFactorU2F' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAuthFactor` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAuthFactor`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'otp') - self.otp = attributes[:'otp'] - end - - if attributes.key?(:'otp_email') - self.otp_email = attributes[:'otp_email'] - end - - if attributes.key?(:'otp_sms') - self.otp_sms = attributes[:'otp_sms'] - end - - if attributes.key?(:'u2f') - self.u2f = attributes[:'u2f'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state && - otp == o.otp && - otp_email == o.otp_email && - otp_sms == o.otp_sms && - u2f == o.u2f - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state, otp, otp_email, otp_sms, u2f].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAuthFactor. + class UserServiceAuthFactor < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + state: 'state', + otp: 'otp', + otp_email: 'otpEmail', + otp_sms: 'otpSms', + u2f: 'u2f' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + state: 'UserServiceAuthFactorState', + otp: 'Object', + otp_email: 'Object', + otp_sms: 'Object', + u2f: 'UserServiceAuthFactorU2F' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :otp_sms, Types::Any.optional.meta(omittable: true) + # @example null + attribute :u2f, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_auth_factor_state.rb b/lib/zitadel/client/models/user_service_auth_factor_state.rb index c8b06ca0..61a20fc5 100644 --- a/lib/zitadel/client/models/user_service_auth_factor_state.rb +++ b/lib/zitadel/client/models/user_service_auth_factor_state.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class UserServiceAuthFactorState - AUTH_FACTOR_STATE_UNSPECIFIED = "AUTH_FACTOR_STATE_UNSPECIFIED".freeze - AUTH_FACTOR_STATE_NOT_READY = "AUTH_FACTOR_STATE_NOT_READY".freeze - AUTH_FACTOR_STATE_READY = "AUTH_FACTOR_STATE_READY".freeze - AUTH_FACTOR_STATE_REMOVED = "AUTH_FACTOR_STATE_REMOVED".freeze - - def self.all_vars - @all_vars ||= [AUTH_FACTOR_STATE_UNSPECIFIED, AUTH_FACTOR_STATE_NOT_READY, AUTH_FACTOR_STATE_READY, AUTH_FACTOR_STATE_REMOVED].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceAuthFactorState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceAuthFactorState" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceAuthFactorState. + class UserServiceAuthFactorState + AUTH_FACTOR_STATE_UNSPECIFIED = 'AUTH_FACTOR_STATE_UNSPECIFIED' + AUTH_FACTOR_STATE_NOT_READY = 'AUTH_FACTOR_STATE_NOT_READY' + AUTH_FACTOR_STATE_READY = 'AUTH_FACTOR_STATE_READY' + AUTH_FACTOR_STATE_REMOVED = 'AUTH_FACTOR_STATE_REMOVED' + + # Frozen set of all allowed values, used for validation. + VALUES = [AUTH_FACTOR_STATE_UNSPECIFIED, AUTH_FACTOR_STATE_NOT_READY, AUTH_FACTOR_STATE_READY, AUTH_FACTOR_STATE_REMOVED].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceAuthFactorState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_auth_factor_u2_f.rb b/lib/zitadel/client/models/user_service_auth_factor_u2_f.rb index 14139772..90235dc5 100644 --- a/lib/zitadel/client/models/user_service_auth_factor_u2_f.rb +++ b/lib/zitadel/client/models/user_service_auth_factor_u2_f.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceAuthFactorU2F - attr_accessor :id - - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceAuthFactorU2F` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceAuthFactorU2F`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceAuthFactorU2F. + class UserServiceAuthFactorU2F < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + name: 'name' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_auth_factors.rb b/lib/zitadel/client/models/user_service_auth_factors.rb index dab3b0b7..3cba2ac8 100644 --- a/lib/zitadel/client/models/user_service_auth_factors.rb +++ b/lib/zitadel/client/models/user_service_auth_factors.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class UserServiceAuthFactors - OTP = "OTP".freeze - OTP_SMS = "OTP_SMS".freeze - OTP_EMAIL = "OTP_EMAIL".freeze - U2_F = "U2F".freeze - - def self.all_vars - @all_vars ||= [OTP, OTP_SMS, OTP_EMAIL, U2_F].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceAuthFactors.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceAuthFactors" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceAuthFactors. + class UserServiceAuthFactors + OTP = 'OTP' + OTP_SMS = 'OTP_SMS' + OTP_EMAIL = 'OTP_EMAIL' + U2_F = 'U2F' + + # Frozen set of all allowed values, used for validation. + VALUES = [OTP, OTP_SMS, OTP_EMAIL, U2_F].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceAuthFactors: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_authentication_method_type.rb b/lib/zitadel/client/models/user_service_authentication_method_type.rb index a18cc7e1..dd0da8ab 100644 --- a/lib/zitadel/client/models/user_service_authentication_method_type.rb +++ b/lib/zitadel/client/models/user_service_authentication_method_type.rb @@ -1,48 +1,68 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class UserServiceAuthenticationMethodType - AUTHENTICATION_METHOD_TYPE_UNSPECIFIED = "AUTHENTICATION_METHOD_TYPE_UNSPECIFIED".freeze - AUTHENTICATION_METHOD_TYPE_PASSWORD = "AUTHENTICATION_METHOD_TYPE_PASSWORD".freeze - AUTHENTICATION_METHOD_TYPE_PASSKEY = "AUTHENTICATION_METHOD_TYPE_PASSKEY".freeze - AUTHENTICATION_METHOD_TYPE_IDP = "AUTHENTICATION_METHOD_TYPE_IDP".freeze - AUTHENTICATION_METHOD_TYPE_TOTP = "AUTHENTICATION_METHOD_TYPE_TOTP".freeze - AUTHENTICATION_METHOD_TYPE_U2_F = "AUTHENTICATION_METHOD_TYPE_U2F".freeze - AUTHENTICATION_METHOD_TYPE_OTP_SMS = "AUTHENTICATION_METHOD_TYPE_OTP_SMS".freeze - AUTHENTICATION_METHOD_TYPE_OTP_EMAIL = "AUTHENTICATION_METHOD_TYPE_OTP_EMAIL".freeze - AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE = "AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE".freeze - - def self.all_vars - @all_vars ||= [AUTHENTICATION_METHOD_TYPE_UNSPECIFIED, AUTHENTICATION_METHOD_TYPE_PASSWORD, AUTHENTICATION_METHOD_TYPE_PASSKEY, AUTHENTICATION_METHOD_TYPE_IDP, AUTHENTICATION_METHOD_TYPE_TOTP, AUTHENTICATION_METHOD_TYPE_U2_F, AUTHENTICATION_METHOD_TYPE_OTP_SMS, AUTHENTICATION_METHOD_TYPE_OTP_EMAIL, AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceAuthenticationMethodType. + class UserServiceAuthenticationMethodType + AUTHENTICATION_METHOD_TYPE_UNSPECIFIED = 'AUTHENTICATION_METHOD_TYPE_UNSPECIFIED' + AUTHENTICATION_METHOD_TYPE_PASSWORD = 'AUTHENTICATION_METHOD_TYPE_PASSWORD' + AUTHENTICATION_METHOD_TYPE_PASSKEY = 'AUTHENTICATION_METHOD_TYPE_PASSKEY' + AUTHENTICATION_METHOD_TYPE_IDP = 'AUTHENTICATION_METHOD_TYPE_IDP' + AUTHENTICATION_METHOD_TYPE_TOTP = 'AUTHENTICATION_METHOD_TYPE_TOTP' + AUTHENTICATION_METHOD_TYPE_U2_F = 'AUTHENTICATION_METHOD_TYPE_U2F' + AUTHENTICATION_METHOD_TYPE_OTP_SMS = 'AUTHENTICATION_METHOD_TYPE_OTP_SMS' + AUTHENTICATION_METHOD_TYPE_OTP_EMAIL = 'AUTHENTICATION_METHOD_TYPE_OTP_EMAIL' + AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE = 'AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [AUTHENTICATION_METHOD_TYPE_UNSPECIFIED, AUTHENTICATION_METHOD_TYPE_PASSWORD, AUTHENTICATION_METHOD_TYPE_PASSKEY, AUTHENTICATION_METHOD_TYPE_IDP, AUTHENTICATION_METHOD_TYPE_TOTP, AUTHENTICATION_METHOD_TYPE_U2_F, AUTHENTICATION_METHOD_TYPE_OTP_SMS, AUTHENTICATION_METHOD_TYPE_OTP_EMAIL, AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceAuthenticationMethodType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceAuthenticationMethodType" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceAuthenticationMethodType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_byte_filter_method.rb b/lib/zitadel/client/models/user_service_byte_filter_method.rb index 60179620..d3df1938 100644 --- a/lib/zitadel/client/models/user_service_byte_filter_method.rb +++ b/lib/zitadel/client/models/user_service_byte_filter_method.rb @@ -1,41 +1,61 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class UserServiceByteFilterMethod - BYTE_FILTER_METHOD_EQUALS = "BYTE_FILTER_METHOD_EQUALS".freeze - BYTE_FILTER_METHOD_NOT_EQUALS = "BYTE_FILTER_METHOD_NOT_EQUALS".freeze - - def self.all_vars - @all_vars ||= [BYTE_FILTER_METHOD_EQUALS, BYTE_FILTER_METHOD_NOT_EQUALS].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceByteFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceByteFilterMethod" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceByteFilterMethod. + class UserServiceByteFilterMethod + BYTE_FILTER_METHOD_EQUALS = 'BYTE_FILTER_METHOD_EQUALS' + BYTE_FILTER_METHOD_NOT_EQUALS = 'BYTE_FILTER_METHOD_NOT_EQUALS' + + # Frozen set of all allowed values, used for validation. + VALUES = [BYTE_FILTER_METHOD_EQUALS, BYTE_FILTER_METHOD_NOT_EQUALS].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceByteFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_connect_error.rb b/lib/zitadel/client/models/user_service_connect_error.rb index 58e7f387..6f27dbb6 100644 --- a/lib/zitadel/client/models/user_service_connect_error.rb +++ b/lib/zitadel/client/models/user_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class UserServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class UserServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_create_invite_code_request.rb b/lib/zitadel/client/models/user_service_create_invite_code_request.rb index 79831407..11d9d958 100644 --- a/lib/zitadel/client/models/user_service_create_invite_code_request.rb +++ b/lib/zitadel/client/models/user_service_create_invite_code_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceCreateInviteCodeRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_code' => :'UserServiceSendInviteCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceCreateInviteCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceCreateInviteCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceCreateInviteCodeRequest. + class UserServiceCreateInviteCodeRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_code: 'UserServiceSendInviteCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_create_invite_code_response.rb b/lib/zitadel/client/models/user_service_create_invite_code_response.rb index bb68f2de..7455f949 100644 --- a/lib/zitadel/client/models/user_service_create_invite_code_response.rb +++ b/lib/zitadel/client/models/user_service_create_invite_code_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceCreateInviteCodeResponse - attr_accessor :details - - # The invite code is returned if the verification was set to return_code. - attr_accessor :invite_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'invite_code' => :'inviteCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'invite_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'invite_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceCreateInviteCodeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceCreateInviteCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'invite_code') - self.invite_code = attributes[:'invite_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - invite_code == o.invite_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, invite_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceCreateInviteCodeResponse. + class UserServiceCreateInviteCodeResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + invite_code: 'inviteCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + invite_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # The invite code is returned if the verification was set to return_code. + # @example null + attribute :invite_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_create_passkey_registration_link_request.rb b/lib/zitadel/client/models/user_service_create_passkey_registration_link_request.rb index 1c0f51d7..b4002b29 100644 --- a/lib/zitadel/client/models/user_service_create_passkey_registration_link_request.rb +++ b/lib/zitadel/client/models/user_service_create_passkey_registration_link_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceCreatePasskeyRegistrationLinkRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_link - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_link' => :'sendLink' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_link' => :'UserServiceSendPasskeyRegistrationLink' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceCreatePasskeyRegistrationLinkRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceCreatePasskeyRegistrationLinkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_link') - self.send_link = attributes[:'send_link'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_link == o.send_link - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_link].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceCreatePasskeyRegistrationLinkRequest. + class UserServiceCreatePasskeyRegistrationLinkRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_link: 'sendLink' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_link: 'UserServiceSendPasskeyRegistrationLink' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_link, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_create_passkey_registration_link_response.rb b/lib/zitadel/client/models/user_service_create_passkey_registration_link_response.rb index 730034d6..a127737c 100644 --- a/lib/zitadel/client/models/user_service_create_passkey_registration_link_response.rb +++ b/lib/zitadel/client/models/user_service_create_passkey_registration_link_response.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceCreatePasskeyRegistrationLinkResponse - attr_accessor :details - - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'code' => :'UserServicePasskeyRegistrationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceCreatePasskeyRegistrationLinkResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceCreatePasskeyRegistrationLinkResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceCreatePasskeyRegistrationLinkResponse. + class UserServiceCreatePasskeyRegistrationLinkResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + code: 'UserServicePasskeyRegistrationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_create_user_request.rb b/lib/zitadel/client/models/user_service_create_user_request.rb index 291e8537..e1636871 100644 --- a/lib/zitadel/client/models/user_service_create_user_request.rb +++ b/lib/zitadel/client/models/user_service_create_user_request.rb @@ -1,256 +1,92 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceCreateUserRequest - # The unique identifier of the organization the user belongs to. - attr_accessor :organization_id - - # The ID is a unique identifier for the user in the instance. If not specified, it will be generated. You can set your own user id that is unique within the instance. This is useful in migration scenarios, for example if the user already has an ID in another Zitadel system. If not specified, it will be generated. It can't be changed after creation. - attr_accessor :user_id - - # The username is a unique identifier for the user in the organization. If not specified, Zitadel sets the username to the email for users of type human and to the user_id for users of type machine. It is used to identify the user in the organization and can be used for login. - attr_accessor :username - - attr_accessor :human - - attr_accessor :machine - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId', - :'user_id' => :'userId', - :'username' => :'username', - :'human' => :'human', - :'machine' => :'machine' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String', - :'user_id' => :'String', - :'username' => :'String', - :'human' => :'UserServiceHuman', - :'machine' => :'UserServiceMachine' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user_id', - :'username', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceCreateUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceCreateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'human') - self.human = attributes[:'human'] - end - - if attributes.key?(:'machine') - self.machine = attributes[:'machine'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id && - user_id == o.user_id && - username == o.username && - human == o.human && - machine == o.machine - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id, user_id, username, human, machine].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceCreateUserRequest. + class UserServiceCreateUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId', + user_id: 'userId', + username: 'username', + human: 'human', + machine: 'machine' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String', + user_id: 'String', + username: 'String', + human: 'UserServiceHuman', + machine: 'UserServiceMachine' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the organization the user belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # The ID is a unique identifier for the user in the instance. If not specified, it will be generated. You can set your own user id that is unique within the instance. This is useful in migration scenarios, for example if the user already has an ID in another Zitadel system. If not specified, it will be generated. It can't be changed after creation. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # The username is a unique identifier for the user in the organization. If not specified, Zitadel sets the username to the email for users of type human and to the user_id for users of type machine. It is used to identify the user in the organization and can be used for login. + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :human, Types::Any.optional.meta(omittable: true) + # @example null + attribute :machine, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_create_user_response.rb b/lib/zitadel/client/models/user_service_create_user_response.rb index 29c96c49..a9c8a89a 100644 --- a/lib/zitadel/client/models/user_service_create_user_response.rb +++ b/lib/zitadel/client/models/user_service_create_user_response.rb @@ -1,248 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceCreateUserResponse - # The unique identifier of the newly created user. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # The email verification code if it was requested by setting the email verification to return_code. - attr_accessor :email_code - - # The phone verification code if it was requested by setting the phone verification to return_code. - attr_accessor :phone_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'email_code' => :'emailCode', - :'phone_code' => :'phoneCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'email_code' => :'String', - :'phone_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_code', - :'phone_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceCreateUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceCreateUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'email_code') - self.email_code = attributes[:'email_code'] - end - - if attributes.key?(:'phone_code') - self.phone_code = attributes[:'phone_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - email_code == o.email_code && - phone_code == o.phone_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, email_code, phone_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceCreateUserResponse. + class UserServiceCreateUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + email_code: 'emailCode', + phone_code: 'phoneCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + email_code: 'String', + phone_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the newly created user. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # The email verification code if it was requested by setting the email verification to return_code. + # @example null + attribute :email_code, Types::Any.optional.meta(omittable: true) + # The phone verification code if it was requested by setting the phone verification to return_code. + # @example null + attribute :phone_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_deactivate_user_request.rb b/lib/zitadel/client/models/user_service_deactivate_user_request.rb index ae74d7b3..f73c233a 100644 --- a/lib/zitadel/client/models/user_service_deactivate_user_request.rb +++ b/lib/zitadel/client/models/user_service_deactivate_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceDeactivateUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDeactivateUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDeactivateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceDeactivateUserRequest. + class UserServiceDeactivateUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_deactivate_user_response.rb b/lib/zitadel/client/models/user_service_deactivate_user_response.rb index db8617fe..f19ed76c 100644 --- a/lib/zitadel/client/models/user_service_deactivate_user_response.rb +++ b/lib/zitadel/client/models/user_service_deactivate_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceDeactivateUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDeactivateUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDeactivateUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceDeactivateUserResponse. + class UserServiceDeactivateUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_delete_user_metadata_request.rb b/lib/zitadel/client/models/user_service_delete_user_metadata_request.rb index 20303faa..50f93df2 100644 --- a/lib/zitadel/client/models/user_service_delete_user_metadata_request.rb +++ b/lib/zitadel/client/models/user_service_delete_user_metadata_request.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceDeleteUserMetadataRequest - # ID of the user which metadata is to be deleted is stored on. - attr_accessor :user_id - - # The keys for the user metadata to be deleted. - attr_accessor :keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'keys' => :'keys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDeleteUserMetadataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDeleteUserMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'keys') - if (value = attributes[:'keys']).is_a?(Array) - self.keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - keys == o.keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceDeleteUserMetadataRequest. + class UserServiceDeleteUserMetadataRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + keys: 'keys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the user which metadata is to be deleted is stored on. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # The keys for the user metadata to be deleted. + # @example null + attribute :keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_delete_user_metadata_response.rb b/lib/zitadel/client/models/user_service_delete_user_metadata_response.rb index e83db6b4..85cc116f 100644 --- a/lib/zitadel/client/models/user_service_delete_user_metadata_response.rb +++ b/lib/zitadel/client/models/user_service_delete_user_metadata_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceDeleteUserMetadataResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDeleteUserMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDeleteUserMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceDeleteUserMetadataResponse. + class UserServiceDeleteUserMetadataResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_delete_user_request.rb b/lib/zitadel/client/models/user_service_delete_user_request.rb index 397b1543..0f291a83 100644 --- a/lib/zitadel/client/models/user_service_delete_user_request.rb +++ b/lib/zitadel/client/models/user_service_delete_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceDeleteUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDeleteUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDeleteUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceDeleteUserRequest. + class UserServiceDeleteUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_delete_user_response.rb b/lib/zitadel/client/models/user_service_delete_user_response.rb index 18457e4c..0a4eb8d5 100644 --- a/lib/zitadel/client/models/user_service_delete_user_response.rb +++ b/lib/zitadel/client/models/user_service_delete_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceDeleteUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDeleteUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDeleteUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceDeleteUserResponse. + class UserServiceDeleteUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_details.rb b/lib/zitadel/client/models/user_service_details.rb index 5747e6a5..8812231e 100644 --- a/lib/zitadel/client/models/user_service_details.rb +++ b/lib/zitadel/client/models/user_service_details.rb @@ -1,247 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceDetails - # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation - attr_accessor :sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # resource_owner is the organization or instance_id an object belongs to - attr_accessor :resource_owner - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sequence' => :'sequence', - :'change_date' => :'changeDate', - :'resource_owner' => :'resourceOwner', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sequence' => :'Object', - :'change_date' => :'Time', - :'resource_owner' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sequence') - self.sequence = attributes[:'sequence'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'resource_owner') - self.resource_owner = attributes[:'resource_owner'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sequence == o.sequence && - change_date == o.change_date && - resource_owner == o.resource_owner && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sequence, change_date, resource_owner, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceDetails. + class UserServiceDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + sequence: 'sequence', + change_date: 'changeDate', + resource_owner: 'resourceOwner', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + sequence: 'Object', + change_date: 'Time', + resource_owner: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation + # @example null + attribute :sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # resource_owner is the organization or instance_id an object belongs to + # @example null + attribute :resource_owner, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_display_name_query.rb b/lib/zitadel/client/models/user_service_display_name_query.rb index 4ff38f5a..c7ec8ad6 100644 --- a/lib/zitadel/client/models/user_service_display_name_query.rb +++ b/lib/zitadel/client/models/user_service_display_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific display name. - class UserServiceDisplayNameQuery - attr_accessor :display_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'display_name' => :'displayName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'display_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDisplayNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDisplayNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - display_name == o.display_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [display_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific display name. + class UserServiceDisplayNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + display_name: 'displayName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + display_name: 'String', + method: 'UserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_domain_query.rb b/lib/zitadel/client/models/user_service_domain_query.rb index 6f5dff70..a1c2a9e6 100644 --- a/lib/zitadel/client/models/user_service_domain_query.rb +++ b/lib/zitadel/client/models/user_service_domain_query.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceDomainQuery - # List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI. - attr_accessor :include_without_domain - - # List only auth methods with specific domain. - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'include_without_domain' => :'includeWithoutDomain', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'include_without_domain' => :'Boolean', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceDomainQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceDomainQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'include_without_domain') - self.include_without_domain = attributes[:'include_without_domain'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - include_without_domain == o.include_without_domain && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [include_without_domain, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceDomainQuery. + class UserServiceDomainQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + include_without_domain: 'includeWithoutDomain', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + include_without_domain: 'Boolean', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI. + # @example null + attribute :include_without_domain, Types::Any.optional.meta(omittable: true) + # List only auth methods with specific domain. + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_email_query.rb b/lib/zitadel/client/models/user_service_email_query.rb index 38ba2893..68fe9207 100644 --- a/lib/zitadel/client/models/user_service_email_query.rb +++ b/lib/zitadel/client/models/user_service_email_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific email. - class UserServiceEmailQuery - attr_accessor :email_address - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email_address' => :'emailAddress', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email_address' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceEmailQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceEmailQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email_address == o.email_address && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email_address, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific email. + class UserServiceEmailQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + email_address: 'emailAddress', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + email_address: 'String', + method: 'UserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :email_address, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_first_name_query.rb b/lib/zitadel/client/models/user_service_first_name_query.rb index 2a3be993..33bea406 100644 --- a/lib/zitadel/client/models/user_service_first_name_query.rb +++ b/lib/zitadel/client/models/user_service_first_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific first name. - class UserServiceFirstNameQuery - attr_accessor :first_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'first_name' => :'firstName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'first_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceFirstNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceFirstNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - first_name == o.first_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [first_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific first name. + class UserServiceFirstNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + first_name: 'firstName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + first_name: 'String', + method: 'UserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :first_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_form_data.rb b/lib/zitadel/client/models/user_service_form_data.rb index 5a7c934e..df4fd803 100644 --- a/lib/zitadel/client/models/user_service_form_data.rb +++ b/lib/zitadel/client/models/user_service_form_data.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceFormData - # The URL to which the form should be submitted using the POST method. - attr_accessor :url - - # The form fields to be submitted. Each field is represented as a key-value pair, where the key is the field / input name and the value is the field / input value. All fields need to be submitted as is and as input type \"text\". - attr_accessor :fields - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url' => :'url', - :'fields' => :'fields' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url' => :'String', - :'fields' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceFormData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceFormData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'fields') - if (value = attributes[:'fields']).is_a?(Hash) - self.fields = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url == o.url && - fields == o.fields - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url, fields].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceFormData. + class UserServiceFormData < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url: 'url', + fields: 'fields' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url: 'String', + fields: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The URL to which the form should be submitted using the POST method. + # @example null + attribute :url, Types::Any.optional.meta(omittable: true) + # The form fields to be submitted. Each field is represented as a key-value pair, where the key is the field / input name and the value is the field / input value. All fields need to be submitted as is and as input type \"text\". + # @example null + attribute :fields, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_gender.rb b/lib/zitadel/client/models/user_service_gender.rb index f52517fc..1d8db9b8 100644 --- a/lib/zitadel/client/models/user_service_gender.rb +++ b/lib/zitadel/client/models/user_service_gender.rb @@ -1,43 +1,63 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class UserServiceGender - GENDER_UNSPECIFIED = "GENDER_UNSPECIFIED".freeze - GENDER_FEMALE = "GENDER_FEMALE".freeze - GENDER_MALE = "GENDER_MALE".freeze - GENDER_DIVERSE = "GENDER_DIVERSE".freeze - - def self.all_vars - @all_vars ||= [GENDER_UNSPECIFIED, GENDER_FEMALE, GENDER_MALE, GENDER_DIVERSE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceGender.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceGender" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceGender. + class UserServiceGender + GENDER_UNSPECIFIED = 'GENDER_UNSPECIFIED' + GENDER_FEMALE = 'GENDER_FEMALE' + GENDER_MALE = 'GENDER_MALE' + GENDER_DIVERSE = 'GENDER_DIVERSE' + + # Frozen set of all allowed values, used for validation. + VALUES = [GENDER_UNSPECIFIED, GENDER_FEMALE, GENDER_MALE, GENDER_DIVERSE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceGender: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_generate_recovery_codes_request.rb b/lib/zitadel/client/models/user_service_generate_recovery_codes_request.rb index c4dcf52b..5edcc644 100644 --- a/lib/zitadel/client/models/user_service_generate_recovery_codes_request.rb +++ b/lib/zitadel/client/models/user_service_generate_recovery_codes_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceGenerateRecoveryCodesRequest - attr_accessor :user_id - - attr_accessor :count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'count' => :'count' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'count' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceGenerateRecoveryCodesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceGenerateRecoveryCodesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - count == o.count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, count].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceGenerateRecoveryCodesRequest. + class UserServiceGenerateRecoveryCodesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + count: 'count' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + count: 'Integer' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :count, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_generate_recovery_codes_response.rb b/lib/zitadel/client/models/user_service_generate_recovery_codes_response.rb index eb734ae5..d5181d39 100644 --- a/lib/zitadel/client/models/user_service_generate_recovery_codes_response.rb +++ b/lib/zitadel/client/models/user_service_generate_recovery_codes_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceGenerateRecoveryCodesResponse - attr_accessor :details - - attr_accessor :recovery_codes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'recovery_codes' => :'recoveryCodes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'recovery_codes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceGenerateRecoveryCodesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceGenerateRecoveryCodesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'recovery_codes') - if (value = attributes[:'recovery_codes']).is_a?(Array) - self.recovery_codes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - recovery_codes == o.recovery_codes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, recovery_codes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceGenerateRecoveryCodesResponse. + class UserServiceGenerateRecoveryCodesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + recovery_codes: 'recoveryCodes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + recovery_codes: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :recovery_codes, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_get_user_by_i_d_request.rb b/lib/zitadel/client/models/user_service_get_user_by_i_d_request.rb deleted file mode 100644 index 48e71bce..00000000 --- a/lib/zitadel/client/models/user_service_get_user_by_i_d_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceGetUserByIDRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceGetUserByIDRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceGetUserByIDRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_get_user_by_i_d_response.rb b/lib/zitadel/client/models/user_service_get_user_by_i_d_response.rb deleted file mode 100644 index 19b48786..00000000 --- a/lib/zitadel/client/models/user_service_get_user_by_i_d_response.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceGetUserByIDResponse - attr_accessor :details - - attr_accessor :user - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'user' => :'user' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'user' => :'UserServiceUser' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceGetUserByIDResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceGetUserByIDResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - user == o.user - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, user].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_get_user_by_id_request.rb b/lib/zitadel/client/models/user_service_get_user_by_id_request.rb new file mode 100644 index 00000000..2fc67360 --- /dev/null +++ b/lib/zitadel/client/models/user_service_get_user_by_id_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceGetUserByIDRequest. + class UserServiceGetUserByIDRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_get_user_by_id_response.rb b/lib/zitadel/client/models/user_service_get_user_by_id_response.rb new file mode 100644 index 00000000..4a1ec9ea --- /dev/null +++ b/lib/zitadel/client/models/user_service_get_user_by_id_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceGetUserByIDResponse. + class UserServiceGetUserByIDResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + user: 'user' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + user: 'UserServiceUser' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_hashed_password.rb b/lib/zitadel/client/models/user_service_hashed_password.rb index 536f73a2..d49ca6d7 100644 --- a/lib/zitadel/client/models/user_service_hashed_password.rb +++ b/lib/zitadel/client/models/user_service_hashed_password.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceHashedPassword - attr_accessor :hash - - attr_accessor :change_required - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'hash' => :'hash', - :'change_required' => :'changeRequired' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'hash' => :'String', - :'change_required' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceHashedPassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceHashedPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'hash') - self.hash = attributes[:'hash'] - end - - if attributes.key?(:'change_required') - self.change_required = attributes[:'change_required'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - hash == o.hash && - change_required == o.change_required - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [hash, change_required].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceHashedPassword. + class UserServiceHashedPassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + hash: 'hash', + change_required: 'changeRequired' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + hash: 'String', + change_required: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :hash, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_required, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_human.rb b/lib/zitadel/client/models/user_service_human.rb index 429e6a73..224ca38a 100644 --- a/lib/zitadel/client/models/user_service_human.rb +++ b/lib/zitadel/client/models/user_service_human.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceHuman - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'profile' => :'UserServiceProfile', - :'email' => :'UserServiceSetHumanEmail', - :'phone' => :'UserServiceSetHumanPhone', - :'password' => :'UserServiceSetPassword' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceHuman` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceHuman`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - profile == o.profile && - email == o.email && - phone == o.phone && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [profile, email, phone, password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceHuman. + class UserServiceHuman < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + profile: 'profile', + email: 'email', + phone: 'phone', + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + profile: 'UserServiceProfile', + email: 'UserServiceSetHumanEmail', + phone: 'UserServiceSetHumanPhone', + password: 'UserServiceSetPassword' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :profile, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_human_email.rb b/lib/zitadel/client/models/user_service_human_email.rb index 95b12fb4..ca653ebd 100644 --- a/lib/zitadel/client/models/user_service_human_email.rb +++ b/lib/zitadel/client/models/user_service_human_email.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceHumanEmail - attr_accessor :email - - attr_accessor :is_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'is_verified' => :'isVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'is_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceHumanEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceHumanEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - is_verified == o.is_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, is_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceHumanEmail. + class UserServiceHumanEmail < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + email: 'email', + is_verified: 'isVerified' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + email: 'String', + is_verified: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_human_m_f_a_init_skipped_request.rb b/lib/zitadel/client/models/user_service_human_m_f_a_init_skipped_request.rb deleted file mode 100644 index 44716364..00000000 --- a/lib/zitadel/client/models/user_service_human_m_f_a_init_skipped_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceHumanMFAInitSkippedRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceHumanMFAInitSkippedRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceHumanMFAInitSkippedRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_human_m_f_a_init_skipped_response.rb b/lib/zitadel/client/models/user_service_human_m_f_a_init_skipped_response.rb deleted file mode 100644 index 192cc114..00000000 --- a/lib/zitadel/client/models/user_service_human_m_f_a_init_skipped_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceHumanMFAInitSkippedResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceHumanMFAInitSkippedResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceHumanMFAInitSkippedResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_human_mfa_init_skipped_request.rb b/lib/zitadel/client/models/user_service_human_mfa_init_skipped_request.rb new file mode 100644 index 00000000..d05c66d5 --- /dev/null +++ b/lib/zitadel/client/models/user_service_human_mfa_init_skipped_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceHumanMFAInitSkippedRequest. + class UserServiceHumanMFAInitSkippedRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_human_mfa_init_skipped_response.rb b/lib/zitadel/client/models/user_service_human_mfa_init_skipped_response.rb new file mode 100644 index 00000000..0dcfab1c --- /dev/null +++ b/lib/zitadel/client/models/user_service_human_mfa_init_skipped_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceHumanMFAInitSkippedResponse. + class UserServiceHumanMFAInitSkippedResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_human_phone.rb b/lib/zitadel/client/models/user_service_human_phone.rb index 211b8fa0..bca72ba5 100644 --- a/lib/zitadel/client/models/user_service_human_phone.rb +++ b/lib/zitadel/client/models/user_service_human_phone.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceHumanPhone - attr_accessor :phone - - attr_accessor :is_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone' => :'phone', - :'is_verified' => :'isVerified' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone' => :'String', - :'is_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceHumanPhone` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceHumanPhone`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone == o.phone && - is_verified == o.is_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone, is_verified].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceHumanPhone. + class UserServiceHumanPhone < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + phone: 'phone', + is_verified: 'isVerified' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + phone: 'String', + is_verified: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_human_profile.rb b/lib/zitadel/client/models/user_service_human_profile.rb index 83700cc3..51871853 100644 --- a/lib/zitadel/client/models/user_service_human_profile.rb +++ b/lib/zitadel/client/models/user_service_human_profile.rb @@ -1,294 +1,97 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceHumanProfile - attr_accessor :given_name - - attr_accessor :family_name - - attr_accessor :nick_name - - attr_accessor :display_name - - attr_accessor :preferred_language - - attr_accessor :gender - - attr_accessor :avatar_url - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'givenName', - :'family_name' => :'familyName', - :'nick_name' => :'nickName', - :'display_name' => :'displayName', - :'preferred_language' => :'preferredLanguage', - :'gender' => :'gender', - :'avatar_url' => :'avatarUrl' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'nick_name' => :'String', - :'display_name' => :'String', - :'preferred_language' => :'String', - :'gender' => :'UserServiceGender', - :'avatar_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'nick_name', - :'display_name', - :'preferred_language', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceHumanProfile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceHumanProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'preferred_language') - self.preferred_language = attributes[:'preferred_language'] - end - - if attributes.key?(:'gender') - self.gender = attributes[:'gender'] - end - - if attributes.key?(:'avatar_url') - self.avatar_url = attributes[:'avatar_url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - nick_name == o.nick_name && - display_name == o.display_name && - preferred_language == o.preferred_language && - gender == o.gender && - avatar_url == o.avatar_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, nick_name, display_name, preferred_language, gender, avatar_url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceHumanProfile. + class UserServiceHumanProfile < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + given_name: 'givenName', + family_name: 'familyName', + nick_name: 'nickName', + display_name: 'displayName', + preferred_language: 'preferredLanguage', + gender: 'gender', + avatar_url: 'avatarUrl' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + given_name: 'String', + family_name: 'String', + nick_name: 'String', + display_name: 'String', + preferred_language: 'String', + gender: 'UserServiceGender', + avatar_url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :given_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :family_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :nick_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_language, Types::Any.optional.meta(omittable: true) + # @example null + attribute :gender, Types::Any.optional.meta(omittable: true) + # @example null + attribute :avatar_url, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_human_user.rb b/lib/zitadel/client/models/user_service_human_user.rb index 6d546bbb..76f4226f 100644 --- a/lib/zitadel/client/models/user_service_human_user.rb +++ b/lib/zitadel/client/models/user_service_human_user.rb @@ -1,336 +1,120 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceHumanUser - # Unique identifier of the user. - attr_accessor :user_id - - attr_accessor :state - - # Username of the user, which can be globally unique or unique on organization level. - attr_accessor :username - - # Possible usable login names for the user. - attr_accessor :login_names - - # Preferred login name of the user. - attr_accessor :preferred_login_name - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - # User is required to change the used password on the next login. - attr_accessor :password_change_required - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :password_changed - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :mfa_init_skipped - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'state' => :'state', - :'username' => :'username', - :'login_names' => :'loginNames', - :'preferred_login_name' => :'preferredLoginName', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'password_change_required' => :'passwordChangeRequired', - :'password_changed' => :'passwordChanged', - :'mfa_init_skipped' => :'mfaInitSkipped' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'state' => :'UserServiceUserState', - :'username' => :'String', - :'login_names' => :'Array', - :'preferred_login_name' => :'String', - :'profile' => :'UserServiceHumanProfile', - :'email' => :'UserServiceHumanEmail', - :'phone' => :'UserServiceHumanPhone', - :'password_change_required' => :'Boolean', - :'password_changed' => :'Time', - :'mfa_init_skipped' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceHumanUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceHumanUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'login_names') - if (value = attributes[:'login_names']).is_a?(Array) - self.login_names = value - end - end - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'password_change_required') - self.password_change_required = attributes[:'password_change_required'] - end - - if attributes.key?(:'password_changed') - self.password_changed = attributes[:'password_changed'] - end - - if attributes.key?(:'mfa_init_skipped') - self.mfa_init_skipped = attributes[:'mfa_init_skipped'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - state == o.state && - username == o.username && - login_names == o.login_names && - preferred_login_name == o.preferred_login_name && - profile == o.profile && - email == o.email && - phone == o.phone && - password_change_required == o.password_change_required && - password_changed == o.password_changed && - mfa_init_skipped == o.mfa_init_skipped - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, state, username, login_names, preferred_login_name, profile, email, phone, password_change_required, password_changed, mfa_init_skipped].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceHumanUser. + class UserServiceHumanUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + state: 'state', + username: 'username', + login_names: 'loginNames', + preferred_login_name: 'preferredLoginName', + profile: 'profile', + email: 'email', + phone: 'phone', + password_change_required: 'passwordChangeRequired', + password_changed: 'passwordChanged', + mfa_init_skipped: 'mfaInitSkipped' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + state: 'UserServiceUserState', + username: 'String', + login_names: 'Array', + preferred_login_name: 'String', + profile: 'UserServiceHumanProfile', + email: 'UserServiceHumanEmail', + phone: 'UserServiceHumanPhone', + password_change_required: 'Boolean', + password_changed: 'Time', + mfa_init_skipped: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Unique identifier of the user. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # Username of the user, which can be globally unique or unique on organization level. + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # Possible usable login names for the user. + # @example null + attribute :login_names, Types::Any.optional.meta(omittable: true) + # Preferred login name of the user. + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :profile, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # User is required to change the used password on the next login. + # @example null + attribute :password_change_required, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :password_changed, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :mfa_init_skipped, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_i_d_filter.rb b/lib/zitadel/client/models/user_service_i_d_filter.rb deleted file mode 100644 index 4ed6d0f9..00000000 --- a/lib/zitadel/client/models/user_service_i_d_filter.rb +++ /dev/null @@ -1,216 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceIDFilter - # Only return resources that belong to this id. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_i_d_p_information.rb b/lib/zitadel/client/models/user_service_i_d_p_information.rb deleted file mode 100644 index 45364797..00000000 --- a/lib/zitadel/client/models/user_service_i_d_p_information.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceIDPInformation - attr_accessor :idp_id - - attr_accessor :user_id - - attr_accessor :user_name - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :raw_information - - attr_accessor :ldap - - attr_accessor :oauth - - attr_accessor :saml - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_id' => :'idpId', - :'user_id' => :'userId', - :'user_name' => :'userName', - :'raw_information' => :'rawInformation', - :'ldap' => :'ldap', - :'oauth' => :'oauth', - :'saml' => :'saml' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_id' => :'String', - :'user_id' => :'String', - :'user_name' => :'String', - :'raw_information' => :'Hash', - :'ldap' => :'UserServiceIDPLDAPAccessInformation', - :'oauth' => :'UserServiceIDPOAuthAccessInformation', - :'saml' => :'UserServiceIDPSAMLAccessInformation' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] - end - - if attributes.key?(:'raw_information') - if (value = attributes[:'raw_information']).is_a?(Hash) - self.raw_information = value - end - end - - if attributes.key?(:'ldap') - self.ldap = attributes[:'ldap'] - end - - if attributes.key?(:'oauth') - self.oauth = attributes[:'oauth'] - end - - if attributes.key?(:'saml') - self.saml = attributes[:'saml'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_id == o.idp_id && - user_id == o.user_id && - user_name == o.user_name && - raw_information == o.raw_information && - ldap == o.ldap && - oauth == o.oauth && - saml == o.saml - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_id, user_id, user_name, raw_information, ldap, oauth, saml].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_i_d_p_intent.rb b/lib/zitadel/client/models/user_service_i_d_p_intent.rb deleted file mode 100644 index 0f288225..00000000 --- a/lib/zitadel/client/models/user_service_i_d_p_intent.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceIDPIntent - attr_accessor :idp_intent_id - - attr_accessor :idp_intent_token - - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_intent_id' => :'idpIntentId', - :'idp_intent_token' => :'idpIntentToken', - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_intent_id' => :'String', - :'idp_intent_token' => :'String', - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPIntent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPIntent`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_intent_id') - self.idp_intent_id = attributes[:'idp_intent_id'] - end - - if attributes.key?(:'idp_intent_token') - self.idp_intent_token = attributes[:'idp_intent_token'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_intent_id == o.idp_intent_id && - idp_intent_token == o.idp_intent_token && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_intent_id, idp_intent_token, user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_i_d_p_l_d_a_p_access_information.rb b/lib/zitadel/client/models/user_service_i_d_p_l_d_a_p_access_information.rb deleted file mode 100644 index dbffd123..00000000 --- a/lib/zitadel/client/models/user_service_i_d_p_l_d_a_p_access_information.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceIDPLDAPAccessInformation - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :attributes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attributes' => :'attributes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'attributes' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPLDAPAccessInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPLDAPAccessInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attributes') - if (value = attributes[:'attributes']).is_a?(Hash) - self.attributes = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attributes == o.attributes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attributes].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_i_d_p_link.rb b/lib/zitadel/client/models/user_service_i_d_p_link.rb deleted file mode 100644 index 00e05ba4..00000000 --- a/lib/zitadel/client/models/user_service_i_d_p_link.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceIDPLink - attr_accessor :idp_id - - attr_accessor :user_id - - attr_accessor :user_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_id' => :'idpId', - :'user_id' => :'userId', - :'user_name' => :'userName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_id' => :'String', - :'user_id' => :'String', - :'user_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_id == o.idp_id && - user_id == o.user_id && - user_name == o.user_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_id, user_id, user_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_i_d_p_o_auth_access_information.rb b/lib/zitadel/client/models/user_service_i_d_p_o_auth_access_information.rb deleted file mode 100644 index 4b19893a..00000000 --- a/lib/zitadel/client/models/user_service_i_d_p_o_auth_access_information.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceIDPOAuthAccessInformation - attr_accessor :access_token - - attr_accessor :id_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'accessToken', - :'id_token' => :'idToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'id_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'id_token' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPOAuthAccessInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPOAuthAccessInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'id_token') - self.id_token = attributes[:'id_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - id_token == o.id_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, id_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_i_d_p_s_a_m_l_access_information.rb b/lib/zitadel/client/models/user_service_i_d_p_s_a_m_l_access_information.rb deleted file mode 100644 index e7c93c9b..00000000 --- a/lib/zitadel/client/models/user_service_i_d_p_s_a_m_l_access_information.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceIDPSAMLAccessInformation - attr_accessor :assertion - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'assertion' => :'assertion' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'assertion' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceIDPSAMLAccessInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceIDPSAMLAccessInformation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'assertion') - self.assertion = attributes[:'assertion'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - assertion == o.assertion - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [assertion].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_id_filter.rb b/lib/zitadel/client/models/user_service_id_filter.rb new file mode 100644 index 00000000..7d36cf8f --- /dev/null +++ b/lib/zitadel/client/models/user_service_id_filter.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceIDFilter. + class UserServiceIDFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # Only return resources that belong to this id. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_idp_information.rb b/lib/zitadel/client/models/user_service_idp_information.rb new file mode 100644 index 00000000..e030b3be --- /dev/null +++ b/lib/zitadel/client/models/user_service_idp_information.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceIDPInformation. + class UserServiceIDPInformation < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_id: 'idpId', + user_id: 'userId', + user_name: 'userName', + raw_information: 'rawInformation', + ldap: 'ldap', + oauth: 'oauth', + saml: 'saml' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_id: 'String', + user_id: 'String', + user_name: 'String', + raw_information: 'Hash', + ldap: 'UserServiceIDPLDAPAccessInformation', + oauth: 'UserServiceIDPOAuthAccessInformation', + saml: 'UserServiceIDPSAMLAccessInformation' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_name, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :raw_information, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ldap, Types::Any.optional.meta(omittable: true) + # @example null + attribute :oauth, Types::Any.optional.meta(omittable: true) + # @example null + attribute :saml, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_idp_intent.rb b/lib/zitadel/client/models/user_service_idp_intent.rb new file mode 100644 index 00000000..ec84327f --- /dev/null +++ b/lib/zitadel/client/models/user_service_idp_intent.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceIDPIntent. + class UserServiceIDPIntent < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_intent_id: 'idpIntentId', + idp_intent_token: 'idpIntentToken', + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_intent_id: 'String', + idp_intent_token: 'String', + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp_intent_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_intent_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_idp_link.rb b/lib/zitadel/client/models/user_service_idp_link.rb new file mode 100644 index 00000000..d5c71814 --- /dev/null +++ b/lib/zitadel/client/models/user_service_idp_link.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceIDPLink. + class UserServiceIDPLink < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_id: 'idpId', + user_id: 'userId', + user_name: 'userName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_id: 'String', + user_id: 'String', + user_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :idp_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_name, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_idpldap_access_information.rb b/lib/zitadel/client/models/user_service_idpldap_access_information.rb new file mode 100644 index 00000000..7101e514 --- /dev/null +++ b/lib/zitadel/client/models/user_service_idpldap_access_information.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceIDPLDAPAccessInformation. + class UserServiceIDPLDAPAccessInformation < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + attributes: 'attributes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + attributes: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :attributes, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_idpo_auth_access_information.rb b/lib/zitadel/client/models/user_service_idpo_auth_access_information.rb new file mode 100644 index 00000000..1b28db78 --- /dev/null +++ b/lib/zitadel/client/models/user_service_idpo_auth_access_information.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceIDPOAuthAccessInformation. + class UserServiceIDPOAuthAccessInformation < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + access_token: 'accessToken', + id_token: 'idToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + access_token: 'String', + id_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :access_token, Types::Any.optional.meta(omittable: true) + # @example null + attribute :id_token, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_idpsaml_access_information.rb b/lib/zitadel/client/models/user_service_idpsaml_access_information.rb new file mode 100644 index 00000000..802cf3a4 --- /dev/null +++ b/lib/zitadel/client/models/user_service_idpsaml_access_information.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceIDPSAMLAccessInformation. + class UserServiceIDPSAMLAccessInformation < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + assertion: 'assertion' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + assertion: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + assertion: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :assertion, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_in_user_emails_query.rb b/lib/zitadel/client/models/user_service_in_user_emails_query.rb index 4f7b3959..7671e1eb 100644 --- a/lib/zitadel/client/models/user_service_in_user_emails_query.rb +++ b/lib/zitadel/client/models/user_service_in_user_emails_query.rb @@ -1,218 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with email in list of emails. - class UserServiceInUserEmailsQuery - attr_accessor :user_emails - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_emails' => :'userEmails' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_emails' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceInUserEmailsQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceInUserEmailsQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_emails') - if (value = attributes[:'user_emails']).is_a?(Array) - self.user_emails = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_emails == o.user_emails - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_emails].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with email in list of emails. + class UserServiceInUserEmailsQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_emails: 'userEmails' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_emails: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_emails, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_in_user_i_d_query.rb b/lib/zitadel/client/models/user_service_in_user_i_d_query.rb deleted file mode 100644 index 39a05786..00000000 --- a/lib/zitadel/client/models/user_service_in_user_i_d_query.rb +++ /dev/null @@ -1,218 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - # Query for users with ID in list of IDs. - class UserServiceInUserIDQuery - attr_accessor :user_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_ids' => :'userIds' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceInUserIDQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceInUserIDQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_ids') - if (value = attributes[:'user_ids']).is_a?(Array) - self.user_ids = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_ids == o.user_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_ids].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_in_user_id_query.rb b/lib/zitadel/client/models/user_service_in_user_id_query.rb new file mode 100644 index 00000000..d708fcd5 --- /dev/null +++ b/lib/zitadel/client/models/user_service_in_user_id_query.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with ID in list of IDs. + class UserServiceInUserIDQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_ids: 'userIds' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_ids: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_ids, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_key.rb b/lib/zitadel/client/models/user_service_key.rb index 3539f14a..67dfc183 100644 --- a/lib/zitadel/client/models/user_service_key.rb +++ b/lib/zitadel/client/models/user_service_key.rb @@ -1,266 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceKey - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # The unique identifier of the key. - attr_accessor :id - - # The unique identifier of the user the key belongs to. - attr_accessor :user_id - - # The unique identifier of the organization the key belongs to. - attr_accessor :organization_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'id' => :'id', - :'user_id' => :'userId', - :'organization_id' => :'organizationId', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'id' => :'String', - :'user_id' => :'String', - :'organization_id' => :'String', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceKey` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - change_date == o.change_date && - id == o.id && - user_id == o.user_id && - organization_id == o.organization_id && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, change_date, id, user_id, organization_id, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceKey. + class UserServiceKey < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + change_date: 'changeDate', + id: 'id', + user_id: 'userId', + organization_id: 'organizationId', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + change_date: 'Time', + id: 'String', + user_id: 'String', + organization_id: 'String', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # The unique identifier of the key. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # The unique identifier of the user the key belongs to. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # The unique identifier of the organization the key belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_key_field_name.rb b/lib/zitadel/client/models/user_service_key_field_name.rb index 82ef4b0d..627691bb 100644 --- a/lib/zitadel/client/models/user_service_key_field_name.rb +++ b/lib/zitadel/client/models/user_service_key_field_name.rb @@ -1,45 +1,65 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class UserServiceKeyFieldName - KEY_FIELD_NAME_UNSPECIFIED = "KEY_FIELD_NAME_UNSPECIFIED".freeze - KEY_FIELD_NAME_CREATED_DATE = "KEY_FIELD_NAME_CREATED_DATE".freeze - KEY_FIELD_NAME_ID = "KEY_FIELD_NAME_ID".freeze - KEY_FIELD_NAME_USER_ID = "KEY_FIELD_NAME_USER_ID".freeze - KEY_FIELD_NAME_ORGANIZATION_ID = "KEY_FIELD_NAME_ORGANIZATION_ID".freeze - KEY_FIELD_NAME_KEY_EXPIRATION_DATE = "KEY_FIELD_NAME_KEY_EXPIRATION_DATE".freeze - - def self.all_vars - @all_vars ||= [KEY_FIELD_NAME_UNSPECIFIED, KEY_FIELD_NAME_CREATED_DATE, KEY_FIELD_NAME_ID, KEY_FIELD_NAME_USER_ID, KEY_FIELD_NAME_ORGANIZATION_ID, KEY_FIELD_NAME_KEY_EXPIRATION_DATE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceKeyFieldName. + class UserServiceKeyFieldName + KEY_FIELD_NAME_UNSPECIFIED = 'KEY_FIELD_NAME_UNSPECIFIED' + KEY_FIELD_NAME_CREATED_DATE = 'KEY_FIELD_NAME_CREATED_DATE' + KEY_FIELD_NAME_ID = 'KEY_FIELD_NAME_ID' + KEY_FIELD_NAME_USER_ID = 'KEY_FIELD_NAME_USER_ID' + KEY_FIELD_NAME_ORGANIZATION_ID = 'KEY_FIELD_NAME_ORGANIZATION_ID' + KEY_FIELD_NAME_KEY_EXPIRATION_DATE = 'KEY_FIELD_NAME_KEY_EXPIRATION_DATE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [KEY_FIELD_NAME_UNSPECIFIED, KEY_FIELD_NAME_CREATED_DATE, KEY_FIELD_NAME_ID, KEY_FIELD_NAME_USER_ID, KEY_FIELD_NAME_ORGANIZATION_ID, KEY_FIELD_NAME_KEY_EXPIRATION_DATE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceKeyFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceKeyFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceKeyFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_keys_search_filter.rb b/lib/zitadel/client/models/user_service_keys_search_filter.rb index 8c47c8f9..f9bcd2c5 100644 --- a/lib/zitadel/client/models/user_service_keys_search_filter.rb +++ b/lib/zitadel/client/models/user_service_keys_search_filter.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceKeysSearchFilter - attr_accessor :created_date_filter - - attr_accessor :expiration_date_filter - - attr_accessor :key_id_filter - - attr_accessor :organization_id_filter - - attr_accessor :user_id_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'created_date_filter' => :'createdDateFilter', - :'expiration_date_filter' => :'expirationDateFilter', - :'key_id_filter' => :'keyIdFilter', - :'organization_id_filter' => :'organizationIdFilter', - :'user_id_filter' => :'userIdFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'created_date_filter' => :'UserServiceTimestampFilter', - :'expiration_date_filter' => :'UserServiceTimestampFilter', - :'key_id_filter' => :'UserServiceIDFilter', - :'organization_id_filter' => :'UserServiceIDFilter', - :'user_id_filter' => :'UserServiceIDFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceKeysSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceKeysSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'created_date_filter') - self.created_date_filter = attributes[:'created_date_filter'] - end - - if attributes.key?(:'expiration_date_filter') - self.expiration_date_filter = attributes[:'expiration_date_filter'] - end - - if attributes.key?(:'key_id_filter') - self.key_id_filter = attributes[:'key_id_filter'] - end - - if attributes.key?(:'organization_id_filter') - self.organization_id_filter = attributes[:'organization_id_filter'] - end - - if attributes.key?(:'user_id_filter') - self.user_id_filter = attributes[:'user_id_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - created_date_filter == o.created_date_filter && - expiration_date_filter == o.expiration_date_filter && - key_id_filter == o.key_id_filter && - organization_id_filter == o.organization_id_filter && - user_id_filter == o.user_id_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [created_date_filter, expiration_date_filter, key_id_filter, organization_id_filter, user_id_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceKeysSearchFilter. + class UserServiceKeysSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + created_date_filter: 'createdDateFilter', + expiration_date_filter: 'expirationDateFilter', + key_id_filter: 'keyIdFilter', + organization_id_filter: 'organizationIdFilter', + user_id_filter: 'userIdFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + created_date_filter: 'UserServiceTimestampFilter', + expiration_date_filter: 'UserServiceTimestampFilter', + key_id_filter: 'UserServiceIDFilter', + organization_id_filter: 'UserServiceIDFilter', + user_id_filter: 'UserServiceIDFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :created_date_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :expiration_date_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :key_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_l_d_a_p_credentials.rb b/lib/zitadel/client/models/user_service_l_d_a_p_credentials.rb deleted file mode 100644 index 5ed068b8..00000000 --- a/lib/zitadel/client/models/user_service_l_d_a_p_credentials.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceLDAPCredentials - attr_accessor :username - - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'username' => :'username', - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'username' => :'String', - :'password' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceLDAPCredentials` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceLDAPCredentials`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - username == o.username && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [username, password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_last_name_query.rb b/lib/zitadel/client/models/user_service_last_name_query.rb index 8a18e251..fdb89390 100644 --- a/lib/zitadel/client/models/user_service_last_name_query.rb +++ b/lib/zitadel/client/models/user_service_last_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific last name. - class UserServiceLastNameQuery - attr_accessor :last_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'last_name' => :'lastName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'last_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceLastNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceLastNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - last_name == o.last_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [last_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific last name. + class UserServiceLastNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + last_name: 'lastName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + last_name: 'String', + method: 'UserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :last_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_ldap_credentials.rb b/lib/zitadel/client/models/user_service_ldap_credentials.rb new file mode 100644 index 00000000..2ed3ee23 --- /dev/null +++ b/lib/zitadel/client/models/user_service_ldap_credentials.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceLDAPCredentials. + class UserServiceLDAPCredentials < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + username: 'username', + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + username: 'String', + password: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_list_authentication_factors_request.rb b/lib/zitadel/client/models/user_service_list_authentication_factors_request.rb index 75644891..20e92265 100644 --- a/lib/zitadel/client/models/user_service_list_authentication_factors_request.rb +++ b/lib/zitadel/client/models/user_service_list_authentication_factors_request.rb @@ -1,237 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListAuthenticationFactorsRequest - attr_accessor :user_id - - attr_accessor :auth_factors - - attr_accessor :states - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'auth_factors' => :'authFactors', - :'states' => :'states' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'auth_factors' => :'Array', - :'states' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListAuthenticationFactorsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListAuthenticationFactorsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'auth_factors') - if (value = attributes[:'auth_factors']).is_a?(Array) - self.auth_factors = value - end - end - - if attributes.key?(:'states') - if (value = attributes[:'states']).is_a?(Array) - self.states = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - auth_factors == o.auth_factors && - states == o.states - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, auth_factors, states].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListAuthenticationFactorsRequest. + class UserServiceListAuthenticationFactorsRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + auth_factors: 'authFactors', + states: 'states' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + auth_factors: 'Array', + states: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_factors, Types::Any.optional.meta(omittable: true) + # @example null + attribute :states, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_list_authentication_factors_response.rb b/lib/zitadel/client/models/user_service_list_authentication_factors_response.rb index 520002e6..b27a7d9a 100644 --- a/lib/zitadel/client/models/user_service_list_authentication_factors_response.rb +++ b/lib/zitadel/client/models/user_service_list_authentication_factors_response.rb @@ -1,217 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListAuthenticationFactorsResponse - attr_accessor :result - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'result' => :'result' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'result' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListAuthenticationFactorsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListAuthenticationFactorsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'result') - if (value = attributes[:'result']).is_a?(Array) - self.result = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - result == o.result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [result].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListAuthenticationFactorsResponse. + class UserServiceListAuthenticationFactorsResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + result: 'result' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + result: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :result, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_list_authentication_method_types_request.rb b/lib/zitadel/client/models/user_service_list_authentication_method_types_request.rb index 1ebe38fe..fd68ab38 100644 --- a/lib/zitadel/client/models/user_service_list_authentication_method_types_request.rb +++ b/lib/zitadel/client/models/user_service_list_authentication_method_types_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListAuthenticationMethodTypesRequest - attr_accessor :user_id - - attr_accessor :domain_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'domain_query' => :'domainQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'domain_query' => :'UserServiceDomainQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListAuthenticationMethodTypesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListAuthenticationMethodTypesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'domain_query') - self.domain_query = attributes[:'domain_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - domain_query == o.domain_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, domain_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListAuthenticationMethodTypesRequest. + class UserServiceListAuthenticationMethodTypesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + domain_query: 'domainQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + domain_query: 'UserServiceDomainQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_list_authentication_method_types_response.rb b/lib/zitadel/client/models/user_service_list_authentication_method_types_response.rb index 50ee878e..32b3b6c6 100644 --- a/lib/zitadel/client/models/user_service_list_authentication_method_types_response.rb +++ b/lib/zitadel/client/models/user_service_list_authentication_method_types_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListAuthenticationMethodTypesResponse - attr_accessor :details - - attr_accessor :auth_method_types - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'auth_method_types' => :'authMethodTypes' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceListDetails', - :'auth_method_types' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListAuthenticationMethodTypesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListAuthenticationMethodTypesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'auth_method_types') - if (value = attributes[:'auth_method_types']).is_a?(Array) - self.auth_method_types = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - auth_method_types == o.auth_method_types - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, auth_method_types].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListAuthenticationMethodTypesResponse. + class UserServiceListAuthenticationMethodTypesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + auth_method_types: 'authMethodTypes' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceListDetails', + auth_method_types: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_method_types, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_list_details.rb b/lib/zitadel/client/models/user_service_list_details.rb index 3db526c3..8492f6bc 100644 --- a/lib/zitadel/client/models/user_service_list_details.rb +++ b/lib/zitadel/client/models/user_service_list_details.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListDetails - attr_accessor :total_result - - attr_accessor :processed_sequence - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'processed_sequence' => :'processedSequence', - :'timestamp' => :'timestamp' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'processed_sequence' => :'Object', - :'timestamp' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'processed_sequence', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'processed_sequence') - self.processed_sequence = attributes[:'processed_sequence'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - processed_sequence == o.processed_sequence && - timestamp == o.timestamp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, processed_sequence, timestamp].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListDetails. + class UserServiceListDetails < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + processed_sequence: 'processedSequence', + timestamp: 'timestamp' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + processed_sequence: 'Object', + timestamp: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # @example null + attribute :processed_sequence, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_list_i_d_p_links_request.rb b/lib/zitadel/client/models/user_service_list_i_d_p_links_request.rb deleted file mode 100644 index 38808d87..00000000 --- a/lib/zitadel/client/models/user_service_list_i_d_p_links_request.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceListIDPLinksRequest - attr_accessor :user_id - - attr_accessor :query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'query' => :'query' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'query' => :'UserServiceListQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListIDPLinksRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListIDPLinksRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - query == o.query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_list_i_d_p_links_response.rb b/lib/zitadel/client/models/user_service_list_i_d_p_links_response.rb deleted file mode 100644 index c5d04b5c..00000000 --- a/lib/zitadel/client/models/user_service_list_i_d_p_links_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceListIDPLinksResponse - attr_accessor :details - - attr_accessor :result - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'result' => :'result' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceListDetails', - :'result' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListIDPLinksResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListIDPLinksResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'result') - if (value = attributes[:'result']).is_a?(Array) - self.result = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - result == o.result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, result].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_list_idp_links_request.rb b/lib/zitadel/client/models/user_service_list_idp_links_request.rb new file mode 100644 index 00000000..2d1afa2a --- /dev/null +++ b/lib/zitadel/client/models/user_service_list_idp_links_request.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListIDPLinksRequest. + class UserServiceListIDPLinksRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + query: 'query' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + query: 'UserServiceListQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_list_idp_links_response.rb b/lib/zitadel/client/models/user_service_list_idp_links_response.rb new file mode 100644 index 00000000..9341fccb --- /dev/null +++ b/lib/zitadel/client/models/user_service_list_idp_links_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListIDPLinksResponse. + class UserServiceListIDPLinksResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + result: 'result' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceListDetails', + result: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :result, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_list_keys_request.rb b/lib/zitadel/client/models/user_service_list_keys_request.rb index 5b6548e0..3184bd76 100644 --- a/lib/zitadel/client/models/user_service_list_keys_request.rb +++ b/lib/zitadel/client/models/user_service_list_keys_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListKeysRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'UserServicePaginationRequest', - :'sorting_column' => :'UserServiceKeyFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListKeysRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListKeysRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListKeysRequest. + class UserServiceListKeysRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'UserServicePaginationRequest', + sorting_column: 'UserServiceKeyFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_list_keys_response.rb b/lib/zitadel/client/models/user_service_list_keys_response.rb index 5dca8c7c..0150add6 100644 --- a/lib/zitadel/client/models/user_service_list_keys_response.rb +++ b/lib/zitadel/client/models/user_service_list_keys_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListKeysResponse - attr_accessor :pagination - - attr_accessor :result - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'result' => :'result' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'UserServicePaginationResponse', - :'result' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListKeysResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListKeysResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'result') - if (value = attributes[:'result']).is_a?(Array) - self.result = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - result == o.result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, result].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListKeysResponse. + class UserServiceListKeysResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + result: 'result' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'UserServicePaginationResponse', + result: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :result, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_list_passkeys_request.rb b/lib/zitadel/client/models/user_service_list_passkeys_request.rb index 50817ea9..6df65e09 100644 --- a/lib/zitadel/client/models/user_service_list_passkeys_request.rb +++ b/lib/zitadel/client/models/user_service_list_passkeys_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListPasskeysRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListPasskeysRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListPasskeysRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListPasskeysRequest. + class UserServiceListPasskeysRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_list_passkeys_response.rb b/lib/zitadel/client/models/user_service_list_passkeys_response.rb index 4716b991..8f8237ef 100644 --- a/lib/zitadel/client/models/user_service_list_passkeys_response.rb +++ b/lib/zitadel/client/models/user_service_list_passkeys_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListPasskeysResponse - attr_accessor :details - - attr_accessor :result - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'result' => :'result' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceListDetails', - :'result' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListPasskeysResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListPasskeysResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'result') - if (value = attributes[:'result']).is_a?(Array) - self.result = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - result == o.result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, result].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListPasskeysResponse. + class UserServiceListPasskeysResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + result: 'result' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceListDetails', + result: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :result, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_list_personal_access_tokens_request.rb b/lib/zitadel/client/models/user_service_list_personal_access_tokens_request.rb index cbe9959f..d3ac534c 100644 --- a/lib/zitadel/client/models/user_service_list_personal_access_tokens_request.rb +++ b/lib/zitadel/client/models/user_service_list_personal_access_tokens_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListPersonalAccessTokensRequest - attr_accessor :pagination - - attr_accessor :sorting_column - - # Define the criteria to query for. - attr_accessor :filters - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'sorting_column' => :'sortingColumn', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'UserServicePaginationRequest', - :'sorting_column' => :'UserServicePersonalAccessTokenFieldName', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListPersonalAccessTokensRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListPersonalAccessTokensRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - sorting_column == o.sorting_column && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, sorting_column, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListPersonalAccessTokensRequest. + class UserServiceListPersonalAccessTokensRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + sorting_column: 'sortingColumn', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'UserServicePaginationRequest', + sorting_column: 'UserServicePersonalAccessTokenFieldName', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_list_personal_access_tokens_response.rb b/lib/zitadel/client/models/user_service_list_personal_access_tokens_response.rb index 4cee52a5..bd8973af 100644 --- a/lib/zitadel/client/models/user_service_list_personal_access_tokens_response.rb +++ b/lib/zitadel/client/models/user_service_list_personal_access_tokens_response.rb @@ -1,226 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListPersonalAccessTokensResponse - attr_accessor :pagination - - attr_accessor :result - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'result' => :'result' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'UserServicePaginationResponse', - :'result' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListPersonalAccessTokensResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListPersonalAccessTokensResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'result') - if (value = attributes[:'result']).is_a?(Array) - self.result = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - result == o.result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, result].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListPersonalAccessTokensResponse. + class UserServiceListPersonalAccessTokensResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + result: 'result' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'UserServicePaginationResponse', + result: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # @example null + attribute :result, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_list_query.rb b/lib/zitadel/client/models/user_service_list_query.rb index 1ee65bab..21606133 100644 --- a/lib/zitadel/client/models/user_service_list_query.rb +++ b/lib/zitadel/client/models/user_service_list_query.rb @@ -1,234 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListQuery - attr_accessor :offset - - attr_accessor :limit - - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListQuery. + class UserServiceListQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_list_user_metadata_request.rb b/lib/zitadel/client/models/user_service_list_user_metadata_request.rb index a00470dc..6a8ad99f 100644 --- a/lib/zitadel/client/models/user_service_list_user_metadata_request.rb +++ b/lib/zitadel/client/models/user_service_list_user_metadata_request.rb @@ -1,237 +1,83 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListUserMetadataRequest - # ID of the user under which the metadata is to be listed. - attr_accessor :user_id - - attr_accessor :pagination - - # Define the criteria to query for. - attr_accessor :filters - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'pagination' => :'pagination', - :'filters' => :'filters' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'pagination' => :'UserServicePaginationRequest', - :'filters' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListUserMetadataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListUserMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'filters') - if (value = attributes[:'filters']).is_a?(Array) - self.filters = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - pagination == o.pagination && - filters == o.filters - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, pagination, filters].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListUserMetadataRequest. + class UserServiceListUserMetadataRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + pagination: 'pagination', + filters: 'filters' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + pagination: 'UserServicePaginationRequest', + filters: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the user under which the metadata is to be listed. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # Define the criteria to query for. + # @example null + attribute :filters, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_list_user_metadata_response.rb b/lib/zitadel/client/models/user_service_list_user_metadata_response.rb index df17e959..80fbdc9e 100644 --- a/lib/zitadel/client/models/user_service_list_user_metadata_response.rb +++ b/lib/zitadel/client/models/user_service_list_user_metadata_response.rb @@ -1,227 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListUserMetadataResponse - attr_accessor :pagination - - # The user metadata requested. - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'metadata' => :'metadata' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'UserServicePaginationResponse', - :'metadata' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListUserMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListUserMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, metadata].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListUserMetadataResponse. + class UserServiceListUserMetadataResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + pagination: 'pagination', + metadata: 'metadata' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + pagination: 'UserServicePaginationResponse', + metadata: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :pagination, Types::Any.optional.meta(omittable: true) + # The user metadata requested. + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_list_users_request.rb b/lib/zitadel/client/models/user_service_list_users_request.rb index 7bf2cea2..f75e16be 100644 --- a/lib/zitadel/client/models/user_service_list_users_request.rb +++ b/lib/zitadel/client/models/user_service_list_users_request.rb @@ -1,258 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListUsersRequest - attr_accessor :query - - attr_accessor :sorting_column - - # criteria the client is looking for - attr_accessor :queries - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'query' => :'query', - :'sorting_column' => :'sortingColumn', - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'query' => :'UserServiceListQuery', - :'sorting_column' => :'UserServiceUserFieldName', - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListUsersRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListUsersRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - query == o.query && - sorting_column == o.sorting_column && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [query, sorting_column, queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListUsersRequest. + class UserServiceListUsersRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + query: 'query', + sorting_column: 'sortingColumn', + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + query: 'UserServiceListQuery', + sorting_column: 'UserServiceUserFieldName', + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # criteria the client is looking for + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_list_users_response.rb b/lib/zitadel/client/models/user_service_list_users_response.rb index 69d5bc84..21258f66 100644 --- a/lib/zitadel/client/models/user_service_list_users_response.rb +++ b/lib/zitadel/client/models/user_service_list_users_response.rb @@ -1,257 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceListUsersResponse - attr_accessor :details - - attr_accessor :sorting_column - - attr_accessor :result - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'sorting_column' => :'sortingColumn', - :'result' => :'result' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceListDetails', - :'sorting_column' => :'UserServiceUserFieldName', - :'result' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceListUsersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceListUsersResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'sorting_column') - self.sorting_column = attributes[:'sorting_column'] - end - - if attributes.key?(:'result') - if (value = attributes[:'result']).is_a?(Array) - self.result = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - sorting_column == o.sorting_column && - result == o.result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, sorting_column, result].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceListUsersResponse. + class UserServiceListUsersResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + sorting_column: 'sortingColumn', + result: 'result' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceListDetails', + sorting_column: 'UserServiceUserFieldName', + result: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :sorting_column, Types::Any.optional.meta(omittable: true) + # @example null + attribute :result, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_lock_user_request.rb b/lib/zitadel/client/models/user_service_lock_user_request.rb index 0420aece..37d7834a 100644 --- a/lib/zitadel/client/models/user_service_lock_user_request.rb +++ b/lib/zitadel/client/models/user_service_lock_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceLockUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceLockUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceLockUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceLockUserRequest. + class UserServiceLockUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_lock_user_response.rb b/lib/zitadel/client/models/user_service_lock_user_response.rb index 1cb06ed7..3eba635c 100644 --- a/lib/zitadel/client/models/user_service_lock_user_response.rb +++ b/lib/zitadel/client/models/user_service_lock_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceLockUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceLockUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceLockUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceLockUserResponse. + class UserServiceLockUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_login_name_query.rb b/lib/zitadel/client/models/user_service_login_name_query.rb index 1007a50d..b7e99b85 100644 --- a/lib/zitadel/client/models/user_service_login_name_query.rb +++ b/lib/zitadel/client/models/user_service_login_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific state. - class UserServiceLoginNameQuery - attr_accessor :login_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'login_name' => :'loginName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'login_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceLoginNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceLoginNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'login_name') - self.login_name = attributes[:'login_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - login_name == o.login_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [login_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific state. + class UserServiceLoginNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + login_name: 'loginName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + login_name: 'String', + method: 'UserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_machine.rb b/lib/zitadel/client/models/user_service_machine.rb index 68e9ed4f..4c9cf488 100644 --- a/lib/zitadel/client/models/user_service_machine.rb +++ b/lib/zitadel/client/models/user_service_machine.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceMachine - # The machine users name is a human readable field that helps identifying the user. - attr_accessor :name - - # The description is a field that helps to remember the purpose of the user. - attr_accessor :description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'description' => :'description' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'description' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceMachine` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceMachine`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, description].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceMachine. + class UserServiceMachine < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + description: 'description' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + description: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The machine users name is a human readable field that helps identifying the user. + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # The description is a field that helps to remember the purpose of the user. + # @example null + attribute :description, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_machine_user.rb b/lib/zitadel/client/models/user_service_machine_user.rb index 9cd4d2cb..ab4d0a4e 100644 --- a/lib/zitadel/client/models/user_service_machine_user.rb +++ b/lib/zitadel/client/models/user_service_machine_user.rb @@ -1,264 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceMachineUser - attr_accessor :name - - attr_accessor :description - - attr_accessor :has_secret - - attr_accessor :access_token_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'description' => :'description', - :'has_secret' => :'hasSecret', - :'access_token_type' => :'accessTokenType' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'description' => :'String', - :'has_secret' => :'Boolean', - :'access_token_type' => :'UserServiceAccessTokenType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceMachineUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceMachineUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'has_secret') - self.has_secret = attributes[:'has_secret'] - end - - if attributes.key?(:'access_token_type') - self.access_token_type = attributes[:'access_token_type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - description == o.description && - has_secret == o.has_secret && - access_token_type == o.access_token_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, description, has_secret, access_token_type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceMachineUser. + class UserServiceMachineUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + name: 'name', + description: 'description', + has_secret: 'hasSecret', + access_token_type: 'accessTokenType' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + name: 'String', + description: 'String', + has_secret: 'Boolean', + access_token_type: 'UserServiceAccessTokenType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :description, Types::Any.optional.meta(omittable: true) + # @example null + attribute :has_secret, Types::Any.optional.meta(omittable: true) + # @example null + attribute :access_token_type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_metadata.rb b/lib/zitadel/client/models/user_service_metadata.rb index 163a1a46..4d17ece7 100644 --- a/lib/zitadel/client/models/user_service_metadata.rb +++ b/lib/zitadel/client/models/user_service_metadata.rb @@ -1,226 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceMetadata - # Key in the metadata key/value pair. - attr_accessor :key - - # Value in the metadata key/value pair. - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'value' => :'value' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceMetadata`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, value].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceMetadata. + class UserServiceMetadata < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + value: 'value' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + value: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + value: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Key in the metadata key/value pair. + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # Value in the metadata key/value pair. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_metadata_key_filter.rb b/lib/zitadel/client/models/user_service_metadata_key_filter.rb index cc2293e8..5db3f7ea 100644 --- a/lib/zitadel/client/models/user_service_metadata_key_filter.rb +++ b/lib/zitadel/client/models/user_service_metadata_key_filter.rb @@ -1,246 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceMetadataKeyFilter - attr_accessor :key - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'method' => :'UserServiceTextFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceMetadataKeyFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceMetadataKeyFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceMetadataKeyFilter. + class UserServiceMetadataKeyFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + method: 'UserServiceTextFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_metadata_search_filter.rb b/lib/zitadel/client/models/user_service_metadata_search_filter.rb index 2a7d9451..d6c4bf6d 100644 --- a/lib/zitadel/client/models/user_service_metadata_search_filter.rb +++ b/lib/zitadel/client/models/user_service_metadata_search_filter.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceMetadataSearchFilter - attr_accessor :key_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key_filter' => :'keyFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key_filter' => :'UserServiceMetadataKeyFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceMetadataSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceMetadataSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key_filter') - self.key_filter = attributes[:'key_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key_filter == o.key_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceMetadataSearchFilter. + class UserServiceMetadataSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key_filter: 'keyFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key_filter: 'UserServiceMetadataKeyFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_metadata_value_filter.rb b/lib/zitadel/client/models/user_service_metadata_value_filter.rb index 2424ce61..8fee4a5c 100644 --- a/lib/zitadel/client/models/user_service_metadata_value_filter.rb +++ b/lib/zitadel/client/models/user_service_metadata_value_filter.rb @@ -1,246 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceMetadataValueFilter - attr_accessor :value - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'String', - :'method' => :'UserServiceByteFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceMetadataValueFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceMetadataValueFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceMetadataValueFilter. + class UserServiceMetadataValueFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + value: 'value', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + value: 'String', + method: 'UserServiceByteFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + value: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_nick_name_query.rb b/lib/zitadel/client/models/user_service_nick_name_query.rb index 5f10253b..04610373 100644 --- a/lib/zitadel/client/models/user_service_nick_name_query.rb +++ b/lib/zitadel/client/models/user_service_nick_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific nickname. - class UserServiceNickNameQuery - attr_accessor :nick_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'nick_name' => :'nickName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'nick_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceNickNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceNickNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - nick_name == o.nick_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [nick_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific nickname. + class UserServiceNickNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + nick_name: 'nickName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + nick_name: 'String', + method: 'UserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :nick_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_not_query.rb b/lib/zitadel/client/models/user_service_not_query.rb index 70da967c..084c6708 100644 --- a/lib/zitadel/client/models/user_service_not_query.rb +++ b/lib/zitadel/client/models/user_service_not_query.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Negate the sub-condition. - class UserServiceNotQuery - attr_accessor :query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'query' => :'query' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'query' => :'UserServiceSearchQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceNotQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceNotQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - query == o.query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Negate the sub-condition. + class UserServiceNotQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + query: 'query' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + query: 'UserServiceSearchQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_notification_type.rb b/lib/zitadel/client/models/user_service_notification_type.rb index eb2a431f..be153d95 100644 --- a/lib/zitadel/client/models/user_service_notification_type.rb +++ b/lib/zitadel/client/models/user_service_notification_type.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class UserServiceNotificationType - NOTIFICATION_TYPE_UNSPECIFIED = "NOTIFICATION_TYPE_Unspecified".freeze - NOTIFICATION_TYPE_EMAIL = "NOTIFICATION_TYPE_Email".freeze - NOTIFICATION_TYPE_SMS = "NOTIFICATION_TYPE_SMS".freeze - - def self.all_vars - @all_vars ||= [NOTIFICATION_TYPE_UNSPECIFIED, NOTIFICATION_TYPE_EMAIL, NOTIFICATION_TYPE_SMS].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceNotificationType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceNotificationType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceNotificationType. + class UserServiceNotificationType + NOTIFICATION_TYPE_UNSPECIFIED = 'NOTIFICATION_TYPE_Unspecified' + NOTIFICATION_TYPE_EMAIL = 'NOTIFICATION_TYPE_Email' + NOTIFICATION_TYPE_SMS = 'NOTIFICATION_TYPE_SMS' + + # Frozen set of all allowed values, used for validation. + VALUES = [NOTIFICATION_TYPE_UNSPECIFIED, NOTIFICATION_TYPE_EMAIL, NOTIFICATION_TYPE_SMS].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceNotificationType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_or_query.rb b/lib/zitadel/client/models/user_service_or_query.rb index 4ff36cac..b2aab0ea 100644 --- a/lib/zitadel/client/models/user_service_or_query.rb +++ b/lib/zitadel/client/models/user_service_or_query.rb @@ -1,218 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Connect multiple sub-condition with and OR operator. - class UserServiceOrQuery - attr_accessor :queries - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queries' => :'queries' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queries' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceOrQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceOrQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queries') - if (value = attributes[:'queries']).is_a?(Array) - self.queries = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queries == o.queries - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queries].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Connect multiple sub-condition with and OR operator. + class UserServiceOrQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + queries: 'queries' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + queries: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :queries, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_organization.rb b/lib/zitadel/client/models/user_service_organization.rb index b9267efe..3fa43d79 100644 --- a/lib/zitadel/client/models/user_service_organization.rb +++ b/lib/zitadel/client/models/user_service_organization.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceOrganization - attr_accessor :org_domain - - attr_accessor :org_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'org_domain' => :'orgDomain', - :'org_id' => :'orgId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'org_domain' => :'String', - :'org_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceOrganization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceOrganization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'org_domain') - self.org_domain = attributes[:'org_domain'] - end - - if attributes.key?(:'org_id') - self.org_id = attributes[:'org_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - org_domain == o.org_domain && - org_id == o.org_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [org_domain, org_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceOrganization. + class UserServiceOrganization < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + org_domain: 'orgDomain', + org_id: 'orgId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + org_domain: 'String', + org_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :org_domain, Types::Any.optional.meta(omittable: true) + # @example null + attribute :org_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_organization_id_query.rb b/lib/zitadel/client/models/user_service_organization_id_query.rb index e1239742..be43e50a 100644 --- a/lib/zitadel/client/models/user_service_organization_id_query.rb +++ b/lib/zitadel/client/models/user_service_organization_id_query.rb @@ -1,216 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users under a specific organization as resource owner. - class UserServiceOrganizationIdQuery - attr_accessor :organization_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organization_id' => :'organizationId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'organization_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceOrganizationIdQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceOrganizationIdQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organization_id == o.organization_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organization_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users under a specific organization as resource owner. + class UserServiceOrganizationIdQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + organization_id: 'organizationId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + organization_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_pagination_request.rb b/lib/zitadel/client/models/user_service_pagination_request.rb index 7e39589e..5c91834f 100644 --- a/lib/zitadel/client/models/user_service_pagination_request.rb +++ b/lib/zitadel/client/models/user_service_pagination_request.rb @@ -1,237 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServicePaginationRequest - # Starting point for retrieval, in combination of offset used to query a set list of objects. - attr_accessor :offset - - # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. - attr_accessor :limit - - # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. - attr_accessor :asc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'offset' => :'offset', - :'limit' => :'limit', - :'asc' => :'asc' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'offset' => :'Object', - :'limit' => :'Integer', - :'asc' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'offset', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePaginationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePaginationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'asc') - self.asc = attributes[:'asc'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - offset == o.offset && - limit == o.limit && - asc == o.asc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [offset, limit, asc].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServicePaginationRequest. + class UserServicePaginationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + offset: 'offset', + limit: 'limit', + asc: 'asc' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + offset: 'Object', + limit: 'Integer', + asc: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Starting point for retrieval, in combination of offset used to query a set list of objects. + # @example null + attribute :offset, Types::Any.optional.meta(omittable: true) + # limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken. + # @example null + attribute :limit, Types::Any.optional.meta(omittable: true) + # Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending. + # @example null + attribute :asc, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_pagination_response.rb b/lib/zitadel/client/models/user_service_pagination_response.rb index d3bbbc9b..d742188b 100644 --- a/lib/zitadel/client/models/user_service_pagination_response.rb +++ b/lib/zitadel/client/models/user_service_pagination_response.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServicePaginationResponse - # Absolute number of objects matching the query, regardless of applied limit. - attr_accessor :total_result - - # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. - attr_accessor :applied_limit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_result' => :'totalResult', - :'applied_limit' => :'appliedLimit' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_result' => :'Object', - :'applied_limit' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'total_result', - :'applied_limit' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePaginationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePaginationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_result') - self.total_result = attributes[:'total_result'] - end - - if attributes.key?(:'applied_limit') - self.applied_limit = attributes[:'applied_limit'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_result == o.total_result && - applied_limit == o.applied_limit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_result, applied_limit].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServicePaginationResponse. + class UserServicePaginationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + total_result: 'totalResult', + applied_limit: 'appliedLimit' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + total_result: 'Object', + applied_limit: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Absolute number of objects matching the query, regardless of applied limit. + # @example null + attribute :total_result, Types::Any.optional.meta(omittable: true) + # Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned. + # @example null + attribute :applied_limit, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_passkey.rb b/lib/zitadel/client/models/user_service_passkey.rb index 569f1ea1..2d85cc4a 100644 --- a/lib/zitadel/client/models/user_service_passkey.rb +++ b/lib/zitadel/client/models/user_service_passkey.rb @@ -1,255 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServicePasskey - attr_accessor :id - - attr_accessor :state - - attr_accessor :name - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'state' => :'state', - :'name' => :'name' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'state' => :'UserServiceAuthFactorState', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePasskey` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePasskey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - state == o.state && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, state, name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServicePasskey. + class UserServicePasskey < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + state: 'state', + name: 'name' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + state: 'UserServiceAuthFactorState', + name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_passkey_authenticator.rb b/lib/zitadel/client/models/user_service_passkey_authenticator.rb index 561626d9..f8acb7a6 100644 --- a/lib/zitadel/client/models/user_service_passkey_authenticator.rb +++ b/lib/zitadel/client/models/user_service_passkey_authenticator.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class UserServicePasskeyAuthenticator - PASSKEY_AUTHENTICATOR_UNSPECIFIED = "PASSKEY_AUTHENTICATOR_UNSPECIFIED".freeze - PASSKEY_AUTHENTICATOR_PLATFORM = "PASSKEY_AUTHENTICATOR_PLATFORM".freeze - PASSKEY_AUTHENTICATOR_CROSS_PLATFORM = "PASSKEY_AUTHENTICATOR_CROSS_PLATFORM".freeze - - def self.all_vars - @all_vars ||= [PASSKEY_AUTHENTICATOR_UNSPECIFIED, PASSKEY_AUTHENTICATOR_PLATFORM, PASSKEY_AUTHENTICATOR_CROSS_PLATFORM].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServicePasskeyAuthenticator.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServicePasskeyAuthenticator" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServicePasskeyAuthenticator. + class UserServicePasskeyAuthenticator + PASSKEY_AUTHENTICATOR_UNSPECIFIED = 'PASSKEY_AUTHENTICATOR_UNSPECIFIED' + PASSKEY_AUTHENTICATOR_PLATFORM = 'PASSKEY_AUTHENTICATOR_PLATFORM' + PASSKEY_AUTHENTICATOR_CROSS_PLATFORM = 'PASSKEY_AUTHENTICATOR_CROSS_PLATFORM' + + # Frozen set of all allowed values, used for validation. + VALUES = [PASSKEY_AUTHENTICATOR_UNSPECIFIED, PASSKEY_AUTHENTICATOR_PLATFORM, PASSKEY_AUTHENTICATOR_CROSS_PLATFORM].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServicePasskeyAuthenticator: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_passkey_registration_code.rb b/lib/zitadel/client/models/user_service_passkey_registration_code.rb index 380da191..320de453 100644 --- a/lib/zitadel/client/models/user_service_passkey_registration_code.rb +++ b/lib/zitadel/client/models/user_service_passkey_registration_code.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServicePasskeyRegistrationCode - attr_accessor :id - - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePasskeyRegistrationCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePasskeyRegistrationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServicePasskeyRegistrationCode. + class UserServicePasskeyRegistrationCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_password.rb b/lib/zitadel/client/models/user_service_password.rb index 1360b69d..592f6718 100644 --- a/lib/zitadel/client/models/user_service_password.rb +++ b/lib/zitadel/client/models/user_service_password.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServicePassword - attr_accessor :password - - attr_accessor :change_required - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'password' => :'password', - :'change_required' => :'changeRequired' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'password' => :'String', - :'change_required' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'change_required') - self.change_required = attributes[:'change_required'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - password == o.password && - change_required == o.change_required - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [password, change_required].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServicePassword. + class UserServicePassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + password: 'password', + change_required: 'changeRequired' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + password: 'String', + change_required: 'Boolean' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :change_required, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_password_reset_request.rb b/lib/zitadel/client/models/user_service_password_reset_request.rb index 063c5291..107cc87e 100644 --- a/lib/zitadel/client/models/user_service_password_reset_request.rb +++ b/lib/zitadel/client/models/user_service_password_reset_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServicePasswordResetRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_link - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_link' => :'sendLink' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_link' => :'UserServiceSendPasswordResetLink' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePasswordResetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePasswordResetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_link') - self.send_link = attributes[:'send_link'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_link == o.send_link - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_link].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServicePasswordResetRequest. + class UserServicePasswordResetRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_link: 'sendLink' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_link: 'UserServiceSendPasswordResetLink' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_link, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_password_reset_response.rb b/lib/zitadel/client/models/user_service_password_reset_response.rb index 05a59254..435af9d4 100644 --- a/lib/zitadel/client/models/user_service_password_reset_response.rb +++ b/lib/zitadel/client/models/user_service_password_reset_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServicePasswordResetResponse - attr_accessor :details - - # in case the medium was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePasswordResetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePasswordResetResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServicePasswordResetResponse. + class UserServicePasswordResetResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the medium was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_personal_access_token.rb b/lib/zitadel/client/models/user_service_personal_access_token.rb index 9aa6b16a..ab89f94e 100644 --- a/lib/zitadel/client/models/user_service_personal_access_token.rb +++ b/lib/zitadel/client/models/user_service_personal_access_token.rb @@ -1,266 +1,99 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServicePersonalAccessToken - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # The unique identifier of the personal access token. - attr_accessor :id - - # The unique identifier of the user the personal access token belongs to. - attr_accessor :user_id - - # The unique identifier of the organization the personal access token belongs to. - attr_accessor :organization_id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :expiration_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'id' => :'id', - :'user_id' => :'userId', - :'organization_id' => :'organizationId', - :'expiration_date' => :'expirationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'id' => :'String', - :'user_id' => :'String', - :'organization_id' => :'String', - :'expiration_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePersonalAccessToken` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePersonalAccessToken`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'organization_id') - self.organization_id = attributes[:'organization_id'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - creation_date == o.creation_date && - change_date == o.change_date && - id == o.id && - user_id == o.user_id && - organization_id == o.organization_id && - expiration_date == o.expiration_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [creation_date, change_date, id, user_id, organization_id, expiration_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServicePersonalAccessToken. + class UserServicePersonalAccessToken < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + creation_date: 'creationDate', + change_date: 'changeDate', + id: 'id', + user_id: 'userId', + organization_id: 'organizationId', + expiration_date: 'expirationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + creation_date: 'Time', + change_date: 'Time', + id: 'String', + user_id: 'String', + organization_id: 'String', + expiration_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # The unique identifier of the personal access token. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # The unique identifier of the user the personal access token belongs to. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # The unique identifier of the organization the personal access token belongs to. + # @example null + attribute :organization_id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :expiration_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_personal_access_token_field_name.rb b/lib/zitadel/client/models/user_service_personal_access_token_field_name.rb index c3d09f3e..20d43c9e 100644 --- a/lib/zitadel/client/models/user_service_personal_access_token_field_name.rb +++ b/lib/zitadel/client/models/user_service_personal_access_token_field_name.rb @@ -1,45 +1,65 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class UserServicePersonalAccessTokenFieldName - PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED = "PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED".freeze - PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE = "PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE".freeze - PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID = "PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID".freeze - PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID = "PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID".freeze - PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID = "PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID".freeze - PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE = "PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE".freeze - - def self.all_vars - @all_vars ||= [PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED, PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE, PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID, PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID, PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID, PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServicePersonalAccessTokenFieldName. + class UserServicePersonalAccessTokenFieldName + PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED' + PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE' + PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID' + PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID' + PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID' + PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED, PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE, PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID, PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID, PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID, PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServicePersonalAccessTokenFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServicePersonalAccessTokenFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServicePersonalAccessTokenFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_personal_access_tokens_search_filter.rb b/lib/zitadel/client/models/user_service_personal_access_tokens_search_filter.rb index 731fe179..739d565a 100644 --- a/lib/zitadel/client/models/user_service_personal_access_tokens_search_filter.rb +++ b/lib/zitadel/client/models/user_service_personal_access_tokens_search_filter.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServicePersonalAccessTokensSearchFilter - attr_accessor :created_date_filter - - attr_accessor :expiration_date_filter - - attr_accessor :organization_id_filter - - attr_accessor :token_id_filter - - attr_accessor :user_id_filter - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'created_date_filter' => :'createdDateFilter', - :'expiration_date_filter' => :'expirationDateFilter', - :'organization_id_filter' => :'organizationIdFilter', - :'token_id_filter' => :'tokenIdFilter', - :'user_id_filter' => :'userIdFilter' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'created_date_filter' => :'UserServiceTimestampFilter', - :'expiration_date_filter' => :'UserServiceTimestampFilter', - :'organization_id_filter' => :'UserServiceIDFilter', - :'token_id_filter' => :'UserServiceIDFilter', - :'user_id_filter' => :'UserServiceIDFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePersonalAccessTokensSearchFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePersonalAccessTokensSearchFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'created_date_filter') - self.created_date_filter = attributes[:'created_date_filter'] - end - - if attributes.key?(:'expiration_date_filter') - self.expiration_date_filter = attributes[:'expiration_date_filter'] - end - - if attributes.key?(:'organization_id_filter') - self.organization_id_filter = attributes[:'organization_id_filter'] - end - - if attributes.key?(:'token_id_filter') - self.token_id_filter = attributes[:'token_id_filter'] - end - - if attributes.key?(:'user_id_filter') - self.user_id_filter = attributes[:'user_id_filter'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - created_date_filter == o.created_date_filter && - expiration_date_filter == o.expiration_date_filter && - organization_id_filter == o.organization_id_filter && - token_id_filter == o.token_id_filter && - user_id_filter == o.user_id_filter - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [created_date_filter, expiration_date_filter, organization_id_filter, token_id_filter, user_id_filter].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServicePersonalAccessTokensSearchFilter. + class UserServicePersonalAccessTokensSearchFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + created_date_filter: 'createdDateFilter', + expiration_date_filter: 'expirationDateFilter', + organization_id_filter: 'organizationIdFilter', + token_id_filter: 'tokenIdFilter', + user_id_filter: 'userIdFilter' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + created_date_filter: 'UserServiceTimestampFilter', + expiration_date_filter: 'UserServiceTimestampFilter', + organization_id_filter: 'UserServiceIDFilter', + token_id_filter: 'UserServiceIDFilter', + user_id_filter: 'UserServiceIDFilter' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :created_date_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :expiration_date_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :token_id_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id_filter, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_phone_query.rb b/lib/zitadel/client/models/user_service_phone_query.rb index 33ab8c99..86c4ce56 100644 --- a/lib/zitadel/client/models/user_service_phone_query.rb +++ b/lib/zitadel/client/models/user_service_phone_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific phone. - class UserServicePhoneQuery - attr_accessor :number - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'number' => :'number', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'number' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServicePhoneQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServicePhoneQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'number') - self.number = attributes[:'number'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - number == o.number && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [number, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific phone. + class UserServicePhoneQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + number: 'number', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + number: 'String', + method: 'UserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :number, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_profile.rb b/lib/zitadel/client/models/user_service_profile.rb index 3dc48b80..75dc6f90 100644 --- a/lib/zitadel/client/models/user_service_profile.rb +++ b/lib/zitadel/client/models/user_service_profile.rb @@ -1,292 +1,98 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceProfile - # The given name is the first name of the user. For example, it can be used to personalize notifications and login UIs. - attr_accessor :given_name - - # The family name is the last name of the user. For example, it can be used to personalize user interfaces and notifications. - attr_accessor :family_name - - # The nick name is the users short name. For example, it can be used to personalize user interfaces and notifications. - attr_accessor :nick_name - - # The display name is how a user should primarily be displayed in lists. It can also for example be used to personalize user interfaces and notifications. - attr_accessor :display_name - - # The users preferred language is the language that systems should use to interact with the user. It has the format of a [BCP-47 language tag](https://datatracker.ietf.org/doc/html/rfc3066). It is used by Zitadel where no higher prioritized preferred language can be used. For example, browser settings can overwrite a users preferred_language. Notification messages and standard login UIs use the users preferred language if it is supported and allowed on the instance. Else, the default language of the instance is used. - attr_accessor :preferred_language - - attr_accessor :gender - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'givenName', - :'family_name' => :'familyName', - :'nick_name' => :'nickName', - :'display_name' => :'displayName', - :'preferred_language' => :'preferredLanguage', - :'gender' => :'gender' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'nick_name' => :'String', - :'display_name' => :'String', - :'preferred_language' => :'String', - :'gender' => :'UserServiceGender' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'given_name', - :'family_name', - :'nick_name', - :'display_name', - :'preferred_language', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceProfile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'preferred_language') - self.preferred_language = attributes[:'preferred_language'] - end - - if attributes.key?(:'gender') - self.gender = attributes[:'gender'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - nick_name == o.nick_name && - display_name == o.display_name && - preferred_language == o.preferred_language && - gender == o.gender - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, nick_name, display_name, preferred_language, gender].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceProfile. + class UserServiceProfile < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + given_name: 'givenName', + family_name: 'familyName', + nick_name: 'nickName', + display_name: 'displayName', + preferred_language: 'preferredLanguage', + gender: 'gender' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + given_name: 'String', + family_name: 'String', + nick_name: 'String', + display_name: 'String', + preferred_language: 'String', + gender: 'UserServiceGender' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The given name is the first name of the user. For example, it can be used to personalize notifications and login UIs. + # @example null + attribute :given_name, Types::Any.optional.meta(omittable: true) + # The family name is the last name of the user. For example, it can be used to personalize user interfaces and notifications. + # @example null + attribute :family_name, Types::Any.optional.meta(omittable: true) + # The nick name is the users short name. For example, it can be used to personalize user interfaces and notifications. + # @example null + attribute :nick_name, Types::Any.optional.meta(omittable: true) + # The display name is how a user should primarily be displayed in lists. It can also for example be used to personalize user interfaces and notifications. + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # The users preferred language is the language that systems should use to interact with the user. It has the format of a [BCP-47 language tag](https://datatracker.ietf.org/doc/html/rfc3066). It is used by Zitadel where no higher prioritized preferred language can be used. For example, browser settings can overwrite a users preferred_language. Notification messages and standard login UIs use the users preferred language if it is supported and allowed on the instance. Else, the default language of the instance is used. + # @example null + attribute :preferred_language, Types::Any.optional.meta(omittable: true) + # @example null + attribute :gender, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_reactivate_user_request.rb b/lib/zitadel/client/models/user_service_reactivate_user_request.rb index 7fdcafad..3ce4d854 100644 --- a/lib/zitadel/client/models/user_service_reactivate_user_request.rb +++ b/lib/zitadel/client/models/user_service_reactivate_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceReactivateUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceReactivateUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceReactivateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceReactivateUserRequest. + class UserServiceReactivateUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_reactivate_user_response.rb b/lib/zitadel/client/models/user_service_reactivate_user_response.rb index f595247a..108e94f4 100644 --- a/lib/zitadel/client/models/user_service_reactivate_user_response.rb +++ b/lib/zitadel/client/models/user_service_reactivate_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceReactivateUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceReactivateUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceReactivateUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceReactivateUserResponse. + class UserServiceReactivateUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_redirect_u_r_ls.rb b/lib/zitadel/client/models/user_service_redirect_u_r_ls.rb deleted file mode 100644 index 0687bec3..00000000 --- a/lib/zitadel/client/models/user_service_redirect_u_r_ls.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRedirectURLs - attr_accessor :success_url - - attr_accessor :failure_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'success_url' => :'successUrl', - :'failure_url' => :'failureUrl' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'success_url' => :'String', - :'failure_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRedirectURLs` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRedirectURLs`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'success_url') - self.success_url = attributes[:'success_url'] - end - - if attributes.key?(:'failure_url') - self.failure_url = attributes[:'failure_url'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - success_url == o.success_url && - failure_url == o.failure_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [success_url, failure_url].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_redirect_urls.rb b/lib/zitadel/client/models/user_service_redirect_urls.rb new file mode 100644 index 00000000..99fc6c78 --- /dev/null +++ b/lib/zitadel/client/models/user_service_redirect_urls.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRedirectURLs. + class UserServiceRedirectURLs < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + success_url: 'successUrl', + failure_url: 'failureUrl' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + success_url: 'String', + failure_url: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :success_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :failure_url, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_register_passkey_request.rb b/lib/zitadel/client/models/user_service_register_passkey_request.rb index 195707a8..6d9b618e 100644 --- a/lib/zitadel/client/models/user_service_register_passkey_request.rb +++ b/lib/zitadel/client/models/user_service_register_passkey_request.rb @@ -1,264 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRegisterPasskeyRequest - attr_accessor :user_id - - attr_accessor :code - - attr_accessor :authenticator - - attr_accessor :domain - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'code' => :'code', - :'authenticator' => :'authenticator', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'code' => :'UserServicePasskeyRegistrationCode', - :'authenticator' => :'UserServicePasskeyAuthenticator', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRegisterPasskeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRegisterPasskeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'authenticator') - self.authenticator = attributes[:'authenticator'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - code == o.code && - authenticator == o.authenticator && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, code, authenticator, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRegisterPasskeyRequest. + class UserServiceRegisterPasskeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + code: 'code', + authenticator: 'authenticator', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + code: 'UserServicePasskeyRegistrationCode', + authenticator: 'UserServicePasskeyAuthenticator', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :authenticator, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_register_passkey_response.rb b/lib/zitadel/client/models/user_service_register_passkey_response.rb index aef97452..25aaa78d 100644 --- a/lib/zitadel/client/models/user_service_register_passkey_response.rb +++ b/lib/zitadel/client/models/user_service_register_passkey_response.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRegisterPasskeyResponse - attr_accessor :details - - attr_accessor :passkey_id - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :public_key_credential_creation_options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'passkey_id' => :'passkeyId', - :'public_key_credential_creation_options' => :'publicKeyCredentialCreationOptions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'passkey_id' => :'String', - :'public_key_credential_creation_options' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRegisterPasskeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRegisterPasskeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'passkey_id') - self.passkey_id = attributes[:'passkey_id'] - end - - if attributes.key?(:'public_key_credential_creation_options') - if (value = attributes[:'public_key_credential_creation_options']).is_a?(Hash) - self.public_key_credential_creation_options = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - passkey_id == o.passkey_id && - public_key_credential_creation_options == o.public_key_credential_creation_options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, passkey_id, public_key_credential_creation_options].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRegisterPasskeyResponse. + class UserServiceRegisterPasskeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + passkey_id: 'passkeyId', + public_key_credential_creation_options: 'publicKeyCredentialCreationOptions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + passkey_id: 'String', + public_key_credential_creation_options: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :passkey_id, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :public_key_credential_creation_options, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_register_t_o_t_p_request.rb b/lib/zitadel/client/models/user_service_register_t_o_t_p_request.rb deleted file mode 100644 index 26235b4e..00000000 --- a/lib/zitadel/client/models/user_service_register_t_o_t_p_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRegisterTOTPRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRegisterTOTPRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRegisterTOTPRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_register_t_o_t_p_response.rb b/lib/zitadel/client/models/user_service_register_t_o_t_p_response.rb deleted file mode 100644 index e742c4ff..00000000 --- a/lib/zitadel/client/models/user_service_register_t_o_t_p_response.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRegisterTOTPResponse - attr_accessor :details - - attr_accessor :uri - - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'uri' => :'uri', - :'secret' => :'secret' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'uri' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRegisterTOTPResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRegisterTOTPResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'uri') - self.uri = attributes[:'uri'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - uri == o.uri && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, uri, secret].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_register_totp_request.rb b/lib/zitadel/client/models/user_service_register_totp_request.rb new file mode 100644 index 00000000..e68b9003 --- /dev/null +++ b/lib/zitadel/client/models/user_service_register_totp_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRegisterTOTPRequest. + class UserServiceRegisterTOTPRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_register_totp_response.rb b/lib/zitadel/client/models/user_service_register_totp_response.rb new file mode 100644 index 00000000..03da4dad --- /dev/null +++ b/lib/zitadel/client/models/user_service_register_totp_response.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRegisterTOTPResponse. + class UserServiceRegisterTOTPResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + uri: 'uri', + secret: 'secret' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + uri: 'String', + secret: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :uri, Types::Any.optional.meta(omittable: true) + # @example null + attribute :secret, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_register_u2_f_request.rb b/lib/zitadel/client/models/user_service_register_u2_f_request.rb index cc7769a0..c861aef7 100644 --- a/lib/zitadel/client/models/user_service_register_u2_f_request.rb +++ b/lib/zitadel/client/models/user_service_register_u2_f_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRegisterU2FRequest - attr_accessor :user_id - - attr_accessor :domain - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'domain' => :'domain' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'domain' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRegisterU2FRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRegisterU2FRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'domain') - self.domain = attributes[:'domain'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - domain == o.domain - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, domain].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRegisterU2FRequest. + class UserServiceRegisterU2FRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + domain: 'domain' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + domain: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :domain, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_register_u2_f_response.rb b/lib/zitadel/client/models/user_service_register_u2_f_response.rb index 26cc4960..74abb5a5 100644 --- a/lib/zitadel/client/models/user_service_register_u2_f_response.rb +++ b/lib/zitadel/client/models/user_service_register_u2_f_response.rb @@ -1,236 +1,82 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRegisterU2FResponse - attr_accessor :details - - attr_accessor :u2f_id - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :public_key_credential_creation_options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'u2f_id' => :'u2fId', - :'public_key_credential_creation_options' => :'publicKeyCredentialCreationOptions' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'u2f_id' => :'String', - :'public_key_credential_creation_options' => :'Hash' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRegisterU2FResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRegisterU2FResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'u2f_id') - self.u2f_id = attributes[:'u2f_id'] - end - - if attributes.key?(:'public_key_credential_creation_options') - if (value = attributes[:'public_key_credential_creation_options']).is_a?(Hash) - self.public_key_credential_creation_options = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - u2f_id == o.u2f_id && - public_key_credential_creation_options == o.public_key_credential_creation_options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, u2f_id, public_key_credential_creation_options].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRegisterU2FResponse. + class UserServiceRegisterU2FResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + u2f_id: 'u2fId', + public_key_credential_creation_options: 'publicKeyCredentialCreationOptions' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + u2f_id: 'String', + public_key_credential_creation_options: 'Hash' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :u2f_id, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :public_key_credential_creation_options, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_remove_i_d_p_link_request.rb b/lib/zitadel/client/models/user_service_remove_i_d_p_link_request.rb deleted file mode 100644 index cd7ac073..00000000 --- a/lib/zitadel/client/models/user_service_remove_i_d_p_link_request.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveIDPLinkRequest - attr_accessor :user_id - - attr_accessor :idp_id - - attr_accessor :linked_user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'idp_id' => :'idpId', - :'linked_user_id' => :'linkedUserId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'idp_id' => :'String', - :'linked_user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveIDPLinkRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveIDPLinkRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'linked_user_id') - self.linked_user_id = attributes[:'linked_user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - idp_id == o.idp_id && - linked_user_id == o.linked_user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, idp_id, linked_user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_remove_i_d_p_link_response.rb b/lib/zitadel/client/models/user_service_remove_i_d_p_link_response.rb deleted file mode 100644 index 642f741b..00000000 --- a/lib/zitadel/client/models/user_service_remove_i_d_p_link_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveIDPLinkResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveIDPLinkResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveIDPLinkResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_remove_idp_link_request.rb b/lib/zitadel/client/models/user_service_remove_idp_link_request.rb new file mode 100644 index 00000000..fe5d4eb6 --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_idp_link_request.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveIDPLinkRequest. + class UserServiceRemoveIDPLinkRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + idp_id: 'idpId', + linked_user_id: 'linkedUserId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + idp_id: 'String', + linked_user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :linked_user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_remove_idp_link_response.rb b/lib/zitadel/client/models/user_service_remove_idp_link_response.rb new file mode 100644 index 00000000..479717e5 --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_idp_link_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveIDPLinkResponse. + class UserServiceRemoveIDPLinkResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_remove_key_request.rb b/lib/zitadel/client/models/user_service_remove_key_request.rb index 5680a824..e46db698 100644 --- a/lib/zitadel/client/models/user_service_remove_key_request.rb +++ b/lib/zitadel/client/models/user_service_remove_key_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveKeyRequest - # The users resource ID. - attr_accessor :user_id - - # The keys ID. - attr_accessor :key_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'key_id' => :'keyId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'key_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - key_id == o.key_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, key_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveKeyRequest. + class UserServiceRemoveKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + key_id: 'keyId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + key_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The users resource ID. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # The keys ID. + # @example null + attribute :key_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_key_response.rb b/lib/zitadel/client/models/user_service_remove_key_response.rb index 9c09a15c..892178ef 100644 --- a/lib/zitadel/client/models/user_service_remove_key_response.rb +++ b/lib/zitadel/client/models/user_service_remove_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveKeyResponse. + class UserServiceRemoveKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_o_t_p_email_request.rb b/lib/zitadel/client/models/user_service_remove_o_t_p_email_request.rb deleted file mode 100644 index dd2755d9..00000000 --- a/lib/zitadel/client/models/user_service_remove_o_t_p_email_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveOTPEmailRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveOTPEmailRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveOTPEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_remove_o_t_p_email_response.rb b/lib/zitadel/client/models/user_service_remove_o_t_p_email_response.rb deleted file mode 100644 index 01a35f18..00000000 --- a/lib/zitadel/client/models/user_service_remove_o_t_p_email_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveOTPEmailResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveOTPEmailResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveOTPEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_remove_o_t_p_s_m_s_request.rb b/lib/zitadel/client/models/user_service_remove_o_t_p_s_m_s_request.rb deleted file mode 100644 index be2bb278..00000000 --- a/lib/zitadel/client/models/user_service_remove_o_t_p_s_m_s_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveOTPSMSRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveOTPSMSRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveOTPSMSRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_remove_o_t_p_s_m_s_response.rb b/lib/zitadel/client/models/user_service_remove_o_t_p_s_m_s_response.rb deleted file mode 100644 index bf6dbff9..00000000 --- a/lib/zitadel/client/models/user_service_remove_o_t_p_s_m_s_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveOTPSMSResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveOTPSMSResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveOTPSMSResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_remove_otp_email_request.rb b/lib/zitadel/client/models/user_service_remove_otp_email_request.rb new file mode 100644 index 00000000..ff5c405c --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_otp_email_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveOTPEmailRequest. + class UserServiceRemoveOTPEmailRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_remove_otp_email_response.rb b/lib/zitadel/client/models/user_service_remove_otp_email_response.rb new file mode 100644 index 00000000..38ded734 --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_otp_email_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveOTPEmailResponse. + class UserServiceRemoveOTPEmailResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_remove_otpsms_request.rb b/lib/zitadel/client/models/user_service_remove_otpsms_request.rb new file mode 100644 index 00000000..b9830b24 --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_otpsms_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveOTPSMSRequest. + class UserServiceRemoveOTPSMSRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_remove_otpsms_response.rb b/lib/zitadel/client/models/user_service_remove_otpsms_response.rb new file mode 100644 index 00000000..c3323f56 --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_otpsms_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveOTPSMSResponse. + class UserServiceRemoveOTPSMSResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_remove_passkey_request.rb b/lib/zitadel/client/models/user_service_remove_passkey_request.rb index 4feda901..abff5001 100644 --- a/lib/zitadel/client/models/user_service_remove_passkey_request.rb +++ b/lib/zitadel/client/models/user_service_remove_passkey_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemovePasskeyRequest - attr_accessor :user_id - - attr_accessor :passkey_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'passkey_id' => :'passkeyId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'passkey_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemovePasskeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemovePasskeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'passkey_id') - self.passkey_id = attributes[:'passkey_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - passkey_id == o.passkey_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, passkey_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemovePasskeyRequest. + class UserServiceRemovePasskeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + passkey_id: 'passkeyId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + passkey_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :passkey_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_passkey_response.rb b/lib/zitadel/client/models/user_service_remove_passkey_response.rb index a9043747..993293f1 100644 --- a/lib/zitadel/client/models/user_service_remove_passkey_response.rb +++ b/lib/zitadel/client/models/user_service_remove_passkey_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemovePasskeyResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemovePasskeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemovePasskeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemovePasskeyResponse. + class UserServiceRemovePasskeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_personal_access_token_request.rb b/lib/zitadel/client/models/user_service_remove_personal_access_token_request.rb index cba28360..249c0572 100644 --- a/lib/zitadel/client/models/user_service_remove_personal_access_token_request.rb +++ b/lib/zitadel/client/models/user_service_remove_personal_access_token_request.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemovePersonalAccessTokenRequest - # The users resource ID. - attr_accessor :user_id - - # The tokens ID. - attr_accessor :token_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'token_id' => :'tokenId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'token_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemovePersonalAccessTokenRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemovePersonalAccessTokenRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'token_id') - self.token_id = attributes[:'token_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - token_id == o.token_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, token_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemovePersonalAccessTokenRequest. + class UserServiceRemovePersonalAccessTokenRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + token_id: 'tokenId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + token_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The users resource ID. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # The tokens ID. + # @example null + attribute :token_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_personal_access_token_response.rb b/lib/zitadel/client/models/user_service_remove_personal_access_token_response.rb index b604f1b1..60b05c1a 100644 --- a/lib/zitadel/client/models/user_service_remove_personal_access_token_response.rb +++ b/lib/zitadel/client/models/user_service_remove_personal_access_token_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemovePersonalAccessTokenResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemovePersonalAccessTokenResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemovePersonalAccessTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemovePersonalAccessTokenResponse. + class UserServiceRemovePersonalAccessTokenResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_phone_request.rb b/lib/zitadel/client/models/user_service_remove_phone_request.rb index 9098222d..1d212930 100644 --- a/lib/zitadel/client/models/user_service_remove_phone_request.rb +++ b/lib/zitadel/client/models/user_service_remove_phone_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemovePhoneRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemovePhoneRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemovePhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemovePhoneRequest. + class UserServiceRemovePhoneRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_phone_response.rb b/lib/zitadel/client/models/user_service_remove_phone_response.rb index 6cea8e9a..ffa89ba5 100644 --- a/lib/zitadel/client/models/user_service_remove_phone_response.rb +++ b/lib/zitadel/client/models/user_service_remove_phone_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemovePhoneResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemovePhoneResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemovePhoneResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemovePhoneResponse. + class UserServiceRemovePhoneResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_recovery_codes_request.rb b/lib/zitadel/client/models/user_service_remove_recovery_codes_request.rb index b95c9162..837f252a 100644 --- a/lib/zitadel/client/models/user_service_remove_recovery_codes_request.rb +++ b/lib/zitadel/client/models/user_service_remove_recovery_codes_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveRecoveryCodesRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveRecoveryCodesRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveRecoveryCodesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveRecoveryCodesRequest. + class UserServiceRemoveRecoveryCodesRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_recovery_codes_response.rb b/lib/zitadel/client/models/user_service_remove_recovery_codes_response.rb index be3738eb..c03980e8 100644 --- a/lib/zitadel/client/models/user_service_remove_recovery_codes_response.rb +++ b/lib/zitadel/client/models/user_service_remove_recovery_codes_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveRecoveryCodesResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveRecoveryCodesResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveRecoveryCodesResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveRecoveryCodesResponse. + class UserServiceRemoveRecoveryCodesResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_secret_request.rb b/lib/zitadel/client/models/user_service_remove_secret_request.rb index ded4dc45..0169f4b1 100644 --- a/lib/zitadel/client/models/user_service_remove_secret_request.rb +++ b/lib/zitadel/client/models/user_service_remove_secret_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveSecretRequest - # The users resource ID. - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveSecretRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveSecretRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveSecretRequest. + class UserServiceRemoveSecretRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The users resource ID. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_secret_response.rb b/lib/zitadel/client/models/user_service_remove_secret_response.rb index 1b5f3d58..1dbb508a 100644 --- a/lib/zitadel/client/models/user_service_remove_secret_response.rb +++ b/lib/zitadel/client/models/user_service_remove_secret_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveSecretResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveSecretResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveSecretResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveSecretResponse. + class UserServiceRemoveSecretResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_t_o_t_p_request.rb b/lib/zitadel/client/models/user_service_remove_t_o_t_p_request.rb deleted file mode 100644 index 1adc348b..00000000 --- a/lib/zitadel/client/models/user_service_remove_t_o_t_p_request.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveTOTPRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveTOTPRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveTOTPRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_remove_t_o_t_p_response.rb b/lib/zitadel/client/models/user_service_remove_t_o_t_p_response.rb deleted file mode 100644 index 73fcd6f2..00000000 --- a/lib/zitadel/client/models/user_service_remove_t_o_t_p_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveTOTPResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveTOTPResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveTOTPResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_remove_totp_request.rb b/lib/zitadel/client/models/user_service_remove_totp_request.rb new file mode 100644 index 00000000..fd84326f --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_totp_request.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveTOTPRequest. + class UserServiceRemoveTOTPRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_remove_totp_response.rb b/lib/zitadel/client/models/user_service_remove_totp_response.rb new file mode 100644 index 00000000..2445a35a --- /dev/null +++ b/lib/zitadel/client/models/user_service_remove_totp_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveTOTPResponse. + class UserServiceRemoveTOTPResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_remove_u2_f_request.rb b/lib/zitadel/client/models/user_service_remove_u2_f_request.rb index 567d6085..82a34f0f 100644 --- a/lib/zitadel/client/models/user_service_remove_u2_f_request.rb +++ b/lib/zitadel/client/models/user_service_remove_u2_f_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveU2FRequest - attr_accessor :user_id - - attr_accessor :u2f_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'u2f_id' => :'u2fId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'u2f_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveU2FRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveU2FRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'u2f_id') - self.u2f_id = attributes[:'u2f_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - u2f_id == o.u2f_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, u2f_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveU2FRequest. + class UserServiceRemoveU2FRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + u2f_id: 'u2fId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + u2f_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :u2f_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_remove_u2_f_response.rb b/lib/zitadel/client/models/user_service_remove_u2_f_response.rb index 4f3e1ca5..348a8ee0 100644 --- a/lib/zitadel/client/models/user_service_remove_u2_f_response.rb +++ b/lib/zitadel/client/models/user_service_remove_u2_f_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRemoveU2FResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRemoveU2FResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRemoveU2FResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRemoveU2FResponse. + class UserServiceRemoveU2FResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_resend_email_code_request.rb b/lib/zitadel/client/models/user_service_resend_email_code_request.rb index e957f7e3..7027a014 100644 --- a/lib/zitadel/client/models/user_service_resend_email_code_request.rb +++ b/lib/zitadel/client/models/user_service_resend_email_code_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceResendEmailCodeRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_code' => :'UserServiceSendEmailVerificationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceResendEmailCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceResendEmailCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceResendEmailCodeRequest. + class UserServiceResendEmailCodeRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_code: 'UserServiceSendEmailVerificationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_resend_email_code_response.rb b/lib/zitadel/client/models/user_service_resend_email_code_response.rb index 6b14e6fb..d7497831 100644 --- a/lib/zitadel/client/models/user_service_resend_email_code_response.rb +++ b/lib/zitadel/client/models/user_service_resend_email_code_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceResendEmailCodeResponse - attr_accessor :details - - # in case the verification was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceResendEmailCodeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceResendEmailCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceResendEmailCodeResponse. + class UserServiceResendEmailCodeResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the verification was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_resend_invite_code_request.rb b/lib/zitadel/client/models/user_service_resend_invite_code_request.rb index c2c4659d..0f460b44 100644 --- a/lib/zitadel/client/models/user_service_resend_invite_code_request.rb +++ b/lib/zitadel/client/models/user_service_resend_invite_code_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceResendInviteCodeRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceResendInviteCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceResendInviteCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceResendInviteCodeRequest. + class UserServiceResendInviteCodeRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_resend_invite_code_response.rb b/lib/zitadel/client/models/user_service_resend_invite_code_response.rb index 26910fc7..f0d8b2ac 100644 --- a/lib/zitadel/client/models/user_service_resend_invite_code_response.rb +++ b/lib/zitadel/client/models/user_service_resend_invite_code_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceResendInviteCodeResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceResendInviteCodeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceResendInviteCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceResendInviteCodeResponse. + class UserServiceResendInviteCodeResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_resend_phone_code_request.rb b/lib/zitadel/client/models/user_service_resend_phone_code_request.rb index 716606d9..af50f579 100644 --- a/lib/zitadel/client/models/user_service_resend_phone_code_request.rb +++ b/lib/zitadel/client/models/user_service_resend_phone_code_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceResendPhoneCodeRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceResendPhoneCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceResendPhoneCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceResendPhoneCodeRequest. + class UserServiceResendPhoneCodeRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_code: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_resend_phone_code_response.rb b/lib/zitadel/client/models/user_service_resend_phone_code_response.rb index 3f4d150f..47a7c24b 100644 --- a/lib/zitadel/client/models/user_service_resend_phone_code_response.rb +++ b/lib/zitadel/client/models/user_service_resend_phone_code_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceResendPhoneCodeResponse - attr_accessor :details - - # in case the verification was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceResendPhoneCodeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceResendPhoneCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceResendPhoneCodeResponse. + class UserServiceResendPhoneCodeResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the verification was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rb b/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rb index 823e7c89..98554dd8 100644 --- a/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rb +++ b/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRetrieveIdentityProviderIntentRequest - attr_accessor :idp_intent_id - - attr_accessor :idp_intent_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_intent_id' => :'idpIntentId', - :'idp_intent_token' => :'idpIntentToken' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_intent_id' => :'String', - :'idp_intent_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRetrieveIdentityProviderIntentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRetrieveIdentityProviderIntentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_intent_id') - self.idp_intent_id = attributes[:'idp_intent_id'] - end - - if attributes.key?(:'idp_intent_token') - self.idp_intent_token = attributes[:'idp_intent_token'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_intent_id == o.idp_intent_id && - idp_intent_token == o.idp_intent_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_intent_id, idp_intent_token].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRetrieveIdentityProviderIntentRequest. + class UserServiceRetrieveIdentityProviderIntentRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_intent_id: 'idpIntentId', + idp_intent_token: 'idpIntentToken' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_intent_id: 'String', + idp_intent_token: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :idp_intent_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_intent_token, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rb b/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rb index d29d6d5f..15dab398 100644 --- a/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rb +++ b/lib/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceRetrieveIdentityProviderIntentResponse - attr_accessor :details - - attr_accessor :idp_information - - attr_accessor :user_id - - attr_accessor :add_human_user - - attr_accessor :update_human_user - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'idp_information' => :'idpInformation', - :'user_id' => :'userId', - :'add_human_user' => :'addHumanUser', - :'update_human_user' => :'updateHumanUser' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'idp_information' => :'UserServiceIDPInformation', - :'user_id' => :'String', - :'add_human_user' => :'UserServiceAddHumanUserRequest', - :'update_human_user' => :'UserServiceUpdateHumanUserRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceRetrieveIdentityProviderIntentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceRetrieveIdentityProviderIntentResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'idp_information') - self.idp_information = attributes[:'idp_information'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'add_human_user') - self.add_human_user = attributes[:'add_human_user'] - end - - if attributes.key?(:'update_human_user') - self.update_human_user = attributes[:'update_human_user'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - idp_information == o.idp_information && - user_id == o.user_id && - add_human_user == o.add_human_user && - update_human_user == o.update_human_user - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, idp_information, user_id, add_human_user, update_human_user].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceRetrieveIdentityProviderIntentResponse. + class UserServiceRetrieveIdentityProviderIntentResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + idp_information: 'idpInformation', + user_id: 'userId', + add_human_user: 'addHumanUser', + update_human_user: 'updateHumanUser' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + idp_information: 'UserServiceIDPInformation', + user_id: 'String', + add_human_user: 'UserServiceAddHumanUserRequest', + update_human_user: 'UserServiceUpdateHumanUserRequest' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_information, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :add_human_user, Types::Any.optional.meta(omittable: true) + # @example null + attribute :update_human_user, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_search_query.rb b/lib/zitadel/client/models/user_service_search_query.rb index f67ef2ac..5ae135ba 100644 --- a/lib/zitadel/client/models/user_service_search_query.rb +++ b/lib/zitadel/client/models/user_service_search_query.rb @@ -1,368 +1,141 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSearchQuery - attr_accessor :and_query - - attr_accessor :display_name_query - - attr_accessor :email_query - - attr_accessor :first_name_query - - attr_accessor :in_user_emails_query - - attr_accessor :in_user_ids_query - - attr_accessor :last_name_query - - attr_accessor :login_name_query - - attr_accessor :metadata_key_filter - - attr_accessor :metadata_value_filter - - attr_accessor :nick_name_query - - attr_accessor :not_query - - attr_accessor :or_query - - attr_accessor :organization_id_query - - attr_accessor :phone_query - - attr_accessor :state_query - - attr_accessor :type_query - - attr_accessor :user_name_query - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'and_query' => :'andQuery', - :'display_name_query' => :'displayNameQuery', - :'email_query' => :'emailQuery', - :'first_name_query' => :'firstNameQuery', - :'in_user_emails_query' => :'inUserEmailsQuery', - :'in_user_ids_query' => :'inUserIdsQuery', - :'last_name_query' => :'lastNameQuery', - :'login_name_query' => :'loginNameQuery', - :'metadata_key_filter' => :'metadataKeyFilter', - :'metadata_value_filter' => :'metadataValueFilter', - :'nick_name_query' => :'nickNameQuery', - :'not_query' => :'notQuery', - :'or_query' => :'orQuery', - :'organization_id_query' => :'organizationIdQuery', - :'phone_query' => :'phoneQuery', - :'state_query' => :'stateQuery', - :'type_query' => :'typeQuery', - :'user_name_query' => :'userNameQuery' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'and_query' => :'UserServiceAndQuery', - :'display_name_query' => :'UserServiceDisplayNameQuery', - :'email_query' => :'UserServiceEmailQuery', - :'first_name_query' => :'UserServiceFirstNameQuery', - :'in_user_emails_query' => :'UserServiceInUserEmailsQuery', - :'in_user_ids_query' => :'UserServiceInUserIDQuery', - :'last_name_query' => :'UserServiceLastNameQuery', - :'login_name_query' => :'UserServiceLoginNameQuery', - :'metadata_key_filter' => :'UserServiceMetadataKeyFilter', - :'metadata_value_filter' => :'UserServiceMetadataValueFilter', - :'nick_name_query' => :'UserServiceNickNameQuery', - :'not_query' => :'UserServiceNotQuery', - :'or_query' => :'UserServiceOrQuery', - :'organization_id_query' => :'UserServiceOrganizationIdQuery', - :'phone_query' => :'UserServicePhoneQuery', - :'state_query' => :'UserServiceStateQuery', - :'type_query' => :'UserServiceTypeQuery', - :'user_name_query' => :'UserServiceUserNameQuery' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSearchQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSearchQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'and_query') - self.and_query = attributes[:'and_query'] - end - - if attributes.key?(:'display_name_query') - self.display_name_query = attributes[:'display_name_query'] - end - - if attributes.key?(:'email_query') - self.email_query = attributes[:'email_query'] - end - - if attributes.key?(:'first_name_query') - self.first_name_query = attributes[:'first_name_query'] - end - - if attributes.key?(:'in_user_emails_query') - self.in_user_emails_query = attributes[:'in_user_emails_query'] - end - - if attributes.key?(:'in_user_ids_query') - self.in_user_ids_query = attributes[:'in_user_ids_query'] - end - - if attributes.key?(:'last_name_query') - self.last_name_query = attributes[:'last_name_query'] - end - - if attributes.key?(:'login_name_query') - self.login_name_query = attributes[:'login_name_query'] - end - - if attributes.key?(:'metadata_key_filter') - self.metadata_key_filter = attributes[:'metadata_key_filter'] - end - - if attributes.key?(:'metadata_value_filter') - self.metadata_value_filter = attributes[:'metadata_value_filter'] - end - - if attributes.key?(:'nick_name_query') - self.nick_name_query = attributes[:'nick_name_query'] - end - - if attributes.key?(:'not_query') - self.not_query = attributes[:'not_query'] - end - - if attributes.key?(:'or_query') - self.or_query = attributes[:'or_query'] - end - - if attributes.key?(:'organization_id_query') - self.organization_id_query = attributes[:'organization_id_query'] - end - - if attributes.key?(:'phone_query') - self.phone_query = attributes[:'phone_query'] - end - - if attributes.key?(:'state_query') - self.state_query = attributes[:'state_query'] - end - - if attributes.key?(:'type_query') - self.type_query = attributes[:'type_query'] - end - - if attributes.key?(:'user_name_query') - self.user_name_query = attributes[:'user_name_query'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - and_query == o.and_query && - display_name_query == o.display_name_query && - email_query == o.email_query && - first_name_query == o.first_name_query && - in_user_emails_query == o.in_user_emails_query && - in_user_ids_query == o.in_user_ids_query && - last_name_query == o.last_name_query && - login_name_query == o.login_name_query && - metadata_key_filter == o.metadata_key_filter && - metadata_value_filter == o.metadata_value_filter && - nick_name_query == o.nick_name_query && - not_query == o.not_query && - or_query == o.or_query && - organization_id_query == o.organization_id_query && - phone_query == o.phone_query && - state_query == o.state_query && - type_query == o.type_query && - user_name_query == o.user_name_query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [and_query, display_name_query, email_query, first_name_query, in_user_emails_query, in_user_ids_query, last_name_query, login_name_query, metadata_key_filter, metadata_value_filter, nick_name_query, not_query, or_query, organization_id_query, phone_query, state_query, type_query, user_name_query].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - hash end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSearchQuery. + class UserServiceSearchQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + and_query: 'andQuery', + display_name_query: 'displayNameQuery', + email_query: 'emailQuery', + first_name_query: 'firstNameQuery', + in_user_emails_query: 'inUserEmailsQuery', + in_user_ids_query: 'inUserIdsQuery', + last_name_query: 'lastNameQuery', + login_name_query: 'loginNameQuery', + metadata_key_filter: 'metadataKeyFilter', + metadata_value_filter: 'metadataValueFilter', + nick_name_query: 'nickNameQuery', + not_query: 'notQuery', + or_query: 'orQuery', + organization_id_query: 'organizationIdQuery', + phone_query: 'phoneQuery', + state_query: 'stateQuery', + type_query: 'typeQuery', + user_name_query: 'userNameQuery' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + and_query: 'UserServiceAndQuery', + display_name_query: 'UserServiceDisplayNameQuery', + email_query: 'UserServiceEmailQuery', + first_name_query: 'UserServiceFirstNameQuery', + in_user_emails_query: 'UserServiceInUserEmailsQuery', + in_user_ids_query: 'UserServiceInUserIDQuery', + last_name_query: 'UserServiceLastNameQuery', + login_name_query: 'UserServiceLoginNameQuery', + metadata_key_filter: 'UserServiceMetadataKeyFilter', + metadata_value_filter: 'UserServiceMetadataValueFilter', + nick_name_query: 'UserServiceNickNameQuery', + not_query: 'UserServiceNotQuery', + or_query: 'UserServiceOrQuery', + organization_id_query: 'UserServiceOrganizationIdQuery', + phone_query: 'UserServicePhoneQuery', + state_query: 'UserServiceStateQuery', + type_query: 'UserServiceTypeQuery', + user_name_query: 'UserServiceUserNameQuery' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :and_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :first_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_user_emails_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :in_user_ids_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :last_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_key_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :metadata_value_filter, Types::Any.optional.meta(omittable: true) + # @example null + attribute :nick_name_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :not_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :or_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :organization_id_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :type_query, Types::Any.optional.meta(omittable: true) + # @example null + attribute :user_name_query, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_send_email_code_request.rb b/lib/zitadel/client/models/user_service_send_email_code_request.rb index 6a3ac57b..975db797 100644 --- a/lib/zitadel/client/models/user_service_send_email_code_request.rb +++ b/lib/zitadel/client/models/user_service_send_email_code_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSendEmailCodeRequest - attr_accessor :user_id - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'return_code' => :'Object', - :'send_code' => :'UserServiceSendEmailVerificationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendEmailCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendEmailCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSendEmailCodeRequest. + class UserServiceSendEmailCodeRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + return_code: 'Object', + send_code: 'UserServiceSendEmailVerificationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_send_email_code_response.rb b/lib/zitadel/client/models/user_service_send_email_code_response.rb index 1e5f80c9..7c84f86a 100644 --- a/lib/zitadel/client/models/user_service_send_email_code_response.rb +++ b/lib/zitadel/client/models/user_service_send_email_code_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSendEmailCodeResponse - attr_accessor :details - - # in case the verification was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendEmailCodeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendEmailCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSendEmailCodeResponse. + class UserServiceSendEmailCodeResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the verification was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_send_email_verification_code.rb b/lib/zitadel/client/models/user_service_send_email_verification_code.rb index 09861165..a5a080be 100644 --- a/lib/zitadel/client/models/user_service_send_email_verification_code.rb +++ b/lib/zitadel/client/models/user_service_send_email_verification_code.rb @@ -1,217 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSendEmailVerificationCode - # Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code - attr_accessor :url_template - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendEmailVerificationCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendEmailVerificationCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSendEmailVerificationCode. + class UserServiceSendEmailVerificationCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_send_invite_code.rb b/lib/zitadel/client/models/user_service_send_invite_code.rb index 0a411524..e3f3776c 100644 --- a/lib/zitadel/client/models/user_service_send_invite_code.rb +++ b/lib/zitadel/client/models/user_service_send_invite_code.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSendInviteCode - # Optionally set a url_template, which will be used in the invite mail sent by ZITADEL to guide the user to your invitation page. If no template is set and no previous code was created, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code - attr_accessor :url_template - - # Optionally set an application name, which will be used in the invite mail sent by ZITADEL. If no application name is set and no previous code was created, ZITADEL will be used as default. - attr_accessor :application_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate', - :'application_name' => :'applicationName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String', - :'application_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template', - :'application_name' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendInviteCode` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendInviteCode`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - - if attributes.key?(:'application_name') - self.application_name = attributes[:'application_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template && - application_name == o.application_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template, application_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSendInviteCode. + class UserServiceSendInviteCode < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url_template: 'urlTemplate', + application_name: 'applicationName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url_template: 'String', + application_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Optionally set a url_template, which will be used in the invite mail sent by ZITADEL to guide the user to your invitation page. If no template is set and no previous code was created, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) + # Optionally set an application name, which will be used in the invite mail sent by ZITADEL. If no application name is set and no previous code was created, ZITADEL will be used as default. + # @example null + attribute :application_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_send_passkey_registration_link.rb b/lib/zitadel/client/models/user_service_send_passkey_registration_link.rb index 0af1c5c6..43f33503 100644 --- a/lib/zitadel/client/models/user_service_send_passkey_registration_link.rb +++ b/lib/zitadel/client/models/user_service_send_passkey_registration_link.rb @@ -1,217 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSendPasskeyRegistrationLink - # Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your passkey registration page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, CodeID, Code - attr_accessor :url_template - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendPasskeyRegistrationLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendPasskeyRegistrationLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSendPasskeyRegistrationLink. + class UserServiceSendPasskeyRegistrationLink < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your passkey registration page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, CodeID, Code + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_send_password_reset_link.rb b/lib/zitadel/client/models/user_service_send_password_reset_link.rb index a2ccdbf0..9ab115f2 100644 --- a/lib/zitadel/client/models/user_service_send_password_reset_link.rb +++ b/lib/zitadel/client/models/user_service_send_password_reset_link.rb @@ -1,248 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSendPasswordResetLink - attr_accessor :notification_type - - # Optionally set a url_template, which will be used in the password reset mail sent by ZITADEL to guide the user to your password change page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code - attr_accessor :url_template - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'notification_type' => :'notificationType', - :'url_template' => :'urlTemplate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'notification_type' => :'UserServiceNotificationType', - :'url_template' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url_template' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSendPasswordResetLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSendPasswordResetLink`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'notification_type') - self.notification_type = attributes[:'notification_type'] - end - - if attributes.key?(:'url_template') - self.url_template = attributes[:'url_template'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - notification_type == o.notification_type && - url_template == o.url_template - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [notification_type, url_template].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSendPasswordResetLink. + class UserServiceSendPasswordResetLink < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + notification_type: 'notificationType', + url_template: 'urlTemplate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + notification_type: 'UserServiceNotificationType', + url_template: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :notification_type, Types::Any.optional.meta(omittable: true) + # Optionally set a url_template, which will be used in the password reset mail sent by ZITADEL to guide the user to your password change page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code + # @example null + attribute :url_template, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_email_request.rb b/lib/zitadel/client/models/user_service_set_email_request.rb index 305a1d5c..0b2cde42 100644 --- a/lib/zitadel/client/models/user_service_set_email_request.rb +++ b/lib/zitadel/client/models/user_service_set_email_request.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetEmailRequest - attr_accessor :user_id - - attr_accessor :email - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'email' => :'email', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'email' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'UserServiceSendEmailVerificationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetEmailRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - email == o.email && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, email, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetEmailRequest. + class UserServiceSetEmailRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + email: 'email', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + email: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'UserServiceSendEmailVerificationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_email_response.rb b/lib/zitadel/client/models/user_service_set_email_response.rb index b9a3de50..9b88bdee 100644 --- a/lib/zitadel/client/models/user_service_set_email_response.rb +++ b/lib/zitadel/client/models/user_service_set_email_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetEmailResponse - attr_accessor :details - - # in case the verification was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetEmailResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetEmailResponse. + class UserServiceSetEmailResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the verification was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_set_human_email.rb b/lib/zitadel/client/models/user_service_set_human_email.rb index 799393d5..4f562b13 100644 --- a/lib/zitadel/client/models/user_service_set_human_email.rb +++ b/lib/zitadel/client/models/user_service_set_human_email.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetHumanEmail - attr_accessor :email - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'UserServiceSendEmailVerificationCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetHumanEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetHumanEmail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetHumanEmail. + class UserServiceSetHumanEmail < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + email: 'email', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + email: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'UserServiceSendEmailVerificationCode' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_human_phone.rb b/lib/zitadel/client/models/user_service_set_human_phone.rb index 610d61be..90690ea7 100644 --- a/lib/zitadel/client/models/user_service_set_human_phone.rb +++ b/lib/zitadel/client/models/user_service_set_human_phone.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetHumanPhone - attr_accessor :phone - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone' => :'phone', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetHumanPhone` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetHumanPhone`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone == o.phone && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetHumanPhone. + class UserServiceSetHumanPhone < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + phone: 'phone', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + phone: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_human_profile.rb b/lib/zitadel/client/models/user_service_set_human_profile.rb index afaee96b..120c5d92 100644 --- a/lib/zitadel/client/models/user_service_set_human_profile.rb +++ b/lib/zitadel/client/models/user_service_set_human_profile.rb @@ -1,285 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetHumanProfile - attr_accessor :given_name - - attr_accessor :family_name - - attr_accessor :nick_name - - attr_accessor :display_name - - attr_accessor :preferred_language - - attr_accessor :gender - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'givenName', - :'family_name' => :'familyName', - :'nick_name' => :'nickName', - :'display_name' => :'displayName', - :'preferred_language' => :'preferredLanguage', - :'gender' => :'gender' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'nick_name' => :'String', - :'display_name' => :'String', - :'preferred_language' => :'String', - :'gender' => :'UserServiceGender' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'nick_name', - :'display_name', - :'preferred_language', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetHumanProfile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetHumanProfile`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'nick_name') - self.nick_name = attributes[:'nick_name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'preferred_language') - self.preferred_language = attributes[:'preferred_language'] - end - - if attributes.key?(:'gender') - self.gender = attributes[:'gender'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - nick_name == o.nick_name && - display_name == o.display_name && - preferred_language == o.preferred_language && - gender == o.gender - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, nick_name, display_name, preferred_language, gender].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetHumanProfile. + class UserServiceSetHumanProfile < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + given_name: 'givenName', + family_name: 'familyName', + nick_name: 'nickName', + display_name: 'displayName', + preferred_language: 'preferredLanguage', + gender: 'gender' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + given_name: 'String', + family_name: 'String', + nick_name: 'String', + display_name: 'String', + preferred_language: 'String', + gender: 'UserServiceGender' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :given_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :family_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :nick_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :display_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_language, Types::Any.optional.meta(omittable: true) + # @example null + attribute :gender, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_metadata_entry.rb b/lib/zitadel/client/models/user_service_set_metadata_entry.rb index 11451eff..b1f14e05 100644 --- a/lib/zitadel/client/models/user_service_set_metadata_entry.rb +++ b/lib/zitadel/client/models/user_service_set_metadata_entry.rb @@ -1,224 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetMetadataEntry - attr_accessor :key - - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'value' => :'value' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetMetadataEntry` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetMetadataEntry`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, value].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetMetadataEntry. + class UserServiceSetMetadataEntry < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + key: 'key', + value: 'value' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + key: 'String', + value: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + value: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :key, Types::Any.optional.meta(omittable: true) + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_set_password.rb b/lib/zitadel/client/models/user_service_set_password.rb index 6a46f849..85595715 100644 --- a/lib/zitadel/client/models/user_service_set_password.rb +++ b/lib/zitadel/client/models/user_service_set_password.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetPassword - attr_accessor :hashed_password - - attr_accessor :password - - attr_accessor :current_password - - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'hashed_password' => :'hashedPassword', - :'password' => :'password', - :'current_password' => :'currentPassword', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'hashed_password' => :'UserServiceHashedPassword', - :'password' => :'UserServicePassword', - :'current_password' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetPassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetPassword`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'hashed_password') - self.hashed_password = attributes[:'hashed_password'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - - if attributes.key?(:'current_password') - self.current_password = attributes[:'current_password'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - hashed_password == o.hashed_password && - password == o.password && - current_password == o.current_password && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [hashed_password, password, current_password, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetPassword. + class UserServiceSetPassword < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + hashed_password: 'hashedPassword', + password: 'password', + current_password: 'currentPassword', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + hashed_password: 'UserServiceHashedPassword', + password: 'UserServicePassword', + current_password: 'String', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :hashed_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :current_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_password_request.rb b/lib/zitadel/client/models/user_service_set_password_request.rb index 09aca412..fa9e1ec1 100644 --- a/lib/zitadel/client/models/user_service_set_password_request.rb +++ b/lib/zitadel/client/models/user_service_set_password_request.rb @@ -1,242 +1,85 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetPasswordRequest - attr_accessor :user_id - - attr_accessor :new_password - - attr_accessor :current_password - - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'new_password' => :'newPassword', - :'current_password' => :'currentPassword', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'new_password' => :'UserServicePassword', - :'current_password' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetPasswordRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetPasswordRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'new_password') - self.new_password = attributes[:'new_password'] - end - - if attributes.key?(:'current_password') - self.current_password = attributes[:'current_password'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - new_password == o.new_password && - current_password == o.current_password && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, new_password, current_password, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetPasswordRequest. + class UserServiceSetPasswordRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + new_password: 'newPassword', + current_password: 'currentPassword', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + new_password: 'UserServicePassword', + current_password: 'String', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :new_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :current_password, Types::Any.optional.meta(omittable: true) + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_password_response.rb b/lib/zitadel/client/models/user_service_set_password_response.rb index 21783b19..df5d8969 100644 --- a/lib/zitadel/client/models/user_service_set_password_response.rb +++ b/lib/zitadel/client/models/user_service_set_password_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetPasswordResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetPasswordResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetPasswordResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetPasswordResponse. + class UserServiceSetPasswordResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_set_phone_request.rb b/lib/zitadel/client/models/user_service_set_phone_request.rb index 269f7bea..780e202c 100644 --- a/lib/zitadel/client/models/user_service_set_phone_request.rb +++ b/lib/zitadel/client/models/user_service_set_phone_request.rb @@ -1,251 +1,89 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetPhoneRequest - attr_accessor :user_id - - attr_accessor :phone - - attr_accessor :is_verified - - attr_accessor :return_code - - attr_accessor :send_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'phone' => :'phone', - :'is_verified' => :'isVerified', - :'return_code' => :'returnCode', - :'send_code' => :'sendCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'phone' => :'String', - :'is_verified' => :'Boolean', - :'return_code' => :'Object', - :'send_code' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetPhoneRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetPhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'is_verified') - self.is_verified = attributes[:'is_verified'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'send_code') - self.send_code = attributes[:'send_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - phone == o.phone && - is_verified == o.is_verified && - return_code == o.return_code && - send_code == o.send_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, phone, is_verified, return_code, send_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetPhoneRequest. + class UserServiceSetPhoneRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + phone: 'phone', + is_verified: 'isVerified', + return_code: 'returnCode', + send_code: 'sendCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + phone: 'String', + is_verified: 'Boolean', + return_code: 'Object', + send_code: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :is_verified, Types::Any.optional.meta(omittable: true) + # @example null + attribute :return_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :send_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_set_phone_response.rb b/lib/zitadel/client/models/user_service_set_phone_response.rb index 511afd23..b7e9a1be 100644 --- a/lib/zitadel/client/models/user_service_set_phone_response.rb +++ b/lib/zitadel/client/models/user_service_set_phone_response.rb @@ -1,226 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetPhoneResponse - attr_accessor :details - - # in case the verification was set to return_code, the code will be returned - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'verification_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetPhoneResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetPhoneResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetPhoneResponse. + class UserServiceSetPhoneResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # in case the verification was set to return_code, the code will be returned + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_set_user_metadata_request.rb b/lib/zitadel/client/models/user_service_set_user_metadata_request.rb index ef5fe90b..612ebaa6 100644 --- a/lib/zitadel/client/models/user_service_set_user_metadata_request.rb +++ b/lib/zitadel/client/models/user_service_set_user_metadata_request.rb @@ -1,228 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetUserMetadataRequest - # ID of the user under which the metadata gets set. - attr_accessor :user_id - - # Metadata to bet set. The values have to be base64 encoded. - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'metadata' => :'metadata' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'metadata' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetUserMetadataRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetUserMetadataRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Array) - self.metadata = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, metadata].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetUserMetadataRequest. + class UserServiceSetUserMetadataRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + metadata: 'metadata' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + metadata: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # ID of the user under which the metadata gets set. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # Metadata to bet set. The values have to be base64 encoded. + # @example null + attribute :metadata, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_set_user_metadata_response.rb b/lib/zitadel/client/models/user_service_set_user_metadata_response.rb index a267a44a..e74ba094 100644 --- a/lib/zitadel/client/models/user_service_set_user_metadata_response.rb +++ b/lib/zitadel/client/models/user_service_set_user_metadata_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceSetUserMetadataResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :set_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'set_date' => :'setDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'set_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceSetUserMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceSetUserMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'set_date') - self.set_date = attributes[:'set_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - set_date == o.set_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [set_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceSetUserMetadataResponse. + class UserServiceSetUserMetadataResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + set_date: 'setDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + set_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :set_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_start_identity_provider_intent_request.rb b/lib/zitadel/client/models/user_service_start_identity_provider_intent_request.rb index 14349f09..db9a5879 100644 --- a/lib/zitadel/client/models/user_service_start_identity_provider_intent_request.rb +++ b/lib/zitadel/client/models/user_service_start_identity_provider_intent_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceStartIdentityProviderIntentRequest - attr_accessor :idp_id - - attr_accessor :ldap - - attr_accessor :urls - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'idp_id' => :'idpId', - :'ldap' => :'ldap', - :'urls' => :'urls' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'idp_id' => :'String', - :'ldap' => :'UserServiceLDAPCredentials', - :'urls' => :'UserServiceRedirectURLs' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceStartIdentityProviderIntentRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceStartIdentityProviderIntentRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'idp_id') - self.idp_id = attributes[:'idp_id'] - end - - if attributes.key?(:'ldap') - self.ldap = attributes[:'ldap'] - end - - if attributes.key?(:'urls') - self.urls = attributes[:'urls'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - idp_id == o.idp_id && - ldap == o.ldap && - urls == o.urls - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [idp_id, ldap, urls].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceStartIdentityProviderIntentRequest. + class UserServiceStartIdentityProviderIntentRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + idp_id: 'idpId', + ldap: 'ldap', + urls: 'urls' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + idp_id: 'String', + ldap: 'UserServiceLDAPCredentials', + urls: 'UserServiceRedirectURLs' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :idp_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ldap, Types::Any.optional.meta(omittable: true) + # @example null + attribute :urls, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_start_identity_provider_intent_response.rb b/lib/zitadel/client/models/user_service_start_identity_provider_intent_response.rb index de4dd2e4..1666a452 100644 --- a/lib/zitadel/client/models/user_service_start_identity_provider_intent_response.rb +++ b/lib/zitadel/client/models/user_service_start_identity_provider_intent_response.rb @@ -1,252 +1,92 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceStartIdentityProviderIntentResponse - attr_accessor :details - - attr_accessor :auth_url - - attr_accessor :form_data - - attr_accessor :idp_intent - - # POST call information Deprecated: Use form_data instead - attr_accessor :post_form - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'auth_url' => :'authUrl', - :'form_data' => :'formData', - :'idp_intent' => :'idpIntent', - :'post_form' => :'postForm' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'auth_url' => :'String', - :'form_data' => :'UserServiceFormData', - :'idp_intent' => :'UserServiceIDPIntent', - :'post_form' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceStartIdentityProviderIntentResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceStartIdentityProviderIntentResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'auth_url') - self.auth_url = attributes[:'auth_url'] - end - - if attributes.key?(:'form_data') - self.form_data = attributes[:'form_data'] - end - - if attributes.key?(:'idp_intent') - self.idp_intent = attributes[:'idp_intent'] - end - - if attributes.key?(:'post_form') - self.post_form = attributes[:'post_form'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - auth_url == o.auth_url && - form_data == o.form_data && - idp_intent == o.idp_intent && - post_form == o.post_form - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, auth_url, form_data, idp_intent, post_form].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceStartIdentityProviderIntentResponse. + class UserServiceStartIdentityProviderIntentResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + auth_url: 'authUrl', + form_data: 'formData', + idp_intent: 'idpIntent', + post_form: 'postForm' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + auth_url: 'String', + form_data: 'UserServiceFormData', + idp_intent: 'UserServiceIDPIntent', + post_form: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + post_form: 'byte', + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :auth_url, Types::Any.optional.meta(omittable: true) + # @example null + attribute :form_data, Types::Any.optional.meta(omittable: true) + # @example null + attribute :idp_intent, Types::Any.optional.meta(omittable: true) + # POST call information Deprecated: Use form_data instead + # @example null + attribute :post_form, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_state_query.rb b/lib/zitadel/client/models/user_service_state_query.rb index d2b26633..a7a769cf 100644 --- a/lib/zitadel/client/models/user_service_state_query.rb +++ b/lib/zitadel/client/models/user_service_state_query.rb @@ -1,238 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific state. - class UserServiceStateQuery - attr_accessor :state - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'state' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'UserServiceUserState' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceStateQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceStateQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific state. + class UserServiceStateQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + state: 'state' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + state: 'UserServiceUserState' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_text_filter_method.rb b/lib/zitadel/client/models/user_service_text_filter_method.rb index 4176025f..89c350ba 100644 --- a/lib/zitadel/client/models/user_service_text_filter_method.rb +++ b/lib/zitadel/client/models/user_service_text_filter_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class UserServiceTextFilterMethod - TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS".freeze - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH".freeze - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS".freeze - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH".freeze - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceTextFilterMethod. + class UserServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' + TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' + TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_FILTER_METHOD_EQUALS, TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE, TEXT_FILTER_METHOD_STARTS_WITH, TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_FILTER_METHOD_CONTAINS, TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE, TEXT_FILTER_METHOD_ENDS_WITH, TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceTextFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceTextFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceTextFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_text_query_method.rb b/lib/zitadel/client/models/user_service_text_query_method.rb index 15d8cf04..f2cbd0db 100644 --- a/lib/zitadel/client/models/user_service_text_query_method.rb +++ b/lib/zitadel/client/models/user_service_text_query_method.rb @@ -1,47 +1,67 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class UserServiceTextQueryMethod - TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS".freeze - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH".freeze - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS".freeze - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE".freeze - TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH".freeze - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE".freeze - - def self.all_vars - @all_vars ||= [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceTextQueryMethod. + class UserServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' + TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' + TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' + TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceTextQueryMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceTextQueryMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceTextQueryMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_timestamp_filter.rb b/lib/zitadel/client/models/user_service_timestamp_filter.rb index 246827df..1194c20d 100644 --- a/lib/zitadel/client/models/user_service_timestamp_filter.rb +++ b/lib/zitadel/client/models/user_service_timestamp_filter.rb @@ -1,247 +1,78 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceTimestampFilter - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :timestamp - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'timestamp' => :'timestamp', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'timestamp' => :'Time', - :'method' => :'UserServiceTimestampFilterMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceTimestampFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceTimestampFilter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - timestamp == o.timestamp && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [timestamp, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceTimestampFilter. + class UserServiceTimestampFilter < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + timestamp: 'timestamp', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + timestamp: 'Time', + method: 'UserServiceTimestampFilterMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :timestamp, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_timestamp_filter_method.rb b/lib/zitadel/client/models/user_service_timestamp_filter_method.rb index 4d089489..e41f6e49 100644 --- a/lib/zitadel/client/models/user_service_timestamp_filter_method.rb +++ b/lib/zitadel/client/models/user_service_timestamp_filter_method.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class UserServiceTimestampFilterMethod - TIMESTAMP_FILTER_METHOD_EQUALS = "TIMESTAMP_FILTER_METHOD_EQUALS".freeze - TIMESTAMP_FILTER_METHOD_AFTER = "TIMESTAMP_FILTER_METHOD_AFTER".freeze - TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS".freeze - TIMESTAMP_FILTER_METHOD_BEFORE = "TIMESTAMP_FILTER_METHOD_BEFORE".freeze - TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceTimestampFilterMethod. + class UserServiceTimestampFilterMethod + TIMESTAMP_FILTER_METHOD_EQUALS = 'TIMESTAMP_FILTER_METHOD_EQUALS' + TIMESTAMP_FILTER_METHOD_AFTER = 'TIMESTAMP_FILTER_METHOD_AFTER' + TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS' + TIMESTAMP_FILTER_METHOD_BEFORE = 'TIMESTAMP_FILTER_METHOD_BEFORE' + TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS' - def self.all_vars - @all_vars ||= [TIMESTAMP_FILTER_METHOD_EQUALS, TIMESTAMP_FILTER_METHOD_AFTER, TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS, TIMESTAMP_FILTER_METHOD_BEFORE, TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [TIMESTAMP_FILTER_METHOD_EQUALS, TIMESTAMP_FILTER_METHOD_AFTER, TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS, TIMESTAMP_FILTER_METHOD_BEFORE, TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceTimestampFilterMethod.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceTimestampFilterMethod" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceTimestampFilterMethod: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_type.rb b/lib/zitadel/client/models/user_service_type.rb index 19f2973d..7d544fd1 100644 --- a/lib/zitadel/client/models/user_service_type.rb +++ b/lib/zitadel/client/models/user_service_type.rb @@ -1,42 +1,62 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end -module Zitadel::Client::Models - class UserServiceType - TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED".freeze - TYPE_HUMAN = "TYPE_HUMAN".freeze - TYPE_MACHINE = "TYPE_MACHINE".freeze - - def self.all_vars - @all_vars ||= [TYPE_UNSPECIFIED, TYPE_HUMAN, TYPE_MACHINE].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceType.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceType" +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceType. + class UserServiceType + TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED' + TYPE_HUMAN = 'TYPE_HUMAN' + TYPE_MACHINE = 'TYPE_MACHINE' + + # Frozen set of all allowed values, used for validation. + VALUES = [TYPE_UNSPECIFIED, TYPE_HUMAN, TYPE_MACHINE].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceType: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_type_query.rb b/lib/zitadel/client/models/user_service_type_query.rb index 57a48e9d..d01b982e 100644 --- a/lib/zitadel/client/models/user_service_type_query.rb +++ b/lib/zitadel/client/models/user_service_type_query.rb @@ -1,238 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific type. - class UserServiceTypeQuery - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'UserServiceType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceTypeQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceTypeQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific type. + class UserServiceTypeQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'UserServiceType' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_unlock_user_request.rb b/lib/zitadel/client/models/user_service_unlock_user_request.rb index 8f0ad38b..f73594b3 100644 --- a/lib/zitadel/client/models/user_service_unlock_user_request.rb +++ b/lib/zitadel/client/models/user_service_unlock_user_request.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceUnlockUserRequest - attr_accessor :user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUnlockUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUnlockUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceUnlockUserRequest. + class UserServiceUnlockUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_unlock_user_response.rb b/lib/zitadel/client/models/user_service_unlock_user_response.rb index 9f0e5151..63456fd5 100644 --- a/lib/zitadel/client/models/user_service_unlock_user_response.rb +++ b/lib/zitadel/client/models/user_service_unlock_user_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceUnlockUserResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUnlockUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUnlockUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceUnlockUserResponse. + class UserServiceUnlockUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_update_human_user_request.rb b/lib/zitadel/client/models/user_service_update_human_user_request.rb index 9425bde8..598d04c8 100644 --- a/lib/zitadel/client/models/user_service_update_human_user_request.rb +++ b/lib/zitadel/client/models/user_service_update_human_user_request.rb @@ -1,261 +1,93 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceUpdateHumanUserRequest - attr_accessor :user_id - - attr_accessor :username - - attr_accessor :profile - - attr_accessor :email - - attr_accessor :phone - - attr_accessor :password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'username' => :'username', - :'profile' => :'profile', - :'email' => :'email', - :'phone' => :'phone', - :'password' => :'password' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'username' => :'String', - :'profile' => :'UserServiceSetHumanProfile', - :'email' => :'UserServiceSetHumanEmail', - :'phone' => :'UserServiceSetHumanPhone', - :'password' => :'UserServiceSetPassword' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'username', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUpdateHumanUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUpdateHumanUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'profile') - self.profile = attributes[:'profile'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'password') - self.password = attributes[:'password'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - username == o.username && - profile == o.profile && - email == o.email && - phone == o.phone && - password == o.password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, username, profile, email, phone, password].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceUpdateHumanUserRequest. + class UserServiceUpdateHumanUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + username: 'username', + profile: 'profile', + email: 'email', + phone: 'phone', + password: 'password' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + username: 'String', + profile: 'UserServiceSetHumanProfile', + email: 'UserServiceSetHumanEmail', + phone: 'UserServiceSetHumanPhone', + password: 'UserServiceSetPassword' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :profile, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone, Types::Any.optional.meta(omittable: true) + # @example null + attribute :password, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_update_human_user_response.rb b/lib/zitadel/client/models/user_service_update_human_user_response.rb index 7198014b..c5e1f535 100644 --- a/lib/zitadel/client/models/user_service_update_human_user_response.rb +++ b/lib/zitadel/client/models/user_service_update_human_user_response.rb @@ -1,235 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceUpdateHumanUserResponse - attr_accessor :details - - attr_accessor :email_code - - attr_accessor :phone_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details', - :'email_code' => :'emailCode', - :'phone_code' => :'phoneCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails', - :'email_code' => :'String', - :'phone_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_code', - :'phone_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUpdateHumanUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUpdateHumanUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'email_code') - self.email_code = attributes[:'email_code'] - end - - if attributes.key?(:'phone_code') - self.phone_code = attributes[:'phone_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - email_code == o.email_code && - phone_code == o.phone_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, email_code, phone_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceUpdateHumanUserResponse. + class UserServiceUpdateHumanUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details', + email_code: 'emailCode', + phone_code: 'phoneCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails', + email_code: 'String', + phone_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :email_code, Types::Any.optional.meta(omittable: true) + # @example null + attribute :phone_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_update_user_request.rb b/lib/zitadel/client/models/user_service_update_user_request.rb index 521936ab..7294cf81 100644 --- a/lib/zitadel/client/models/user_service_update_user_request.rb +++ b/lib/zitadel/client/models/user_service_update_user_request.rb @@ -1,245 +1,87 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceUpdateUserRequest - # The user id is the users unique identifier in the instance. It can't be changed. - attr_accessor :user_id - - # Set a new username that is unique within the instance. Beware that active tokens and sessions are invalidated when the username is changed. - attr_accessor :username - - attr_accessor :human - - attr_accessor :machine - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'username' => :'username', - :'human' => :'human', - :'machine' => :'machine' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'username' => :'String', - :'human' => :'UserServiceHuman', - :'machine' => :'UserServiceMachine' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'username', - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUpdateUserRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUpdateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'human') - self.human = attributes[:'human'] - end - - if attributes.key?(:'machine') - self.machine = attributes[:'machine'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - username == o.username && - human == o.human && - machine == o.machine - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, username, human, machine].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceUpdateUserRequest. + class UserServiceUpdateUserRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + username: 'username', + human: 'human', + machine: 'machine' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + username: 'String', + human: 'UserServiceHuman', + machine: 'UserServiceMachine' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The user id is the users unique identifier in the instance. It can't be changed. + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # Set a new username that is unique within the instance. Beware that active tokens and sessions are invalidated when the username is changed. + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :human, Types::Any.optional.meta(omittable: true) + # @example null + attribute :machine, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_update_user_response.rb b/lib/zitadel/client/models/user_service_update_user_response.rb index 9aa96f4c..c8738275 100644 --- a/lib/zitadel/client/models/user_service_update_user_response.rb +++ b/lib/zitadel/client/models/user_service_update_user_response.rb @@ -1,238 +1,84 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceUpdateUserResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # In case the email verification was set to return_code, the code will be returned - attr_accessor :email_code - - # In case the phone verification was set to return_code, the code will be returned - attr_accessor :phone_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate', - :'email_code' => :'emailCode', - :'phone_code' => :'phoneCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time', - :'email_code' => :'String', - :'phone_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_code', - :'phone_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUpdateUserResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUpdateUserResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'email_code') - self.email_code = attributes[:'email_code'] - end - - if attributes.key?(:'phone_code') - self.phone_code = attributes[:'phone_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date && - email_code == o.email_code && - phone_code == o.phone_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date, email_code, phone_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceUpdateUserResponse. + class UserServiceUpdateUserResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate', + email_code: 'emailCode', + phone_code: 'phoneCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time', + email_code: 'String', + phone_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # In case the email verification was set to return_code, the code will be returned + # @example null + attribute :email_code, Types::Any.optional.meta(omittable: true) + # In case the phone verification was set to return_code, the code will be returned + # @example null + attribute :phone_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_user.rb b/lib/zitadel/client/models/user_service_user.rb index 419384d5..18160dde 100644 --- a/lib/zitadel/client/models/user_service_user.rb +++ b/lib/zitadel/client/models/user_service_user.rb @@ -1,302 +1,101 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceUser - attr_accessor :user_id - - attr_accessor :details - - attr_accessor :state - - attr_accessor :username - - attr_accessor :login_names - - attr_accessor :preferred_login_name - - attr_accessor :human - - attr_accessor :machine - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'details' => :'details', - :'state' => :'state', - :'username' => :'username', - :'login_names' => :'loginNames', - :'preferred_login_name' => :'preferredLoginName', - :'human' => :'human', - :'machine' => :'machine' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'details' => :'UserServiceDetails', - :'state' => :'UserServiceUserState', - :'username' => :'String', - :'login_names' => :'Array', - :'preferred_login_name' => :'String', - :'human' => :'UserServiceHumanUser', - :'machine' => :'UserServiceMachineUser' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'username') - self.username = attributes[:'username'] - end - - if attributes.key?(:'login_names') - if (value = attributes[:'login_names']).is_a?(Array) - self.login_names = value - end - end - - if attributes.key?(:'preferred_login_name') - self.preferred_login_name = attributes[:'preferred_login_name'] - end - - if attributes.key?(:'human') - self.human = attributes[:'human'] - end - - if attributes.key?(:'machine') - self.machine = attributes[:'machine'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - details == o.details && - state == o.state && - username == o.username && - login_names == o.login_names && - preferred_login_name == o.preferred_login_name && - human == o.human && - machine == o.machine - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, details, state, username, login_names, preferred_login_name, human, machine].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceUser. + class UserServiceUser < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + details: 'details', + state: 'state', + username: 'username', + login_names: 'loginNames', + preferred_login_name: 'preferredLoginName', + human: 'human', + machine: 'machine' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + details: 'UserServiceDetails', + state: 'UserServiceUserState', + username: 'String', + login_names: 'Array', + preferred_login_name: 'String', + human: 'UserServiceHumanUser', + machine: 'UserServiceMachineUser' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :username, Types::Any.optional.meta(omittable: true) + # @example null + attribute :login_names, Types::Any.optional.meta(omittable: true) + # @example null + attribute :preferred_login_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :human, Types::Any.optional.meta(omittable: true) + # @example null + attribute :machine, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_user_field_name.rb b/lib/zitadel/client/models/user_service_user_field_name.rb index c6d414ac..ddd18649 100644 --- a/lib/zitadel/client/models/user_service_user_field_name.rb +++ b/lib/zitadel/client/models/user_service_user_field_name.rb @@ -1,49 +1,69 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class UserServiceUserFieldName - USER_FIELD_NAME_UNSPECIFIED = "USER_FIELD_NAME_UNSPECIFIED".freeze - USER_FIELD_NAME_USER_NAME = "USER_FIELD_NAME_USER_NAME".freeze - USER_FIELD_NAME_FIRST_NAME = "USER_FIELD_NAME_FIRST_NAME".freeze - USER_FIELD_NAME_LAST_NAME = "USER_FIELD_NAME_LAST_NAME".freeze - USER_FIELD_NAME_NICK_NAME = "USER_FIELD_NAME_NICK_NAME".freeze - USER_FIELD_NAME_DISPLAY_NAME = "USER_FIELD_NAME_DISPLAY_NAME".freeze - USER_FIELD_NAME_EMAIL = "USER_FIELD_NAME_EMAIL".freeze - USER_FIELD_NAME_STATE = "USER_FIELD_NAME_STATE".freeze - USER_FIELD_NAME_TYPE = "USER_FIELD_NAME_TYPE".freeze - USER_FIELD_NAME_CREATION_DATE = "USER_FIELD_NAME_CREATION_DATE".freeze - - def self.all_vars - @all_vars ||= [USER_FIELD_NAME_UNSPECIFIED, USER_FIELD_NAME_USER_NAME, USER_FIELD_NAME_FIRST_NAME, USER_FIELD_NAME_LAST_NAME, USER_FIELD_NAME_NICK_NAME, USER_FIELD_NAME_DISPLAY_NAME, USER_FIELD_NAME_EMAIL, USER_FIELD_NAME_STATE, USER_FIELD_NAME_TYPE, USER_FIELD_NAME_CREATION_DATE].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceUserFieldName. + class UserServiceUserFieldName + USER_FIELD_NAME_UNSPECIFIED = 'USER_FIELD_NAME_UNSPECIFIED' + USER_FIELD_NAME_USER_NAME = 'USER_FIELD_NAME_USER_NAME' + USER_FIELD_NAME_FIRST_NAME = 'USER_FIELD_NAME_FIRST_NAME' + USER_FIELD_NAME_LAST_NAME = 'USER_FIELD_NAME_LAST_NAME' + USER_FIELD_NAME_NICK_NAME = 'USER_FIELD_NAME_NICK_NAME' + USER_FIELD_NAME_DISPLAY_NAME = 'USER_FIELD_NAME_DISPLAY_NAME' + USER_FIELD_NAME_EMAIL = 'USER_FIELD_NAME_EMAIL' + USER_FIELD_NAME_STATE = 'USER_FIELD_NAME_STATE' + USER_FIELD_NAME_TYPE = 'USER_FIELD_NAME_TYPE' + USER_FIELD_NAME_CREATION_DATE = 'USER_FIELD_NAME_CREATION_DATE' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [USER_FIELD_NAME_UNSPECIFIED, USER_FIELD_NAME_USER_NAME, USER_FIELD_NAME_FIRST_NAME, USER_FIELD_NAME_LAST_NAME, USER_FIELD_NAME_NICK_NAME, USER_FIELD_NAME_DISPLAY_NAME, USER_FIELD_NAME_EMAIL, USER_FIELD_NAME_STATE, USER_FIELD_NAME_TYPE, USER_FIELD_NAME_CREATION_DATE].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceUserFieldName.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceUserFieldName" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceUserFieldName: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_user_name_query.rb b/lib/zitadel/client/models/user_service_user_name_query.rb index 735dab5a..10f68921 100644 --- a/lib/zitadel/client/models/user_service_user_name_query.rb +++ b/lib/zitadel/client/models/user_service_user_name_query.rb @@ -1,247 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Query for users with a specific user name. - class UserServiceUserNameQuery - attr_accessor :user_name - - attr_accessor :method - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_name' => :'userName', - :'method' => :'method' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_name' => :'String', - :'method' => :'UserServiceTextQueryMethod' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceUserNameQuery` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceUserNameQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_name') - self.user_name = attributes[:'user_name'] - end - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_name == o.user_name && - method == o.method - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_name, method].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Query for users with a specific user name. + class UserServiceUserNameQuery < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_name: 'userName', + method: 'method' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_name: 'String', + method: 'UserServiceTextQueryMethod' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_name, Types::Any.optional.meta(omittable: true) + # @example null + attribute :method, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_user_state.rb b/lib/zitadel/client/models/user_service_user_state.rb index 54d24c5f..708de43d 100644 --- a/lib/zitadel/client/models/user_service_user_state.rb +++ b/lib/zitadel/client/models/user_service_user_state.rb @@ -1,45 +1,65 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class UserServiceUserState - USER_STATE_UNSPECIFIED = "USER_STATE_UNSPECIFIED".freeze - USER_STATE_ACTIVE = "USER_STATE_ACTIVE".freeze - USER_STATE_INACTIVE = "USER_STATE_INACTIVE".freeze - USER_STATE_DELETED = "USER_STATE_DELETED".freeze - USER_STATE_LOCKED = "USER_STATE_LOCKED".freeze - USER_STATE_INITIAL = "USER_STATE_INITIAL".freeze - - def self.all_vars - @all_vars ||= [USER_STATE_UNSPECIFIED, USER_STATE_ACTIVE, USER_STATE_INACTIVE, USER_STATE_DELETED, USER_STATE_LOCKED, USER_STATE_INITIAL].freeze - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for UserServiceUserState. + class UserServiceUserState + USER_STATE_UNSPECIFIED = 'USER_STATE_UNSPECIFIED' + USER_STATE_ACTIVE = 'USER_STATE_ACTIVE' + USER_STATE_INACTIVE = 'USER_STATE_INACTIVE' + USER_STATE_DELETED = 'USER_STATE_DELETED' + USER_STATE_LOCKED = 'USER_STATE_LOCKED' + USER_STATE_INITIAL = 'USER_STATE_INITIAL' - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + # Frozen set of all allowed values, used for validation. + VALUES = [USER_STATE_UNSPECIFIED, USER_STATE_ACTIVE, USER_STATE_INACTIVE, USER_STATE_DELETED, USER_STATE_LOCKED, USER_STATE_INITIAL].freeze + + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if UserServiceUserState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::UserServiceUserState" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for UserServiceUserState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/user_service_verify_email_request.rb b/lib/zitadel/client/models/user_service_verify_email_request.rb index b2e9b3b4..55f977c6 100644 --- a/lib/zitadel/client/models/user_service_verify_email_request.rb +++ b/lib/zitadel/client/models/user_service_verify_email_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyEmailRequest - attr_accessor :user_id - - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyEmailRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyEmailRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyEmailRequest. + class UserServiceVerifyEmailRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_verify_email_response.rb b/lib/zitadel/client/models/user_service_verify_email_response.rb index 01950b78..85bc099b 100644 --- a/lib/zitadel/client/models/user_service_verify_email_response.rb +++ b/lib/zitadel/client/models/user_service_verify_email_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyEmailResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyEmailResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyEmailResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyEmailResponse. + class UserServiceVerifyEmailResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_verify_invite_code_request.rb b/lib/zitadel/client/models/user_service_verify_invite_code_request.rb index e8cc2ff3..859d177c 100644 --- a/lib/zitadel/client/models/user_service_verify_invite_code_request.rb +++ b/lib/zitadel/client/models/user_service_verify_invite_code_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyInviteCodeRequest - attr_accessor :user_id - - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyInviteCodeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyInviteCodeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyInviteCodeRequest. + class UserServiceVerifyInviteCodeRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_verify_invite_code_response.rb b/lib/zitadel/client/models/user_service_verify_invite_code_response.rb index bc5b7bf0..376196c4 100644 --- a/lib/zitadel/client/models/user_service_verify_invite_code_response.rb +++ b/lib/zitadel/client/models/user_service_verify_invite_code_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyInviteCodeResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyInviteCodeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyInviteCodeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyInviteCodeResponse. + class UserServiceVerifyInviteCodeResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_verify_passkey_registration_request.rb b/lib/zitadel/client/models/user_service_verify_passkey_registration_request.rb index a3bf2915..6dec1695 100644 --- a/lib/zitadel/client/models/user_service_verify_passkey_registration_request.rb +++ b/lib/zitadel/client/models/user_service_verify_passkey_registration_request.rb @@ -1,245 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyPasskeyRegistrationRequest - attr_accessor :user_id - - attr_accessor :passkey_id - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :public_key_credential - - attr_accessor :passkey_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'passkey_id' => :'passkeyId', - :'public_key_credential' => :'publicKeyCredential', - :'passkey_name' => :'passkeyName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'passkey_id' => :'String', - :'public_key_credential' => :'Hash', - :'passkey_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyPasskeyRegistrationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyPasskeyRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'passkey_id') - self.passkey_id = attributes[:'passkey_id'] - end - - if attributes.key?(:'public_key_credential') - if (value = attributes[:'public_key_credential']).is_a?(Hash) - self.public_key_credential = value - end - end - - if attributes.key?(:'passkey_name') - self.passkey_name = attributes[:'passkey_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - passkey_id == o.passkey_id && - public_key_credential == o.public_key_credential && - passkey_name == o.passkey_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, passkey_id, public_key_credential, passkey_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyPasskeyRegistrationRequest. + class UserServiceVerifyPasskeyRegistrationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + passkey_id: 'passkeyId', + public_key_credential: 'publicKeyCredential', + passkey_name: 'passkeyName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + passkey_id: 'String', + public_key_credential: 'Hash', + passkey_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :passkey_id, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :public_key_credential, Types::Any.optional.meta(omittable: true) + # @example null + attribute :passkey_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_verify_passkey_registration_response.rb b/lib/zitadel/client/models/user_service_verify_passkey_registration_response.rb index cf922be3..95830782 100644 --- a/lib/zitadel/client/models/user_service_verify_passkey_registration_response.rb +++ b/lib/zitadel/client/models/user_service_verify_passkey_registration_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyPasskeyRegistrationResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyPasskeyRegistrationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyPasskeyRegistrationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyPasskeyRegistrationResponse. + class UserServiceVerifyPasskeyRegistrationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_verify_phone_request.rb b/lib/zitadel/client/models/user_service_verify_phone_request.rb index 31e9b37b..cd769c0e 100644 --- a/lib/zitadel/client/models/user_service_verify_phone_request.rb +++ b/lib/zitadel/client/models/user_service_verify_phone_request.rb @@ -1,224 +1,77 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyPhoneRequest - attr_accessor :user_id - - attr_accessor :verification_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'verification_code' => :'verificationCode' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'verification_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyPhoneRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyPhoneRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'verification_code') - self.verification_code = attributes[:'verification_code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - verification_code == o.verification_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, verification_code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyPhoneRequest. + class UserServiceVerifyPhoneRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + verification_code: 'verificationCode' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + verification_code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :verification_code, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_verify_phone_response.rb b/lib/zitadel/client/models/user_service_verify_phone_response.rb index 2828c279..21251ff2 100644 --- a/lib/zitadel/client/models/user_service_verify_phone_response.rb +++ b/lib/zitadel/client/models/user_service_verify_phone_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyPhoneResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyPhoneResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyPhoneResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyPhoneResponse. + class UserServiceVerifyPhoneResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_request.rb b/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_request.rb deleted file mode 100644 index bb4f4219..00000000 --- a/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_request.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyTOTPRegistrationRequest - attr_accessor :user_id - - attr_accessor :code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'code' => :'code' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyTOTPRegistrationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyTOTPRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - code == o.code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, code].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_response.rb b/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_response.rb deleted file mode 100644 index a3a5f5cd..00000000 --- a/lib/zitadel/client/models/user_service_verify_t_o_t_p_registration_response.rb +++ /dev/null @@ -1,215 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyTOTPRegistrationResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyTOTPRegistrationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyTOTPRegistrationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/user_service_verify_totp_registration_request.rb b/lib/zitadel/client/models/user_service_verify_totp_registration_request.rb new file mode 100644 index 00000000..dca3a8c2 --- /dev/null +++ b/lib/zitadel/client/models/user_service_verify_totp_registration_request.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyTOTPRegistrationRequest. + class UserServiceVerifyTOTPRegistrationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + code: 'code' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + code: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :code, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_verify_totp_registration_response.rb b/lib/zitadel/client/models/user_service_verify_totp_registration_response.rb new file mode 100644 index 00000000..0a9404cb --- /dev/null +++ b/lib/zitadel/client/models/user_service_verify_totp_registration_response.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyTOTPRegistrationResponse. + class UserServiceVerifyTOTPRegistrationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/user_service_verify_u2_f_registration_request.rb b/lib/zitadel/client/models/user_service_verify_u2_f_registration_request.rb index 97e43fb0..62db0be7 100644 --- a/lib/zitadel/client/models/user_service_verify_u2_f_registration_request.rb +++ b/lib/zitadel/client/models/user_service_verify_u2_f_registration_request.rb @@ -1,245 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyU2FRegistrationRequest - attr_accessor :user_id - - attr_accessor :u2f_id - - # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. - attr_accessor :public_key_credential - - attr_accessor :token_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'userId', - :'u2f_id' => :'u2fId', - :'public_key_credential' => :'publicKeyCredential', - :'token_name' => :'tokenName' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'u2f_id' => :'String', - :'public_key_credential' => :'Hash', - :'token_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyU2FRegistrationRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyU2FRegistrationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'u2f_id') - self.u2f_id = attributes[:'u2f_id'] - end - - if attributes.key?(:'public_key_credential') - if (value = attributes[:'public_key_credential']).is_a?(Hash) - self.public_key_credential = value - end - end - - if attributes.key?(:'token_name') - self.token_name = attributes[:'token_name'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - u2f_id == o.u2f_id && - public_key_credential == o.public_key_credential && - token_name == o.token_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, u2f_id, public_key_credential, token_name].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyU2FRegistrationRequest. + class UserServiceVerifyU2FRegistrationRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + user_id: 'userId', + u2f_id: 'u2fId', + public_key_credential: 'publicKeyCredential', + token_name: 'tokenName' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + user_id: 'String', + u2f_id: 'String', + public_key_credential: 'Hash', + token_name: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :user_id, Types::Any.optional.meta(omittable: true) + # @example null + attribute :u2f_id, Types::Any.optional.meta(omittable: true) + # `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object. + # @example null + attribute :public_key_credential, Types::Any.optional.meta(omittable: true) + # @example null + attribute :token_name, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/user_service_verify_u2_f_registration_response.rb b/lib/zitadel/client/models/user_service_verify_u2_f_registration_response.rb index f3349fea..2d21b0cf 100644 --- a/lib/zitadel/client/models/user_service_verify_u2_f_registration_response.rb +++ b/lib/zitadel/client/models/user_service_verify_u2_f_registration_response.rb @@ -1,215 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class UserServiceVerifyU2FRegistrationResponse - attr_accessor :details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'UserServiceDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::UserServiceVerifyU2FRegistrationResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::UserServiceVerifyU2FRegistrationResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for UserServiceVerifyU2FRegistrationResponse. + class UserServiceVerifyU2FRegistrationResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + details: 'UserServiceDetails' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/web_key_service_activate_web_key_request.rb b/lib/zitadel/client/models/web_key_service_activate_web_key_request.rb index 7461f989..4a2a85be 100644 --- a/lib/zitadel/client/models/web_key_service_activate_web_key_request.rb +++ b/lib/zitadel/client/models/web_key_service_activate_web_key_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class WebKeyServiceActivateWebKeyRequest - # The unique identifier of the key to activate. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceActivateWebKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceActivateWebKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceActivateWebKeyRequest. + class WebKeyServiceActivateWebKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the key to activate. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/web_key_service_activate_web_key_response.rb b/lib/zitadel/client/models/web_key_service_activate_web_key_response.rb index 171bc3c4..50badb69 100644 --- a/lib/zitadel/client/models/web_key_service_activate_web_key_response.rb +++ b/lib/zitadel/client/models/web_key_service_activate_web_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class WebKeyServiceActivateWebKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'change_date' => :'changeDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'change_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceActivateWebKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceActivateWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - change_date == o.change_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [change_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceActivateWebKeyResponse. + class WebKeyServiceActivateWebKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + change_date: 'changeDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + change_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/web_key_service_any.rb b/lib/zitadel/client/models/web_key_service_any.rb index 54632854..50f87c70 100644 --- a/lib/zitadel/client/models/web_key_service_any.rb +++ b/lib/zitadel/client/models/web_key_service_any.rb @@ -1,238 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - class WebKeyServiceAny - # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. - attr_accessor :type - - # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. - attr_accessor :value - - # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. - attr_accessor :debug - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'value' => :'value', - :'debug' => :'debug' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'value' => :'File', - :'debug' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'debug' - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceAny` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceAny`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'debug') - self.debug = attributes[:'debug'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - value == o.value && - debug == o.debug - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, value, debug].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. + class WebKeyServiceAny < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + type: 'type', + value: 'value', + debug: 'debug' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + type: 'String', + value: 'File', + debug: 'Object' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field. + # @example null + attribute :type, Types::Any.optional.meta(omittable: true) + # The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field. + # @example null + attribute :value, Types::Any.optional.meta(omittable: true) + # Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic. + # @example null + attribute :debug, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/web_key_service_connect_error.rb b/lib/zitadel/client/models/web_key_service_connect_error.rb index 105cfd26..386a2dcd 100644 --- a/lib/zitadel/client/models/web_key_service_connect_error.rb +++ b/lib/zitadel/client/models/web_key_service_connect_error.rb @@ -1,271 +1,86 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - class WebKeyServiceConnectError - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - attr_accessor :code - - # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - attr_accessor :message - - # A list of messages that carry the error details. There is no limit on the number of messages. - attr_accessor :details - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'message' => :'message', - :'details' => :'details' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'message' => :'String', - :'details' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceConnectError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceConnectError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'details') - if (value = attributes[:'details']).is_a?(Array) - self.details = value - end - end - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] code Object to be assigned - def code=(code) - validator = EnumAttributeValidator.new('String', ["canceled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal", "unavailable", "data_loss", "unauthenticated"]) - unless validator.valid?(code) - fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." - end - @code = code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - message == o.message && - details == o.details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, message, details].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation + class WebKeyServiceConnectError < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + code: 'code', + message: 'message', + details: 'details' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + code: 'String', + message: 'String', + details: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # Whether this model accepts additional properties not defined in the schema. + ADDITIONAL_PROPERTIES = true + # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # @example null + attribute :code, Types::String.enum('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated').optional.meta(omittable: true) + # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + # @example null + attribute :message, Types::Any.optional.meta(omittable: true) + # A list of messages that carry the error details. There is no limit on the number of messages. + # @example null + attribute :details, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/web_key_service_create_web_key_request.rb b/lib/zitadel/client/models/web_key_service_create_web_key_request.rb index ba4ab0ba..0cc64942 100644 --- a/lib/zitadel/client/models/web_key_service_create_web_key_request.rb +++ b/lib/zitadel/client/models/web_key_service_create_web_key_request.rb @@ -1,233 +1,81 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class WebKeyServiceCreateWebKeyRequest - attr_accessor :ecdsa - - attr_accessor :ed25519 - - attr_accessor :rsa - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ecdsa' => :'ecdsa', - :'ed25519' => :'ed25519', - :'rsa' => :'rsa' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ecdsa' => :'WebKeyServiceECDSA', - :'ed25519' => :'Object', - :'rsa' => :'WebKeyServiceRSA' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceCreateWebKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceCreateWebKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ecdsa') - self.ecdsa = attributes[:'ecdsa'] - end - - if attributes.key?(:'ed25519') - self.ed25519 = attributes[:'ed25519'] - end - - if attributes.key?(:'rsa') - self.rsa = attributes[:'rsa'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ecdsa == o.ecdsa && - ed25519 == o.ed25519 && - rsa == o.rsa - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ecdsa, ed25519, rsa].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end - new(transformed_hash) # `new` will call the initialize method of the specific model class. end -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceCreateWebKeyRequest. + class WebKeyServiceCreateWebKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + ecdsa: 'ecdsa', + ed25519: 'ed25519', + rsa: 'rsa' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + ecdsa: 'WebKeyServiceECDSA', + ed25519: 'Object', + rsa: 'WebKeyServiceRSA' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :ecdsa, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ed25519, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rsa, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/models/web_key_service_create_web_key_response.rb b/lib/zitadel/client/models/web_key_service_create_web_key_response.rb index 9c71389c..b82bb965 100644 --- a/lib/zitadel/client/models/web_key_service_create_web_key_response.rb +++ b/lib/zitadel/client/models/web_key_service_create_web_key_response.rb @@ -1,226 +1,79 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class WebKeyServiceCreateWebKeyResponse - # The unique identifier of the newly created key. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceCreateWebKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceCreateWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceCreateWebKeyResponse. + class WebKeyServiceCreateWebKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the newly created key. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/web_key_service_delete_web_key_request.rb b/lib/zitadel/client/models/web_key_service_delete_web_key_request.rb index 87a19df1..f994dd43 100644 --- a/lib/zitadel/client/models/web_key_service_delete_web_key_request.rb +++ b/lib/zitadel/client/models/web_key_service_delete_web_key_request.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class WebKeyServiceDeleteWebKeyRequest - # The unique identifier of the key to delete. - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceDeleteWebKeyRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceDeleteWebKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceDeleteWebKeyRequest. + class WebKeyServiceDeleteWebKeyRequest < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the key to delete. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/web_key_service_delete_web_key_response.rb b/lib/zitadel/client/models/web_key_service_delete_web_key_response.rb index ec7cc8be..450ad816 100644 --- a/lib/zitadel/client/models/web_key_service_delete_web_key_response.rb +++ b/lib/zitadel/client/models/web_key_service_delete_web_key_response.rb @@ -1,216 +1,74 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class WebKeyServiceDeleteWebKeyResponse - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :deletion_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deletion_date' => :'deletionDate' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deletion_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceDeleteWebKeyResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceDeleteWebKeyResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deletion_date') - self.deletion_date = attributes[:'deletion_date'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deletion_date == o.deletion_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deletion_date].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceDeleteWebKeyResponse. + class WebKeyServiceDeleteWebKeyResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + deletion_date: 'deletionDate' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + deletion_date: 'Time' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :deletion_date, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/web_key_service_e_c_d_s_a.rb b/lib/zitadel/client/models/web_key_service_e_c_d_s_a.rb deleted file mode 100644 index a1c9cbdf..00000000 --- a/lib/zitadel/client/models/web_key_service_e_c_d_s_a.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class WebKeyServiceECDSA - attr_accessor :curve - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'curve' => :'curve' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'curve' => :'WebKeyServiceECDSACurve' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceECDSA` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceECDSA`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'curve') - self.curve = attributes[:'curve'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - curve == o.curve - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [curve].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/web_key_service_e_c_d_s_a_curve.rb b/lib/zitadel/client/models/web_key_service_e_c_d_s_a_curve.rb deleted file mode 100644 index 8d8d3a63..00000000 --- a/lib/zitadel/client/models/web_key_service_e_c_d_s_a_curve.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class WebKeyServiceECDSACurve - ECDSA_CURVE_UNSPECIFIED = "ECDSA_CURVE_UNSPECIFIED".freeze - ECDSA_CURVE_P256 = "ECDSA_CURVE_P256".freeze - ECDSA_CURVE_P384 = "ECDSA_CURVE_P384".freeze - ECDSA_CURVE_P512 = "ECDSA_CURVE_P512".freeze - - def self.all_vars - @all_vars ||= [ECDSA_CURVE_UNSPECIFIED, ECDSA_CURVE_P256, ECDSA_CURVE_P384, ECDSA_CURVE_P512].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if WebKeyServiceECDSACurve.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceECDSACurve" - end - end - -end diff --git a/lib/zitadel/client/models/web_key_service_ecdsa.rb b/lib/zitadel/client/models/web_key_service_ecdsa.rb new file mode 100644 index 00000000..bc9060ba --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_ecdsa.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceECDSA. + class WebKeyServiceECDSA < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + curve: 'curve' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + curve: 'WebKeyServiceECDSACurve' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :curve, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/web_key_service_ecdsa_curve.rb b/lib/zitadel/client/models/web_key_service_ecdsa_curve.rb new file mode 100644 index 00000000..5df105b4 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_ecdsa_curve.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for WebKeyServiceECDSACurve. + class WebKeyServiceECDSACurve + ECDSA_CURVE_UNSPECIFIED = 'ECDSA_CURVE_UNSPECIFIED' + ECDSA_CURVE_P256 = 'ECDSA_CURVE_P256' + ECDSA_CURVE_P384 = 'ECDSA_CURVE_P384' + ECDSA_CURVE_P512 = 'ECDSA_CURVE_P512' + + # Frozen set of all allowed values, used for validation. + VALUES = [ECDSA_CURVE_UNSPECIFIED, ECDSA_CURVE_P256, ECDSA_CURVE_P384, ECDSA_CURVE_P512].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for WebKeyServiceECDSACurve: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/web_key_service_list_web_keys_response.rb b/lib/zitadel/client/models/web_key_service_list_web_keys_response.rb index 73352252..3bc2706f 100644 --- a/lib/zitadel/client/models/web_key_service_list_web_keys_response.rb +++ b/lib/zitadel/client/models/web_key_service_list_web_keys_response.rb @@ -1,217 +1,73 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class WebKeyServiceListWebKeysResponse - attr_accessor :web_keys - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'web_keys' => :'webKeys' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'web_keys' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceListWebKeysResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceListWebKeysResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'web_keys') - if (value = attributes[:'web_keys']).is_a?(Array) - self.web_keys = value - end - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - web_keys == o.web_keys - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [web_keys].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceListWebKeysResponse. + class WebKeyServiceListWebKeysResponse < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + web_keys: 'webKeys' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + web_keys: 'Array' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # @example null + attribute :web_keys, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - end - end diff --git a/lib/zitadel/client/models/web_key_service_r_s_a.rb b/lib/zitadel/client/models/web_key_service_r_s_a.rb deleted file mode 100644 index 21d28415..00000000 --- a/lib/zitadel/client/models/web_key_service_r_s_a.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class WebKeyServiceRSA - attr_accessor :bits - - attr_accessor :hasher - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bits' => :'bits', - :'hasher' => :'hasher' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bits' => :'WebKeyServiceRSABits', - :'hasher' => :'WebKeyServiceRSAHasher' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceRSA` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceRSA`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bits') - self.bits = attributes[:'bits'] - end - - if attributes.key?(:'hasher') - self.hasher = attributes[:'hasher'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bits == o.bits && - hasher == o.hasher - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bits, hasher].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end - end -end - -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash -end - -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end -end - - end - -end diff --git a/lib/zitadel/client/models/web_key_service_r_s_a_bits.rb b/lib/zitadel/client/models/web_key_service_r_s_a_bits.rb deleted file mode 100644 index 17d13bec..00000000 --- a/lib/zitadel/client/models/web_key_service_r_s_a_bits.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class WebKeyServiceRSABits - RSA_BITS_UNSPECIFIED = "RSA_BITS_UNSPECIFIED".freeze - RSA_BITS_2048 = "RSA_BITS_2048".freeze - RSA_BITS_3072 = "RSA_BITS_3072".freeze - RSA_BITS_4096 = "RSA_BITS_4096".freeze - - def self.all_vars - @all_vars ||= [RSA_BITS_UNSPECIFIED, RSA_BITS_2048, RSA_BITS_3072, RSA_BITS_4096].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if WebKeyServiceRSABits.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceRSABits" - end - end - -end diff --git a/lib/zitadel/client/models/web_key_service_r_s_a_hasher.rb b/lib/zitadel/client/models/web_key_service_r_s_a_hasher.rb deleted file mode 100644 index dc591264..00000000 --- a/lib/zitadel/client/models/web_key_service_r_s_a_hasher.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#Zitadel SDK - -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end - -require 'date' -require 'time' - -module Zitadel::Client::Models - class WebKeyServiceRSAHasher - RSA_HASHER_UNSPECIFIED = "RSA_HASHER_UNSPECIFIED".freeze - RSA_HASHER_SHA256 = "RSA_HASHER_SHA256".freeze - RSA_HASHER_SHA384 = "RSA_HASHER_SHA384".freeze - RSA_HASHER_SHA512 = "RSA_HASHER_SHA512".freeze - - def self.all_vars - @all_vars ||= [RSA_HASHER_UNSPECIFIED, RSA_HASHER_SHA256, RSA_HASHER_SHA384, RSA_HASHER_SHA512].freeze - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if WebKeyServiceRSAHasher.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceRSAHasher" - end - end - -end diff --git a/lib/zitadel/client/models/web_key_service_rsa.rb b/lib/zitadel/client/models/web_key_service_rsa.rb new file mode 100644 index 00000000..1a603dde --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_rsa.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceRSA. + class WebKeyServiceRSA < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + bits: 'bits', + hasher: 'hasher' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + bits: 'WebKeyServiceRSABits', + hasher: 'WebKeyServiceRSAHasher' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze + + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end + + # @example null + attribute :bits, Types::Any.optional.meta(omittable: true) + # @example null + attribute :hasher, Types::Any.optional.meta(omittable: true) + end + end +end diff --git a/lib/zitadel/client/models/web_key_service_rsa_bits.rb b/lib/zitadel/client/models/web_key_service_rsa_bits.rb new file mode 100644 index 00000000..5f6815d8 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_rsa_bits.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for WebKeyServiceRSABits. + class WebKeyServiceRSABits + RSA_BITS_UNSPECIFIED = 'RSA_BITS_UNSPECIFIED' + RSA_BITS_2048 = 'RSA_BITS_2048' + RSA_BITS_3072 = 'RSA_BITS_3072' + RSA_BITS_4096 = 'RSA_BITS_4096' + + # Frozen set of all allowed values, used for validation. + VALUES = [RSA_BITS_UNSPECIFIED, RSA_BITS_2048, RSA_BITS_3072, RSA_BITS_4096].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for WebKeyServiceRSABits: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/web_key_service_rsa_hasher.rb b/lib/zitadel/client/models/web_key_service_rsa_hasher.rb new file mode 100644 index 00000000..d6fe5e51 --- /dev/null +++ b/lib/zitadel/client/models/web_key_service_rsa_hasher.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v + end +end + +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for WebKeyServiceRSAHasher. + class WebKeyServiceRSAHasher + RSA_HASHER_UNSPECIFIED = 'RSA_HASHER_UNSPECIFIED' + RSA_HASHER_SHA256 = 'RSA_HASHER_SHA256' + RSA_HASHER_SHA384 = 'RSA_HASHER_SHA384' + RSA_HASHER_SHA512 = 'RSA_HASHER_SHA512' + + # Frozen set of all allowed values, used for validation. + VALUES = [RSA_HASHER_UNSPECIFIED, RSA_HASHER_SHA256, RSA_HASHER_SHA384, RSA_HASHER_SHA512].freeze + + def self.all_vars + VALUES + end + + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for WebKeyServiceRSAHasher: #{value.inspect} (allowed: #{VALUES.inspect})" + end + end + end +end diff --git a/lib/zitadel/client/models/web_key_service_state.rb b/lib/zitadel/client/models/web_key_service_state.rb index c225c8cb..fb4bc739 100644 --- a/lib/zitadel/client/models/web_key_service_state.rb +++ b/lib/zitadel/client/models/web_key_service_state.rb @@ -1,44 +1,64 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -The version of the OpenAPI document: 1.0.0 +require 'date' +require 'iso8601' +require 'time' +require 'tod' +require 'dry-struct' -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder -=end + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? -require 'date' -require 'time' + v + end +end -module Zitadel::Client::Models - class WebKeyServiceState - STATE_UNSPECIFIED = "STATE_UNSPECIFIED".freeze - STATE_INITIAL = "STATE_INITIAL".freeze - STATE_ACTIVE = "STATE_ACTIVE".freeze - STATE_INACTIVE = "STATE_INACTIVE".freeze - STATE_REMOVED = "STATE_REMOVED".freeze +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Enumeration of allowed values for WebKeyServiceState. + class WebKeyServiceState + STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' + STATE_INITIAL = 'STATE_INITIAL' + STATE_ACTIVE = 'STATE_ACTIVE' + STATE_INACTIVE = 'STATE_INACTIVE' + STATE_REMOVED = 'STATE_REMOVED' - def self.all_vars - @all_vars ||= [STATE_UNSPECIFIED, STATE_INITIAL, STATE_ACTIVE, STATE_INACTIVE, STATE_REMOVED].freeze - end + # Frozen set of all allowed values, used for validation. + VALUES = [STATE_UNSPECIFIED, STATE_INITIAL, STATE_ACTIVE, STATE_INACTIVE, STATE_REMOVED].freeze - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end + def self.all_vars + VALUES + end - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - return value if WebKeyServiceState.all_vars.include?(value) - raise "Invalid ENUM value #{value} for class #Zitadel::Client::Models::WebKeyServiceState" + # Validate that +value+ is a recognized enum value. + # + # @param value [Object] the value to validate + # @return [Object] the value, if valid + # @raise [ArgumentError] if +value+ is not in {VALUES} + def self.validate!(value) + return value if value.nil? || VALUES.include?(value) + + raise ArgumentError, "Unknown enum value for WebKeyServiceState: #{value.inspect} (allowed: #{VALUES.inspect})" + end end end - end diff --git a/lib/zitadel/client/models/web_key_service_web_key.rb b/lib/zitadel/client/models/web_key_service_web_key.rb index 334c37f7..9fa7818f 100644 --- a/lib/zitadel/client/models/web_key_service_web_key.rb +++ b/lib/zitadel/client/models/web_key_service_web_key.rb @@ -1,294 +1,100 @@ -=begin -#Zitadel SDK +# frozen_string_literal: true -#The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - -The version of the OpenAPI document: 1.0.0 - -Generated by: https://openapi-generator.tech -Generator version: 7.14.0 - -=end +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech require 'date' +require 'iso8601' require 'time' - -module Zitadel::Client::Models - class WebKeyServiceWebKey - # The unique identifier of the key. - attr_accessor :id - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :creation_date - - # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. - attr_accessor :change_date - - attr_accessor :state - - attr_accessor :ecdsa - - attr_accessor :ed25519 - - attr_accessor :rsa - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'creation_date' => :'creationDate', - :'change_date' => :'changeDate', - :'state' => :'state', - :'ecdsa' => :'ecdsa', - :'ed25519' => :'ed25519', - :'rsa' => :'rsa' - } - end - - # Returns attribute mapping this model knows about - def self.acceptable_attribute_map - attribute_map - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - acceptable_attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'creation_date' => :'Time', - :'change_date' => :'Time', - :'state' => :'WebKeyServiceState', - :'ecdsa' => :'WebKeyServiceECDSA', - :'ed25519' => :'Object', - :'rsa' => :'WebKeyServiceRSA' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Models attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "The input argument (attributes) must be a hash in `Zitadel::Client::Models::WebKeyServiceWebKey` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - acceptable_attribute_map = self.class.acceptable_attribute_map - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!acceptable_attribute_map.key?(k.to_sym)) - # MODIFIED: Updated class name in error message - fail ArgumentError, "`#{k}` is not a valid attribute in `Zitadel::Client::Models::WebKeyServiceWebKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'creation_date') - self.creation_date = attributes[:'creation_date'] - end - - if attributes.key?(:'change_date') - self.change_date = attributes[:'change_date'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'ecdsa') - self.ecdsa = attributes[:'ecdsa'] - end - - if attributes.key?(:'ed25519') - self.ed25519 = attributes[:'ed25519'] - end - - if attributes.key?(:'rsa') - self.rsa = attributes[:'rsa'] - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - creation_date == o.creation_date && - change_date == o.change_date && - state == o.state && - ecdsa == o.ecdsa && - ed25519 == o.ed25519 && - rsa == o.rsa - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, creation_date, change_date, state, ecdsa, ed25519, rsa].hash - end - -# Builds the object from hash -# @param [Hash] attributes Models attributes in the form of hash -# @return [Object] Returns the model itself -def self.build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - transformed_hash = {} - openapi_types.each_pair do |key, type| - if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = nil - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[attribute_map[key]].is_a?(Array) - transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } - end - elsif !attributes[attribute_map[key]].nil? - transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) - end - end - new(transformed_hash) # `new` will call the initialize method of the specific model class. -end - -# Deserializes the data based on type -# @param string type Data type -# @param string value Value to be deserialized -# @return [Object] Deserialized data -def self._deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf/anyOf constructs that resolve to a model name - # MODIFIED: Ensure model is looked up in the Models namespace - # 'type' here is expected to be the simple class name (e.g., "User", "OrderDetails") - klass = Zitadel::Client::Models.const_get(type) - # The `klass.build` method is for oneOf/anyOf types (defined in partial_oneof_module.mustache / partial_anyof_module.mustache) - # The `klass.build_from_hash` is for regular model types (defined in this base_object.mustache itself) - if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_allOf) - klass.build(value) # For oneOf/anyOf/allOf, delegate to their specific build method - else - klass.build_from_hash(value) # For regular models - end +require 'tod' +require 'dry-struct' + +# :nodoc: +module Types + # The dry-types module built dynamically by +Dry.Types()+. Bound to a + # constant first so YARD resolves the mixin statically (it cannot resolve + # the bare +include Dry.Types()+ method-call form and would otherwise emit + # an "Undocumentable mixin" warning). + Builder = Dry.Types() + include Builder + + Required = Types::Any.constructor do |v| + raise Dry::Types::CoercionError, 'value cannot be nil' if v.nil? + + v end end -# Returns the string representation of the object -# @return [String] String presentation of the object -def to_s - to_hash.to_s -end - -# to_body is an alias to to_hash (backward compatibility) -# @return [Hash] Returns the object in the form of hash -def to_body - to_hash -end - -# Returns the object in the form of hash -# @return [Hash] Returns the object in the form of hash -def to_hash - hash = {} # Calls super.to_hash if parent exists - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end +# :nodoc: +module Zitadel::Client + # Model classes generated from OpenAPI schemas. + module Models + # Model class for WebKeyServiceWebKey. + class WebKeyServiceWebKey < Dry::Struct + # Attribute mapping from ruby-style variable name to JSON key. + ATTRIBUTE_MAP = { + id: 'id', + creation_date: 'creationDate', + change_date: 'changeDate', + state: 'state', + ecdsa: 'ecdsa', + ed25519: 'ed25519', + rsa: 'rsa' + }.freeze + + # Inverse mapping from JSON key to ruby attribute name. + JSON_KEY_MAP = ATTRIBUTE_MAP.invert.freeze + + # Attribute type mapping. + OPENAPI_TYPES = { + id: 'String', + creation_date: 'Time', + change_date: 'Time', + state: 'WebKeyServiceState', + ecdsa: 'WebKeyServiceECDSA', + ed25519: 'Object', + rsa: 'WebKeyServiceRSA' + }.freeze + + # Per-attribute OpenAPI `format` for properties whose wire form + # differs from their Ruby surface (`byte` → base64-decoded binary + # String, `uuid` → RFC 4122 validated String). The `byte[]` / + # `uuid[]` variants apply the same transform to every item of an + # array-typed property. Consumed by ::Zitadel::Client::ObjectSerializer + # on the (de)serialize path. + # @type var openapi_formats: Hash[Symbol, String] + openapi_formats = { + + } + OPENAPI_FORMATS = openapi_formats.freeze - hash[param] = _to_hash(value) - end - hash -end + # Transform incoming hash keys from JSON format to Ruby attribute names. + transform_keys do |key| + JSON_KEY_MAP[key.to_s] || key.to_sym + end -# Outputs non-array value in the form of hash -# For object, use to_hash. Otherwise, just return the value -# @param [Object] value Any valid value -# @return [Hash] Returns the value in the form of hash -def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + # The unique identifier of the key. + # @example null + attribute :id, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :creation_date, Types::Any.optional.meta(omittable: true) + # A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format. + # @example null + attribute :change_date, Types::Any.optional.meta(omittable: true) + # @example null + attribute :state, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ecdsa, Types::Any.optional.meta(omittable: true) + # @example null + attribute :ed25519, Types::Any.optional.meta(omittable: true) + # @example null + attribute :rsa, Types::Any.optional.meta(omittable: true) end - elsif value.respond_to? :to_hash - value.to_hash - else - value end -end - - end - end diff --git a/lib/zitadel/client/object_serializer.rb b/lib/zitadel/client/object_serializer.rb new file mode 100644 index 00000000..38552291 --- /dev/null +++ b/lib/zitadel/client/object_serializer.rb @@ -0,0 +1,534 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'base64' +require 'date' +require 'iso8601' +require 'json' +require 'set' +require 'time' +require 'tod' + +module Zitadel::Client + # Exception raised when serialization or deserialization fails. + class SerializationError < ZitadelError + attr_reader :cause + + def initialize(message, cause = nil) + super(message) + @cause = cause + end + end + + # Exception raised when data does not match a schema during oneOf/anyOf resolution. + class SchemaMismatchError < ZitadelError; end + + # Canonical RFC 4122 UUID textual form. Validated on both the + # deserialize and serialize paths for any `format: uuid` property. + # Stdlib-only — no `uuid` gem dependency required. + UUID_REGEX = /\A\h{8}-\h{4}-\h{4}-\h{4}-\h{12}\z/ + + # Handles JSON serialization and deserialization for API requests and responses. + # + # All serde operations in the generated client route through this class. + # The parameter encoding methods provide consistent value conversion for + # URL path, query string, header, and form parameters. + # + # @api private + class ObjectSerializer # :nodoc: + DEFAULT_DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S%:z' + + # Serialize an object to a JSON string. + # + # allow_nan: false rejects NaN/Infinity/-Infinity on encode (RFC 8259 + # forbids non-finite numeric literals; Ruby's JSON.generate accepts + # them by default). Aligns Ruby with the 10 SDKs that already reject + # non-finite floats on both encode and decode. + def self.serialize(object) + sanitized = sanitize_for_serialization(object) + JSON.generate(sanitized, allow_nan: false) + rescue StandardError => e + raise SerializationError.new("Failed to serialize object to JSON: #{e.message}", e) + end + + # Deserialize a JSON string to an object of the specified type. + # + # allow_nan: false rejects NaN/Infinity/-Infinity on decode (same + # rationale as serialize above). JSON::ParserError is raised when a + # non-finite literal is encountered. + def self.deserialize(json_string, target_type) + return nil if json_string.nil? || (json_string.is_a?(String) && json_string.empty?) + + # RFC 8259 §8.1 forbids a UTF-8 BOM at the start of JSON text, + # but Windows-generated payloads often include one and Ruby's + # JSON.parse rejects it. Strip silently for parity with Java + # Jackson / C# System.Text.Json which strip transparently. + if json_string.is_a?(String) && json_string.start_with?("") + json_string = json_string.sub(/\A/, '') + end + + data = if json_string.is_a?(String) + JSON.parse(json_string, symbolize_names: true, allow_nan: false) + else + json_string + end + + convert_to_type(data, target_type) + rescue JSON::ParserError => e + raise SerializationError.new("Failed to parse JSON: #{e.message}", e) + rescue ArgumentError + raise + rescue StandardError => e + raise e if e.is_a?(SerializationError) + + raise SerializationError.new("Failed to deserialize JSON to #{target_type}: #{e.message}", e) + end + + # Convert a single scalar value to its string representation. + # + # This is the canonical type-conversion method used by all parameter + # encoding helpers (+to_path_value+, +to_query_value+, etc.) and by + # +ValueSerializer+ for transport formatting. + # + # @param value [Object, nil] the value to stringify + # @return [String] the string representation + def self.stringify(value) + return '' if value.nil? + + case value + when TrueClass, FalseClass + value ? 'true' : 'false' + when Time, DateTime + value.strftime(DEFAULT_DATETIME_FORMAT) + when Tod::TimeOfDay + # 4.8: format: time → HH:MM:SS wire form (seconds precision). + value.strftime('%H:%M:%S') + when ISO8601::Duration + # format: duration → protobuf-JSON duration ("3600s"), the wire + # form Zitadel (and other protobuf-derived APIs) require. The + # native ISO-8601 #to_s ("PT1H") is rejected by the server. + duration_to_protobuf_json(value) + else + value.to_s + end + end + + # Convert a value to a string suitable for use as a URL path parameter. + def self.to_path_value(value) + stringify(value) + end + + # Convert a value to a representation suitable for use as a query parameter. + # For collections, joins using the specified collection format delimiter. + def self.to_query_value(value, collection_format = nil) + return nil if value.nil? + + case value + when Array, Set + items = value.map { |v| stringify(v) } + case collection_format + when :ssv then items.join(' ') + when :tsv then items.join("\t") + when :pipes then items.join('|') + when :multi then items + else items.join(',') + end + else + stringify(value) + end + end + + # Convert a value to a string suitable for use as an HTTP header value. + def self.to_header_value(value) + return '' if value.nil? + + case value + when Array, Set + value.map { |v| stringify(v) }.join(',') + else + stringify(value) + end + end + + # Convert a value to a string suitable for use as an HTTP cookie value. + # Cookie values follow the same encoding rules as header values. + def self.to_cookie_value(value) + to_header_value(value) + end + + # Convert a value to a representation suitable for use as a form parameter. + def self.to_form_value(value) + stringify(value) + end + + def self.sanitize_for_serialization(object, visited = nil) + return sanitize_for_serialization(object.actual_instance, visited) if object.respond_to?(:actual_instance) + + case object + when nil + nil + when String, Integer, Float, TrueClass, FalseClass + object + when Date + # Date#to_s emits ISO-8601 calendar form. + object.to_s + when ISO8601::Duration + # format: duration → protobuf-JSON duration ("3600s"). See + # #duration_to_protobuf_json; the native ISO-8601 form is rejected. + duration_to_protobuf_json(object) + when Time, DateTime + object.strftime(DEFAULT_DATETIME_FORMAT) + when Tod::TimeOfDay + # 4.8: format: time — emit HH:MM:SS for JSON wire form. + object.strftime('%H:%M:%S') + when Array, Set, Hash + visited ||= Set.new + obj_id = object.object_id + raise SerializationError, 'Circular reference detected during serialization' if visited.include?(obj_id) + + visited.add(obj_id) + begin + case object + when Array, Set + object.map { |item| sanitize_for_serialization(item, visited) } + when Hash + # @type var sanitized: Hash[untyped, untyped] + sanitized = {} + object.each_with_object(sanitized) do |(key, value), hash| + next if value.nil? + + hash[key] = sanitize_for_serialization(value, visited) + end + end + ensure + visited.delete(obj_id) + end + else + if object.class.const_defined?(:ATTRIBUTE_MAP) + visited ||= Set.new + obj_id = object.object_id + raise SerializationError, 'Circular reference detected during serialization' if visited.include?(obj_id) + + visited.add(obj_id) + # @type var formats: Hash[Symbol, String] + formats = object.class.const_defined?(:OPENAPI_FORMATS) ? object.class::OPENAPI_FORMATS : {} + begin + # @type var hash: Hash[untyped, untyped] + hash = {} + object.class::ATTRIBUTE_MAP.each do |attr, json_key| + value = object.send(attr) + next if value.nil? + + fmt = formats[attr] + hash[json_key] = if fmt + apply_format_on_serialize(value, fmt) + else + sanitize_for_serialization(value, visited) + end + end + hash + ensure + visited.delete(obj_id) + end + elsif object.respond_to?(:to_hash) + sanitize_for_serialization(object.to_hash, visited) + elsif object.respond_to?(:to_json) + object + else + object.to_s + end + end + end + + def self.convert_to_type(data, return_type) + return nil if data.nil? + + # Strict type-check primitives before coercing. Default Ruby + # behaviour was lenient ("42".to_i => 42, "true" == true => false + # silently). Aligns Ruby with Java/Kotlin/C#/Go/Swift/Rust which + # throw on type mismatch — surfaces server-side bugs loudly. + case return_type + when 'String' + raise ArgumentError, "Expected String, got #{data.class}: #{data.inspect}" unless data.is_a?(String) + + data + when 'Integer' + raise ArgumentError, "Expected Integer, got #{data.class}: #{data.inspect}" unless data.is_a?(Integer) + + data + when 'Float' + raise ArgumentError, "Expected Float, got #{data.class}: #{data.inspect}" unless data.is_a?(Numeric) + + # Float() takes any Numeric and is RBS-typed accordingly; + # Numeric#to_f isn't declared in the core RBS sigs Steep uses. + Float(data) + when 'Boolean' + raise ArgumentError, "Expected Boolean, got #{data.class}: #{data.inspect}" unless [true, false].include?(data) + + data + when 'Time' + Time.parse(data.to_s) + when 'Date' + Date.parse(data.to_s) + when 'Tod::TimeOfDay' + # 4.8: format: time — parse HH:MM[:SS] from the wire. + # Tod::TimeOfDay.parse raises ArgumentError on malformed input, + # which is wrapped into SerializationError by the outer rescue. + return data if data.is_a?(Tod::TimeOfDay) + + Tod::TimeOfDay.parse(data.to_s) + when 'ISO8601::Duration' + # 4.8: format: duration — parse protobuf-JSON duration ("3600s"). + # The native type stays ISO8601::Duration; only the wire form is + # protobuf-JSON. Malformed input raises SerializationError. + return data if data.is_a?(ISO8601::Duration) + + duration_from_protobuf_json(data.to_s) + when 'Object' + data + when /\AArray<(.+)>\z/ + sub_type = ::Regexp.last_match(1).to_s + data.map { |item| convert_to_type(item, sub_type) } + when /\ASet<(.+)>\z/ + sub_type = ::Regexp.last_match(1).to_s + Set.new(data.map { |item| convert_to_type(item, sub_type) }) + when /\AHash\z/ + sub_type = ::Regexp.last_match(1).to_s + # @type var converted: Hash[untyped, untyped] + converted = {} + data.each_with_object(converted) do |(key, value), hash| + hash[key] = convert_to_type(value, sub_type) + end + else + klass = begin + ::Zitadel::Client::Models.const_get(return_type) + rescue NameError + Zitadel::Client.const_get(return_type) + end + if klass.respond_to?(:openapi_one_of) || klass.respond_to?(:openapi_any_of) + klass.build(data) + elsif klass.const_defined?(:OPENAPI_TYPES) + deserialize_model(data, klass) + elsif klass.const_defined?(:VALUES) + values = klass.const_get(:VALUES) + unless values.include?(data) + raise ArgumentError, "Unknown enum value for #{return_type}: #{data.inspect} (allowed: #{values.inspect})" + end + + data + else + klass.new(data) + end + end + end + + def self.deserialize_model(data, klass) + return nil unless data.is_a?(Hash) + + data = data.transform_keys(&:to_s) + # @type var formats: Hash[Symbol, String] + formats = klass.const_defined?(:OPENAPI_FORMATS) ? klass::OPENAPI_FORMATS : {} + # @type var transformed: Hash[untyped, untyped] + transformed = {} + klass::OPENAPI_TYPES.each do |attr, type| + json_key = klass::ATTRIBUTE_MAP[attr] + next unless data.key?(json_key) + + value = data[json_key] + converted = value.nil? ? nil : convert_to_type(value, type.to_s) + fmt = formats[attr] + transformed[attr] = if !converted.nil? && fmt + apply_format_on_deserialize(converted, fmt) + else + converted + end + end + klass.new(transformed) + end + + # Apply +format+-specific decoding after type conversion. + # + # +byte+ — base64-decode the wire string into a binary-encoded + # Ruby String. Strict mode rejects whitespace and trailing garbage. + # +uuid+ — validate the wire string against {UUID_REGEX} and return + # it unchanged. + def self.apply_format_on_deserialize(value, fmt) + case fmt + when 'byte' + decode_byte(value) + when 'uuid' + validate_uuid(value) + when 'byte[]' + raise SerializationError, "Expected Array for format: byte[], got #{value.class}" unless value.is_a?(Array) + + value.map { |item| decode_byte(item) } + when 'uuid[]' + raise SerializationError, "Expected Array for format: uuid[], got #{value.class}" unless value.is_a?(Array) + + value.map { |item| validate_uuid(item) } + else + value + end + end + + def self.decode_byte(value) + raise SerializationError, "Expected base64 String for format: byte, got #{value.class}" unless value.is_a?(String) + + begin + Base64.strict_decode64(value).force_encoding(Encoding::BINARY) + rescue ArgumentError => e + raise SerializationError.new("Invalid base64 for format: byte: #{e.message}", e) + end + end + + def self.validate_uuid(value) + unless value.is_a?(String) && UUID_REGEX.match?(value) + raise SerializationError, "Invalid UUID for format: uuid: #{value.inspect}" + end + + value + end + + # Wire form accepted by the protobuf-JSON duration parser: optional + # sign, integer seconds, optional fractional part (1–9 digits), and a + # trailing "s" (e.g. "3600s", "3600.000000001s", "-1.5s"). + PROTOBUF_DURATION_REGEX = /\A-?\d+(\.\d{1,9})?s\z/ + + # Render an ISO8601::Duration as a protobuf-JSON duration string. + # + # Protobuf-JSON encodes durations as total seconds with a trailing + # "s" — "3600s" or, when sub-second precision is present, fractional + # seconds trimmed to 3, 6, or 9 digits ("3600.000000001s"). This is + # the form Zitadel and other protobuf-derived APIs require; the + # native ISO-8601 form ("PT1H") is rejected by the server. + def self.duration_to_protobuf_json(duration) + total = duration.to_seconds + sign = total.negative? ? '-' : '' + abs = total.abs + secs = abs.floor + nanos = ((abs - secs) * 1_000_000_000).round + + # Rounding may carry into the whole-seconds part (e.g. 0.9999999999). + if nanos >= 1_000_000_000 + secs += 1 + nanos -= 1_000_000_000 + end + + return "#{sign}#{secs}s" if nanos.zero? + + frac = format('%09d', nanos) + # Trim to the smallest of 3/6/9 digits that preserves all non-zero + # nanos, matching the protobuf-JSON canonical encoding. + frac = if (frac[3..] || '').match?(/\A0*\z/) + frac[0, 3] + elsif (frac[6..] || '').match?(/\A0*\z/) + frac[0, 6] + else + frac + end + "#{sign}#{secs}.#{frac}s" + end + + # Parse a protobuf-JSON duration string into an ISO8601::Duration. + # + # Accepts the protobuf-JSON wire form ("3600s", "3600.000000001s") + # and rebuilds the native ISO8601::Duration from the total seconds. + # Malformed input raises SerializationError, consistent with the + # other format parsers in this class. + def self.duration_from_protobuf_json(value) + unless PROTOBUF_DURATION_REGEX.match?(value) + raise SerializationError, "Invalid protobuf-JSON duration for format: duration: #{value.inspect}" + end + + sign = value.start_with?('-') ? -1 : 1 + digits = value.delete_prefix('-').delete_suffix('s') + int_part, frac_part = digits.split('.', 2) + secs = int_part.to_i + nanos = frac_part.nil? ? 0 : frac_part.ljust(9, '0').to_i + total_seconds = sign * (secs + (nanos / 1_000_000_000.0)) + ISO8601::Duration.new("PT#{total_seconds}S") + end + + # Apply +format+-specific encoding before JSON serialization. + # + # +byte+ — base64-encode the raw bytes (strict, no line breaks). + # +uuid+ — validate against {UUID_REGEX} and emit unchanged. + def self.apply_format_on_serialize(value, fmt) + case fmt + when 'byte' + encode_byte(value) + when 'uuid' + validate_uuid(value) + when 'byte[]' + raise SerializationError, "Expected Array for format: byte[], got #{value.class}" unless value.is_a?(Array) + + value.map { |item| encode_byte(item) } + when 'uuid[]' + raise SerializationError, "Expected Array for format: uuid[], got #{value.class}" unless value.is_a?(Array) + + value.map { |item| validate_uuid(item) } + else + value + end + end + + def self.encode_byte(value) + raise SerializationError, "Expected String for format: byte, got #{value.class}" unless value.is_a?(String) + + Base64.strict_encode64(value) + end + + # Attempt to deserialize data as a specific type for oneOf/anyOf resolution. + # Uses the try-deserialize-and-catch pattern: attempts deserialization via + # convert_to_type and raises on failure. + def self.find_and_cast_into_type(klass_name, data) + return if data.nil? + + result = convert_to_type(data, klass_name.to_s) + return result unless result.nil? + + raise SchemaMismatchError, "#{data.inspect} doesn't match the #{klass_name} type" + end + + # Attempt to deserialize data against a list of candidate schemas, returning + # the first successful result. Each candidate is a lambda that accepts the + # raw JSON data and returns a deserialized object or raises on failure. + # + # @param data [Object] the parsed JSON data + # @param candidates [Array] lambdas that attempt deserialization + # @return [Object] the first successfully deserialized result + # @raise [SchemaMismatchError] if no candidate matches the data. A payload + # satisfying none of the declared variants is a contract violation and + # must fail loudly rather than be silently dropped to nil. + # @api private + def self.resolve_one_of(data, candidates) + candidates.each do |candidate| + return candidate.call(data) + rescue StandardError + next + end + raise SchemaMismatchError, 'No oneOf/anyOf variant matched the JSON' + end + + # Attempt to deserialize data against a list of candidate schemas using + # anyOf semantics. Delegates to {.resolve_one_of}. + # + # @param data [Object] the parsed JSON data + # @param candidates [Array] lambdas that attempt deserialization + # @return [Object] the first successfully deserialized result + # @raise [SchemaMismatchError] if no candidate matches the data + # @api private + def self.resolve_any_of(data, candidates) + resolve_one_of(data, candidates) + end + + private_class_method :sanitize_for_serialization, :deserialize_model + end +end diff --git a/lib/zitadel/client/server_configuration.rb b/lib/zitadel/client/server_configuration.rb new file mode 100644 index 00000000..db75500e --- /dev/null +++ b/lib/zitadel/client/server_configuration.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + # Represents a server variable from the OpenAPI specification. + # + # Server variables define substitution parameters in server URL templates. + # Each variable has a default value and may optionally restrict values to + # an enumerated set. + # + # This class is immutable and thread-safe. + # + # @see ServerConfiguration + class ServerVariable + # The default value for this variable. + # @return [String] + attr_reader :default_value + + # Human-readable description of this variable. + # @return [String, nil] + attr_reader :description + + # The allowed values for this variable. An empty array means any value + # is accepted. + # @return [Array] + attr_reader :enum_values + + # Create a new server variable. + # + # @param default_value [String] the default value used when no override is provided + # @param description [String, nil] human-readable description of the variable + # @param enum_values [Array] allowed values, or an empty array if any value is accepted + def initialize(default_value:, description: nil, enum_values: []) + @default_value = default_value + @description = description + @enum_values = enum_values.freeze + freeze + end + end + + # Represents a single server entry from the OpenAPI specification. + # + # A server URL may contain template variables (e.g. + # +"https://{env}.api.example.com/v{version}"+). Use {#url} to resolve the + # URL with default variable values, or {#url} with overrides to substitute + # specific variables. + # + # This class is immutable and thread-safe. + # + # @see ServerVariable + class ServerConfiguration + # The raw URL template before variable substitution. + # @return [String] + attr_reader :url_template + + # Human-readable description of this server. + # @return [String, nil] + attr_reader :description + + # The server variables and their definitions. + # @return [Hash{String => ServerVariable}] + attr_reader :variables + + # Create a new server configuration. + # + # @param url_template [String] the URL template, possibly containing +{variable}+ placeholders + # @param description [String, nil] human-readable description of this server + # @param variables [Hash{String => ServerVariable}] map of variable names to their definitions + def initialize(url_template:, description: nil, variables: {}) + @url_template = url_template + @description = description + @variables = variables.freeze + freeze + end + + # Resolve the URL template using default variable values or the given overrides. + # + # Variables not present in +overrides+ use their default values. If a + # variable has an enum constraint, the override value is validated against + # the allowed values. + # + # @param overrides [Hash{String => String}] variable name to value overrides + # @return [String] the fully resolved URL + # @raise [ArgumentError] if an override value is not in the variable's enum + def url(overrides = {}) + result = url_template + variables.each do |var_name, var| + value = overrides.fetch(var_name, var.default_value) + unless var.enum_values.empty? || var.enum_values.include?(value) + raise ArgumentError, "Invalid value '#{value}' for variable '#{var_name}'. Allowed: #{var.enum_values}" + end + + result = result.gsub("{#{var_name}}", value) + end + result + end + end +end diff --git a/lib/zitadel/client/servers.rb b/lib/zitadel/client/servers.rb new file mode 100644 index 00000000..3c212fe4 --- /dev/null +++ b/lib/zitadel/client/servers.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + # Generated server configurations from the OpenAPI specification. + # + # Each constant corresponds to a server entry defined in the spec's + # +servers+ array. Use these constants with + # {Configuration::Builder#base_url} to select a server: + # + # config = ::Zitadel::Client::Configuration.builder + # .base_url(::Zitadel::Client::Servers::SERVER_0.url) + # .build + # + # For servers with variables, pass overrides: + # + # url = ::Zitadel::Client::Servers::SERVER_1.url('environment' => 'staging') + module Servers + # Server 0: +https://zitadel.com+ + SERVER_0 = ServerConfiguration.new( + url_template: 'https://zitadel.com', + description: nil, + variables: {} + ).freeze + + # All server configurations in declaration order. + # @return [Array] + ALL = [ + SERVER_0 + ].freeze + end +end diff --git a/lib/zitadel/client/trace_context_util.rb b/lib/zitadel/client/trace_context_util.rb new file mode 100644 index 00000000..0171f655 --- /dev/null +++ b/lib/zitadel/client/trace_context_util.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +# :nodoc: +module Zitadel::Client + # Utility for injecting W3C Trace Context headers (traceparent, tracestate) + # into outgoing API requests when OpenTelemetry is available. + # + # If the opentelemetry-api gem is not installed, this class silently no-ops. + class TraceContextUtil + # Inject the current OpenTelemetry trace context into the given headers hash. + # + # @param headers [Hash] mutable hash of request headers + def self.inject_trace_context(headers) + require 'opentelemetry-api' + OpenTelemetry.propagation.inject(headers) # steep:ignore UnknownConstant + rescue LoadError + nil + end + end +end diff --git a/lib/zitadel/client/transport_options.rb b/lib/zitadel/client/transport_options.rb index 144a7597..a538a36b 100644 --- a/lib/zitadel/client/transport_options.rb +++ b/lib/zitadel/client/transport_options.rb @@ -1,64 +1,222 @@ # frozen_string_literal: true -require 'openssl' - -module Zitadel - module Client - # Immutable transport options for configuring HTTP connections. - class TransportOptions - # @return [Hash{String => String}] Default HTTP headers sent to the origin server with every request. - attr_reader :default_headers - - # @return [String, nil] Path to a custom CA certificate file for TLS verification. - attr_reader :ca_cert_path - - # @return [Boolean] Whether to disable TLS certificate verification. - attr_reader :insecure - - # @return [String, nil] Proxy URL for HTTP connections. - attr_reader :proxy_url - - # Creates a new TransportOptions instance. - # - # @param default_headers [Hash{String => String}] Default HTTP headers sent to the origin server with every request. - # @param ca_cert_path [String, nil] Path to a custom CA certificate file for TLS verification. - # @param insecure [Boolean] Whether to disable TLS certificate verification. - # @param proxy_url [String, nil] Proxy URL for HTTP connections. - # @return [TransportOptions] an immutable transport options instance. - def initialize(default_headers: {}, ca_cert_path: nil, insecure: false, proxy_url: nil) - @default_headers = default_headers.dup.freeze - @ca_cert_path = ca_cert_path&.dup&.freeze - @insecure = insecure - @proxy_url = proxy_url&.dup&.freeze - freeze +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + # Immutable HTTP transport configuration for {DefaultApiClient}. + # + # Controls low-level HTTP behavior such as TLS verification, proxy routing, + # timeouts, redirect handling, and automatic header injection. These settings + # are independent of API-level concerns (base URL, authentication headers) + # which belong in {Configuration}. + # + # This class is immutable and thread-safe. Use {TransportOptions.builder} to create instances: + # + # transport = ::Zitadel::Client::TransportOptions.builder + # .verify_ssl(false) + # .proxy('http://proxy.example.com:8080') + # .timeout(5000) + # .user_agent('MyApp/1.0') + # .build + class TransportOptions + # Whether TLS certificate verification is enabled. + # @return [Boolean] + attr_reader :verify_ssl + + # Path to a custom CA certificate bundle for TLS verification. + # When set together with +verify_ssl=true+, the client trusts certificates + # signed by this CA in addition to (or instead of) the system trust store. + # @return [String, nil] + attr_reader :ca_cert_path + + # HTTP or HTTPS proxy URL for all outbound requests. + # @return [String, nil] + attr_reader :proxy + + # End-to-end request timeout in milliseconds. Covers the entire request + # lifecycle: connection, TLS handshake, sending the request body, and + # reading the response. A value of +nil+ means no timeout. + # @return [Integer, nil] + attr_reader :timeout + + # Whether the client follows HTTP 3xx redirects automatically. + # @return [Boolean] + attr_reader :follow_redirects + + # Maximum number of consecutive redirects to follow. Only meaningful + # when {#follow_redirects} is +true+. A value of +nil+ uses the HTTP + # client's built-in default. + # @return [Integer, nil] + attr_reader :max_redirects + + # Custom User-Agent header value. When set, this value is sent as the + # User-Agent header on every request unless the caller explicitly provides one. + # @return [String, nil] + attr_reader :user_agent + + # Transport-level default headers included in every request. These headers + # have the lowest priority: API-level headers from {Configuration#default_headers}, + # operation-specific headers, and authentication headers all take precedence. + # @return [Hash{String => String}] + attr_reader :default_headers + + # Whether to auto-inject an X-Request-ID header with a unique UUID on + # every request. Useful for distributed tracing and log correlation. + # @return [Boolean] + attr_reader :inject_request_id + + # @api private + def initialize(verify_ssl:, ca_cert_path:, proxy:, timeout:, + follow_redirects:, max_redirects:, user_agent:, + default_headers:, inject_request_id:) + @verify_ssl = verify_ssl + @ca_cert_path = ca_cert_path + @proxy = proxy + @timeout = timeout + @follow_redirects = follow_redirects + @max_redirects = max_redirects + @user_agent = user_agent + @default_headers = default_headers.freeze + @inject_request_id = inject_request_id + freeze + end + + # Create a new builder for constructing {TransportOptions} instances. + # @return [Builder] + def self.builder + Builder.new + end + + # Builder for creating immutable {TransportOptions} instances. + # + # All fields have sensible defaults: + # - +verify_ssl+ -- +true+ + # - +follow_redirects+ -- +true+ + # - +inject_request_id+ -- +false+ + # - All other fields -- +nil+ or empty + class Builder + def initialize + @verify_ssl = true + @ca_cert_path = nil + @proxy = nil + @timeout = 10_000 + @follow_redirects = true + @max_redirects = nil + @user_agent = 'zitadel-client/0.0.1 (ruby)' + @default_headers = {} #: Hash[String, String] + @inject_request_id = false + end + + # Enable or disable TLS certificate verification. + # @param val [Boolean] +true+ to verify (default), +false+ to skip + # @return [self] + def verify_ssl(val) + @verify_ssl = val + self end - # Returns a TransportOptions instance with all default values. - # - # @return [TransportOptions] a default transport options instance. - def self.defaults - new + # Set the path to a custom CA certificate bundle. + # @param val [String, nil] file path to a PEM-encoded CA certificate + # @return [self] + def ca_cert_path(val) + @ca_cert_path = val + self end - # Builds Faraday connection options from these transport options. - # - # @return [Hash] connection options for OAuth2::Client - # rubocop:disable Metrics/AbcSize, Metrics/MethodLength - def to_connection_opts - opts = {} - if insecure - opts[:ssl] = { verify: false } - elsif ca_cert_path - store = OpenSSL::X509::Store.new - store.set_default_paths - store.add_file(ca_cert_path) - opts[:ssl] = { cert_store: store, verify: true } + # Set the HTTP/HTTPS proxy URL. + # @param val [String, nil] proxy URL (e.g. "http://proxy:3128") + # @return [self] + # @raise [ArgumentError] if the URL is invalid + def proxy(val) + if val + uri = URI.parse(val) + unless uri.scheme && %w[http https].include?(uri.scheme.downcase) + raise ArgumentError, "Invalid proxy URL (must use http or https scheme): #{val}" + end + raise ArgumentError, "Invalid proxy URL (missing host): #{val}" unless uri.host && !uri.host.empty? end - opts[:proxy] = proxy_url if proxy_url - opts[:headers] = default_headers.dup if default_headers.any? - opts + @proxy = val + self + end + + # Set the end-to-end request timeout in milliseconds. + # @param val [Integer, nil] timeout in milliseconds, or +nil+ for no timeout + # @return [self] + def timeout(val) + @timeout = val + self + end + + # Enable or disable automatic redirect following. + # @param val [Boolean] +true+ to follow (default), +false+ to stop + # @return [self] + def follow_redirects(val) + @follow_redirects = val + self + end + + # Set the maximum number of redirects to follow. + # @param val [Integer, nil] maximum redirect hops, or +nil+ for client default + # @return [self] + def max_redirects(val) + @max_redirects = val + self + end + + # Set a custom User-Agent header value. + # @param val [String, nil] the user agent string, or +nil+ to omit + # @return [self] + def user_agent(val) + @user_agent = val + self + end + + # Add a single transport-level default header. + # @param name [String] header name + # @param value [String] header value + # @return [self] + def default_header(name, value) + @default_headers[name] = value + self + end + + # Add multiple transport-level default headers. + # @param headers [Hash{String => String}] map of header names to values + # @return [self] + def default_headers(headers) + @default_headers.merge!(headers) + self + end + + # Enable or disable automatic X-Request-ID header injection. + # @param val [Boolean] +true+ to inject, +false+ to skip (default) + # @return [self] + def inject_request_id(val) + @inject_request_id = val + self + end + + # Build and return an immutable {TransportOptions} instance. + # @return [TransportOptions] + def build + TransportOptions.new( + verify_ssl: @verify_ssl, + ca_cert_path: @ca_cert_path, + proxy: @proxy, + timeout: @timeout, + follow_redirects: @follow_redirects, + max_redirects: @max_redirects, + user_agent: @user_agent, + default_headers: @default_headers.dup, + inject_request_id: @inject_request_id + ) end - # rubocop:enable Metrics/AbcSize, Metrics/MethodLength end end end diff --git a/lib/zitadel/client/utils/url_util.rb b/lib/zitadel/client/utils/url_util.rb deleted file mode 100644 index 72832900..00000000 --- a/lib/zitadel/client/utils/url_util.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -require 'uri' - -module Zitadel - module Client - module Utils - # Utility module for URL related operations. - # This is a placeholder for UrlUtil, which provides URL utility methods. - class UrlUtil - ## - # Builds the hostname for the provided host. - # - # @param host [String] the base URL for the service. - # @return [String] the fully qualified hostname (defaults to HTTPS if no scheme is provided). - # - def self.build_hostname(host) - uri = URI.parse(host) - host = "https://#{host}" unless uri.scheme - host - end - end - end - end -end diff --git a/lib/zitadel/client/value_serializer.rb b/lib/zitadel/client/value_serializer.rb new file mode 100644 index 00000000..a49321b9 --- /dev/null +++ b/lib/zitadel/client/value_serializer.rb @@ -0,0 +1,199 @@ +# frozen_string_literal: true + +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +require 'cgi' +require 'uri' + +module Zitadel::Client + # Serializes parameter values for HTTP requests based on their location. + # + # @api private + class ValueSerializer # :nodoc: + # Percent-encodes a string for use as a path segment, preserving + # sub-delimiters that OAS 3.0 path styles use as structural separators. + # '~' is an RFC 3986 unreserved character and must never be + # percent-encoded. URI.encode_www_form_component over-encodes it to + # %7E; restore it to a literal '~' to match the other SDKs. + PRESERVE_ENCODED = { + '%3B' => ';', '%3D' => '=', '%2C' => ',', '%3A' => ':', + '%40' => '@', '%21' => '!', '%24' => '$', '%26' => '&', + '%27' => "'", '%28' => '(', '%29' => ')', '%2A' => '*', + '%2B' => '+', '%7E' => '~' + }.freeze + + def self.encode_path_segment(value) + return '' if value.nil? || value.empty? + + encoded = URI.encode_www_form_component(value).gsub('+', '%20') + PRESERVE_ENCODED.reduce(encoded) { |s, (from, to)| s.gsub(from, to) } + end + + def self.serialize(value, location, _schema_type, collection_format: nil) + return serialize_nil(location) if value.nil? + return serialize_array(value, location, collection_format) if value.is_a?(Array) + + str_val = ObjectSerializer.stringify(value) + + return encode_path_segment(str_val) if location == :path + + str_val + end + + def self.serialize_nil(location) + return nil if location == :query + + '' + end + + def self.serialize_array(value, location, collection_format) + if location == :query + serialize_query_array(value, collection_format) + else + value.map { |v| ObjectSerializer.stringify(v) }.join(',') + end + end + + def self.serialize_query_array(value, collection_format) + case collection_format + when :multi + value.map { |v| ObjectSerializer.stringify(v) } + when :ssv + value.map { |v| ObjectSerializer.stringify(v) }.join(' ') + when :tsv + value.map { |v| ObjectSerializer.stringify(v) }.join("\t") + when :pipes + value.map { |v| ObjectSerializer.stringify(v) }.join('|') + else + value.map { |v| ObjectSerializer.stringify(v) }.join(',') + end + end + + def self.encode_item(value, location) + str = ObjectSerializer.stringify(value) + location == :path ? encode_path_segment(str) : str + end + + # Serialize a deepObject-style query parameter. + # + # Produces a hash of flattened keys in the form +param_name[key]+ to + # stringified values, suitable for inclusion in a query string. + # + # @param param_name [String] the parameter name (e.g. 'filter') + # @param value [Hash, nil] the hash value to serialize + # @return [Hash{String => String}] expanded keys to serialized values + def self.serialize_deep_object(param_name, value) + # @type var empty: Hash[String, String] + empty = {} + return empty if value.nil? + + # @type var acc: Hash[String, String] + acc = {} + value.each_with_object(acc) do |(key, val), result| + result["#{param_name}[#{key}]"] = ObjectSerializer.stringify(val) + end + end + + # Serialize a parameter value according to OAS 3.0 style and explode rules. + # + # @param param_name [String] the parameter name + # @param value [Object, nil] the value to serialize + # @param location [Symbol] parameter location (:path, :query, :header, :cookie) + # @param schema_type [String] the schema type (e.g. 'string', 'array') + # @param collection_format [Symbol, nil] legacy collection format + # @param style [String, nil] OAS 3.0 style (e.g. 'matrix', 'label', 'form', + # 'simple', 'spaceDelimited', 'pipeDelimited') + # @param explode [Boolean] whether to explode array values + # @return [String, Array, nil] the serialized value + def self.serialize_styled(param_name, value, location, schema_type, collection_format, style, explode) + # Path parameters are required components of the URL — accepting an + # empty string would silently produce a malformed URL like + # `/pet//details`, which most servers route to 404 instead of + # surfacing the bug at the call site. The required-non-null check + # lives in the operation method; here we catch the empty-string + # case that slips through it. + if location == :path && value.is_a?(String) && value.empty? + raise ArgumentError, "Path parameter '#{param_name}' must not be empty" + end + + return serialize(value, location, schema_type, collection_format: collection_format) if style.nil? || style.empty? + + case style + when 'matrix' + return nil if value.nil? && location == :query + return '' if value.nil? + + if value.is_a?(Array) + if explode + value.map do |v| + ";#{param_name}=#{encode_item(v, location)}" + end.join + else + items = value.map { |v| encode_item(v, location) } + ";#{param_name}=#{items.join(',')}" + end + else + ";#{param_name}=#{encode_item(value, location)}" + end + when 'label' + return nil if value.nil? && location == :query + return '' if value.nil? + + if value.is_a?(Array) + items = value.map { |v| encode_item(v, location) } + explode ? ".#{items.join('.')}" : ".#{items.join(',')}" + else + ".#{encode_item(value, location)}" + end + when 'spaceDelimited' + return nil if value.nil? && location == :query + return '' if value.nil? + + if value.is_a?(Array) + value.map { |v| ObjectSerializer.stringify(v) }.join(' ') + else + ObjectSerializer.stringify(value) + end + when 'pipeDelimited' + return nil if value.nil? && location == :query + return '' if value.nil? + + if value.is_a?(Array) + value.map { |v| ObjectSerializer.stringify(v) }.join('|') + else + ObjectSerializer.stringify(value) + end + when 'form' + return nil if value.nil? && location == :query + return '' if value.nil? + + if value.is_a?(Array) && explode + value.map { |v| ObjectSerializer.stringify(v) } + elsif value.is_a?(Array) + value.map { |v| ObjectSerializer.stringify(v) }.join(',') + else + ObjectSerializer.stringify(value) + end + when 'simple' + return nil if value.nil? && location == :query + return '' if value.nil? + + if value.is_a?(Array) + value.map { |v| encode_item(v, location) }.join(',') + else + encode_item(value, location) + end + else + serialize(value, location, schema_type, collection_format: collection_format) + end + end + + private_class_method :serialize_nil, :serialize_array, :serialize_query_array, :encode_item + end +end diff --git a/lib/zitadel/client/version.rb b/lib/zitadel/client/version.rb index 475ee024..98945e92 100644 --- a/lib/zitadel/client/version.rb +++ b/lib/zitadel/client/version.rb @@ -1,7 +1,15 @@ # frozen_string_literal: true +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + module Zitadel module Client - VERSION = '4.1.1' + VERSION = '0.0.1' end end diff --git a/lib/zitadel/client/zitadel.rb b/lib/zitadel/client/zitadel.rb index 3fb670e5..f81307d7 100644 --- a/lib/zitadel/client/zitadel.rb +++ b/lib/zitadel/client/zitadel.rb @@ -1,156 +1,187 @@ # frozen_string_literal: true -module Zitadel - module Client - # Main entry point for the Zitadel SDK. +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +module Zitadel::Client + # Unified entry point for all API services. + # + # Takes an {Auth::Authenticator} and optionally {TransportOptions}, + # then exposes each API group as a typed property. If the authenticator + # includes {Auth::HttpAwareAuthenticator}, the shared {ApiClient} is + # injected so that authentication HTTP calls (token exchange, discovery) + # use the same transport configuration as regular API calls. + # + # @example Default transport + # client = ::Zitadel::Client::Zitadel.new(authenticator) + # + # @example Custom transport (proxy, timeouts, etc.) + # transport = ::Zitadel::Client::TransportOptions.builder + # .proxy('http://proxy:3128') + # .timeout(5000) + # .build + # client = ::Zitadel::Client::Zitadel.new(authenticator, transport) + class Zitadel + # @return [::Zitadel::Client::Api::ActionServiceApi] + attr_reader :action_service + + # @return [::Zitadel::Client::Api::ApplicationServiceApi] + attr_reader :application_service + + # @return [::Zitadel::Client::Api::AuthorizationServiceApi] + attr_reader :authorization_service + + # @return [::Zitadel::Client::Api::BetaActionServiceApi] + attr_reader :beta_action_service + + # @return [::Zitadel::Client::Api::BetaAppServiceApi] + attr_reader :beta_app_service + + # @return [::Zitadel::Client::Api::BetaAuthorizationServiceApi] + attr_reader :beta_authorization_service + + # @return [::Zitadel::Client::Api::BetaFeatureServiceApi] + attr_reader :beta_feature_service + + # @return [::Zitadel::Client::Api::BetaInstanceServiceApi] + attr_reader :beta_instance_service + + # @return [::Zitadel::Client::Api::BetaInternalPermissionServiceApi] + attr_reader :beta_internal_permission_service + + # @return [::Zitadel::Client::Api::BetaOIDCServiceApi] + attr_reader :beta_oidc_service + + # @return [::Zitadel::Client::Api::BetaOrganizationServiceApi] + attr_reader :beta_organization_service + + # @return [::Zitadel::Client::Api::BetaProjectServiceApi] + attr_reader :beta_project_service + + # @return [::Zitadel::Client::Api::BetaSessionServiceApi] + attr_reader :beta_session_service + + # @return [::Zitadel::Client::Api::BetaSettingsServiceApi] + attr_reader :beta_settings_service + + # @return [::Zitadel::Client::Api::BetaTelemetryServiceApi] + attr_reader :beta_telemetry_service + + # @return [::Zitadel::Client::Api::BetaUserServiceApi] + attr_reader :beta_user_service + + # @return [::Zitadel::Client::Api::BetaWebKeyServiceApi] + attr_reader :beta_web_key_service + + # @return [::Zitadel::Client::Api::FeatureServiceApi] + attr_reader :feature_service + + # @return [::Zitadel::Client::Api::IdentityProviderServiceApi] + attr_reader :identity_provider_service + + # @return [::Zitadel::Client::Api::InstanceServiceApi] + attr_reader :instance_service + + # @return [::Zitadel::Client::Api::InternalPermissionServiceApi] + attr_reader :internal_permission_service + + # @return [::Zitadel::Client::Api::OIDCServiceApi] + attr_reader :oidc_service + + # @return [::Zitadel::Client::Api::OrganizationServiceApi] + attr_reader :organization_service + + # @return [::Zitadel::Client::Api::ProjectServiceApi] + attr_reader :project_service + + # @return [::Zitadel::Client::Api::SAMLServiceApi] + attr_reader :saml_service + + # @return [::Zitadel::Client::Api::SessionServiceApi] + attr_reader :session_service + + # @return [::Zitadel::Client::Api::SettingsServiceApi] + attr_reader :settings_service + + # @return [::Zitadel::Client::Api::UserServiceApi] + attr_reader :user_service + + # @return [::Zitadel::Client::Api::WebKeyServiceApi] + attr_reader :web_key_service + + # Creates a new client with the given authenticator and optional transport options. + # + # If the authenticator includes {Auth::HttpAwareAuthenticator}, the shared + # {ApiClient} is injected so that token exchange and discovery requests + # use the same proxy, TLS, and timeout settings. + # + # @param authenticator [Auth::Authenticator] Provides host URL and auth headers. + # @param transport_options [TransportOptions, nil] HTTP transport configuration. + def initialize(authenticator, transport_options = nil) + transport_options ||= TransportOptions.builder.build + api_client = DefaultApiClient.new(transport_options) + authenticator.api_client = api_client if authenticator.is_a?(Auth::HttpAwareAuthenticator) + + config = Configuration.builder + .base_url(authenticator.host) + .build + @action_service = Api::ActionServiceApi.new(api_client, config, authenticator) + @application_service = Api::ApplicationServiceApi.new(api_client, config, authenticator) + @authorization_service = Api::AuthorizationServiceApi.new(api_client, config, authenticator) + @beta_action_service = Api::BetaActionServiceApi.new(api_client, config, authenticator) + @beta_app_service = Api::BetaAppServiceApi.new(api_client, config, authenticator) + @beta_authorization_service = Api::BetaAuthorizationServiceApi.new(api_client, config, authenticator) + @beta_feature_service = Api::BetaFeatureServiceApi.new(api_client, config, authenticator) + @beta_instance_service = Api::BetaInstanceServiceApi.new(api_client, config, authenticator) + @beta_internal_permission_service = Api::BetaInternalPermissionServiceApi.new(api_client, config, authenticator) + @beta_oidc_service = Api::BetaOIDCServiceApi.new(api_client, config, authenticator) + @beta_organization_service = Api::BetaOrganizationServiceApi.new(api_client, config, authenticator) + @beta_project_service = Api::BetaProjectServiceApi.new(api_client, config, authenticator) + @beta_session_service = Api::BetaSessionServiceApi.new(api_client, config, authenticator) + @beta_settings_service = Api::BetaSettingsServiceApi.new(api_client, config, authenticator) + @beta_telemetry_service = Api::BetaTelemetryServiceApi.new(api_client, config, authenticator) + @beta_user_service = Api::BetaUserServiceApi.new(api_client, config, authenticator) + @beta_web_key_service = Api::BetaWebKeyServiceApi.new(api_client, config, authenticator) + @feature_service = Api::FeatureServiceApi.new(api_client, config, authenticator) + @identity_provider_service = Api::IdentityProviderServiceApi.new(api_client, config, authenticator) + @instance_service = Api::InstanceServiceApi.new(api_client, config, authenticator) + @internal_permission_service = Api::InternalPermissionServiceApi.new(api_client, config, authenticator) + @oidc_service = Api::OIDCServiceApi.new(api_client, config, authenticator) + @organization_service = Api::OrganizationServiceApi.new(api_client, config, authenticator) + @project_service = Api::ProjectServiceApi.new(api_client, config, authenticator) + @saml_service = Api::SAMLServiceApi.new(api_client, config, authenticator) + @session_service = Api::SessionServiceApi.new(api_client, config, authenticator) + @settings_service = Api::SettingsServiceApi.new(api_client, config, authenticator) + @user_service = Api::UserServiceApi.new(api_client, config, authenticator) + @web_key_service = Api::WebKeyServiceApi.new(api_client, config, authenticator) + end + + # Creates a client authenticated with a static Bearer token. + # @param host [String] API base URL. + # @param access_token [String] Bearer token. + # @param transport_options [TransportOptions, nil] Optional HTTP transport configuration. + # @return [Zitadel] Configured client instance. + def self.with_token(host, access_token, transport_options = nil) + new(Auth::BearerAuthenticator.new(host, access_token), transport_options) + end + + # Creates a client from a ready-made authenticator. + # + # This is the generic entry point for bespoke authentication strategies + # such as OAuth2 client credentials, JWT private-key (JWT bearer), or a + # personal access token (PAT). Build the appropriate {Auth::Authenticator} + # and pass it here; use {.with_token} for the simple static Bearer case. # - # Initializes and configures the SDK with the provided authentication strategy. - # Sets up service APIs for interacting with various Zitadel features. - # noinspection RubyTooManyInstanceVariablesInspection - class Zitadel # rubocop:disable Metrics/ClassLength - attr_reader :features, - :idps, - :instances, - :internal_permissions, - :oidc, - :organizations, - :projects, - :saml, - :sessions, - :settings, - :users, - :webkeys, - :actions, - :applications, - :authorizations, - # Beta services - :beta_projects, - :beta_apps, - :beta_oidc, - :beta_users, - :beta_organizations, - :beta_settings, - :beta_permissions, - :beta_authorizations, - :beta_sessions, - :beta_instance, - :beta_telemetry, - :beta_features, - :beta_webkeys, - :beta_actions - - # Initialize the Zitadel SDK. - # - # @param authenticator [Authenticator] the authentication strategy to use - # rubocop:disable Metrics/MethodLength, Metrics/AbcSize - def initialize(authenticator) - # noinspection RubyArgCount - @configuration = Configuration.new(authenticator) - yield @configuration if block_given? - - client = ApiClient.new(@configuration) - - @features = Api::FeatureServiceApi.new(client) - @idps = Api::IdentityProviderServiceApi.new(client) - @oidc = Api::OIDCServiceApi.new(client) - @organizations = Api::OrganizationServiceApi.new(client) - @saml = Api::SAMLServiceApi.new(client) - @sessions = Api::SessionServiceApi.new(client) - @settings = Api::SettingsServiceApi.new(client) - @users = Api::UserServiceApi.new(client) - @webkeys = Api::WebKeyServiceApi.new(client) - @actions = Api::ActionServiceApi.new(client) - @applications = Api::ApplicationServiceApi.new(client) - @authorizations = Api::AuthorizationServiceApi.new(client) - @beta_projects = Api::BetaProjectServiceApi.new(client) - @beta_apps = Api::BetaAppServiceApi.new(client) - @beta_oidc = Api::BetaOIDCServiceApi.new(client) - @beta_users = Api::BetaUserServiceApi.new(client) - @beta_organizations = Api::BetaOrganizationServiceApi.new(client) - @beta_settings = Api::BetaSettingsServiceApi.new(client) - @beta_permissions = Api::BetaInternalPermissionServiceApi.new(client) - @beta_authorizations = Api::BetaAuthorizationServiceApi.new(client) - @beta_sessions = Api::BetaSessionServiceApi.new(client) - @beta_instance = Api::BetaInstanceServiceApi.new(client) - @beta_telemetry = Api::BetaTelemetryServiceApi.new(client) - @instances = Api::InstanceServiceApi.new(client) - @internal_permissions = Api::InternalPermissionServiceApi.new(client) - @beta_features = Api::BetaFeatureServiceApi.new(client) - @beta_webkeys = Api::BetaWebKeyServiceApi.new(client) - @beta_actions = Api::BetaActionServiceApi.new(client) - @projects = Api::ProjectServiceApi.new(client) - end - - # rubocop:enable Metrics/MethodLength, Metrics/AbcSize - - class << self - # @!group Authentication Entry Points - - # Initialize the SDK with a Personal Access Token (PAT). - # - # @param host [String] API URL (e.g. "https://api.zitadel.example.com"). - # @param access_token [String] Personal Access Token for Bearer authentication. - # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # @return [Zitadel] Configured Zitadel client instance. - # @see https://zitadel.com/docs/guides/integrate/service-users/personal-access-token - def with_access_token(host, access_token, transport_options: nil, &block) - resolved = transport_options || TransportOptions.defaults - new(Auth::PersonalAccessTokenAuthenticator.new(host, access_token)) do |config| - apply_transport_options(config, resolved) - block&.call(config) - end - end - - # Initialize the SDK using OAuth2 Client Credentials flow. - # - # @param host [String] API URL. - # @param client_id [String] OAuth2 client identifier. - # @param client_secret [String] OAuth2 client secret. - # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # @return [Zitadel] Configured Zitadel client instance with token auto-refresh. - # @see https://zitadel.com/docs/guides/integrate/service-users/client-credentials - def with_client_credentials(host, client_id, client_secret, transport_options: nil, &block) - resolved = transport_options || TransportOptions.defaults - new( - Auth::ClientCredentialsAuthenticator - .builder(host, client_id, client_secret, transport_options: resolved) - .build - ) do |config| - apply_transport_options(config, resolved) - block&.call(config) - end - end - - # Initialize the SDK via Private Key JWT assertion. - # - # @param host [String] API URL. - # @param key_file [String] Path to service account JSON/PEM key file. - # @param transport_options [TransportOptions, nil] Optional transport options for TLS, proxy, and headers. - # @return [Zitadel] Configured Zitadel client instance using JWT assertion. - # @see https://zitadel.com/docs/guides/integrate/service-users/private-key-jwt - def with_private_key(host, key_file, transport_options: nil, &block) - resolved = transport_options || TransportOptions.defaults - new(Auth::WebTokenAuthenticator.from_json(host, key_file, - transport_options: resolved)) do |config| - apply_transport_options(config, resolved) - block&.call(config) - end - end - - # @!endgroup - - private - - def apply_transport_options(config, resolved) - config.default_headers = resolved.default_headers.dup - config.ssl_ca_cert = resolved.ca_cert_path if resolved.ca_cert_path - if resolved.insecure - config.verify_ssl = false - config.verify_ssl_host = false - end - config.proxy_url = resolved.proxy_url if resolved.proxy_url - end - end + # @param authenticator [Auth::Authenticator] Provides host URL and auth headers. + # @param transport_options [TransportOptions, nil] Optional HTTP transport configuration. + # @return [Zitadel] Configured client instance. + def self.with_authenticator(authenticator, transport_options = nil) + new(authenticator, transport_options) end end end diff --git a/lib/zitadel/client/zitadel_error.rb b/lib/zitadel/client/zitadel_error.rb index 46d534f8..6f451cd8 100644 --- a/lib/zitadel/client/zitadel_error.rb +++ b/lib/zitadel/client/zitadel_error.rb @@ -1,9 +1,15 @@ # frozen_string_literal: true +# rubocop:disable all +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + module Zitadel module Client - ## - # Base error for all Zitadel client exceptions. class ZitadelError < StandardError end end diff --git a/lib/zitadel_client.rb b/lib/zitadel_client.rb index d3c1abda..7bdce046 100644 --- a/lib/zitadel_client.rb +++ b/lib/zitadel_client.rb @@ -2,8 +2,14 @@ require 'zeitwerk' require 'warning' +require_relative 'zitadel_inflector' Warning.ignore(:method_redefined, __dir__) +# Every dry-struct model file re-opens the shared +Types+ helper module and +# re-runs +Dry.Types()+, which re-assigns constants such as +Types::Builder+. +# That is intentional and harmless, but Ruby warns "already initialized +# constant" for each one; silence those for files under this SDK. +Warning.ignore(/already initialized constant/, __dir__) # Main entrypoint for the Zitadel::Client Ruby SDK. # @@ -36,6 +42,6 @@ module Client loader = Zeitwerk::Loader.new loader.tag = File.basename(__FILE__, '.rb') +loader.inflector = ZitadelInflector.new loader.push_dir("#{__dir__}/zitadel", namespace: Zitadel) -loader.inflector.inflect('version' => 'VERSION') loader.setup diff --git a/lib/zitadel_inflector.rb b/lib/zitadel_inflector.rb new file mode 100644 index 00000000..0d186219 --- /dev/null +++ b/lib/zitadel_inflector.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +require 'zeitwerk' + +# Custom Zeitwerk inflector for the generated SDK. +# +# The OpenAPI generator emits compact, acronym-aware constant names +# (+OIDCServiceApi+, +UserServiceRedirectURLs+, +IdentityProviderServiceLDAPConfig+) +# from snake_case filenames whose acronyms cannot be recovered by Zeitwerk's +# default camelization (which would produce +OidcServiceApi+ etc.). Rather than +# enumerating every acronym, this inflector reads the constant the file actually +# declares — the first +class+/+module+ whose name is not a namespace segment — +# and uses that verbatim. It falls back to the default camelization for the +# handful of files whose only declaration is a namespace segment +# (e.g. +client.rb+ -> +Client+, +zitadel.rb+ -> +Zitadel+). +class ZitadelInflector < Zeitwerk::Inflector + # Declaration names that are namespace scaffolding rather than the file's + # own top-level constant: the module tree the generator nests every file + # under, plus the +Types+ helper module dry-struct models open at the top + # of each file. + IGNORED_DECLARATIONS = %w[Zitadel Client Api Auth Errors Models Types].freeze + + # Matches the first +class+/+module+ keyword and the constant name it declares. + DECLARATION = /^\s*(class|module)\s+([A-Za-z0-9_]+)/ + + def camelize(basename, abspath) + return 'VERSION' if basename == 'version' + + leaf_constant(abspath) || super + end + + private + + # The constant a file is expected to define: the first +class+ declaration + # that is not namespace scaffolding (dry-struct models and enums), falling + # back to the first such +module+ for the remaining hand-written/generated + # support files. + def leaf_constant(abspath) + return nil unless File.file?(abspath) + + declarations = each_declaration(abspath) + klass = declarations.find { |kind, _| kind == 'class' } + (klass || declarations.first)&.last + end + + # The non-scaffolding +[kind, name]+ declarations a file makes, in order. + def each_declaration(abspath) + File.foreach(abspath).filter_map do |line| + kind, name = DECLARATION.match(line)&.captures + next if name.nil? || IGNORED_DECLARATIONS.include?(name) + + [kind, name] + end + end +end diff --git a/proc.yml b/proc.yml new file mode 100644 index 00000000..fa944cd0 --- /dev/null +++ b/proc.yml @@ -0,0 +1,9 @@ +gemName: zitadel-client +gemVersion: 0.0.1 +moduleName: Zitadel::Client +disallowAdditionalPropertiesIfNotPresent: false +generateUnitTests: true +repoName: git@github.com:zitadel/client-ruby.git +generatorName: ruby-plus +apiErrorParent: ZitadelError +clientClassName: Zitadel diff --git a/qodana.yaml b/qodana.yaml index c18cd1ff..4b3b845f 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -3,10 +3,52 @@ version: "1.0" profile: name: qodana.recommended +# Ruby support is EAP and its static type-analysis (RBS resolution, argument +# /type checking) is both noisy and redundant with Steep, which is this repo's +# authoritative type checker and already passes. Vendored third-party RBS +# (.gem_rbs_collection) and the SDK's own sig/ tree are Steep's domain, not +# Qodana's, so they are excluded; the type-analysis inspections are scoped out. exclude: - name: All paths: + # Test code legitimately uses fixture classes, descriptive names and + # reaches into internals; production-grade IDE inspections are noise here. + - test + - spec - lib/zitadel/client/api - lib/zitadel/client/models + - .gem_rbs_collection + - sig + - name: RbsDuplicateDeclarations + - name: RbsInvalidMethodOverload + - name: RubyResolve + - name: RubyInterpreter + - name: RubyMismatchedArgumentType + - name: RubyMismatchedParameterType + - name: RubyMismatchedReturnType + - name: RubyMismatchedVariableType + - name: RubyMismatchedConstantType + - name: RubyIncorrectArgumentCount + - name: RubyNilAnalysis + - name: GemInspection + # The generated Client aggregates one accessor per service API, so the + # instance-variable count is inherent to the SDK surface, not a smell. + - name: RubyTooManyInstanceVariablesInspection + # $VERBOSE is a Ruby-defined global; the naming-convention check misfires on + # built-in globals set in the test harness (spec/spec_helper.rb). + - name: RubyGlobalVariableNamingConvention + # False positive: the \# in HeaderSelector's JSON MIME regex is required — + # dropping it makes Ruby interpolate #$& and silently breaks the pattern. + - name: RegExpRedundantEscape + # Cosmetic-only and confined to generated files; path-scoped so bespoke code + # keeps full coverage. The unused parameter is an abstract setter stub that + # always raises; the inner collection case is exhaustively guarded by the + # enclosing when, so an else would be dead code. + - name: RubyUnusedLocalVariable + paths: + - lib/zitadel/client/auth/http_aware_authenticator.rb + - name: RubyCaseWithoutElseBlockInspection + paths: + - lib/zitadel/client/object_serializer.rb -linter: jetbrains/qodana-php:2025.1 +linter: jetbrains/qodana-ruby:2026.1-eap-ruby3.4 diff --git a/rbs_collection.lock.yaml b/rbs_collection.lock.yaml new file mode 100644 index 00000000..e354326d --- /dev/null +++ b/rbs_collection.lock.yaml @@ -0,0 +1,104 @@ +--- +path: ".gem_rbs_collection" +gems: +- name: base64 + version: 0.3.0 + source: + type: rubygems +- name: bigdecimal + version: '3.1' + source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: concurrent-ruby + version: '1.1' + source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: faraday + version: '2.7' + source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: fileutils + version: '0' + source: + type: stdlib +- name: forwardable + version: '0' + source: + type: stdlib +- name: json + version: '0' + source: + type: stdlib +- name: jwt + version: '2.5' + source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: logger + version: '1.7' + source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: minitest + version: '5.25' + source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: monitor + version: '0' + source: + type: stdlib +- name: net-http + version: '0' + source: + type: stdlib +- name: net-protocol + version: '0' + source: + type: stdlib +- name: rake + version: '13.0' + source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: simplecov + version: '0.22' + source: + type: git + name: ruby/gem_rbs_collection + revision: 3f5e8df1ce89ea06067fa42263012c968b4e583e + remote: https://github.com/ruby/gem_rbs_collection.git + repo_dir: gems +- name: timeout + version: '0' + source: + type: stdlib +- name: uri + version: '0' + source: + type: stdlib +gemfile_lock_path: Gemfile.lock diff --git a/rbs_collection.yaml b/rbs_collection.yaml new file mode 100644 index 00000000..66e30ecf --- /dev/null +++ b/rbs_collection.yaml @@ -0,0 +1,19 @@ +# Download sources +sources: + - type: git + name: ruby/gem_rbs_collection + remote: https://github.com/ruby/gem_rbs_collection.git + revision: main + repo_dir: gems + +# You can specify local directories as sources also. +# - type: local +# path: path/to/your/local/repository + +# A directory to install the downloaded RBSs +path: .gem_rbs_collection + +# gems: +# # If you want to avoid installing rbs files for gems, you can specify them here. +# - name: GEM_NAME +# ignore: true diff --git a/sig/infrastructure.rbs b/sig/infrastructure.rbs new file mode 100644 index 00000000..a0b531ce --- /dev/null +++ b/sig/infrastructure.rbs @@ -0,0 +1,309 @@ +module Zitadel::Client + def self.configure: () { (Configuration::Builder) -> void } -> void + | () -> Configuration + + VERSION: String + + class Configuration + attr_reader base_url: String + attr_reader default_headers: Hash[String, String] + def initialize: (base_url: String, default_headers: Hash[String, String]) -> void + def self.builder: () -> Configuration::Builder + def self.default: () -> Configuration + def self.default=: (Configuration) -> Configuration + + class Builder + def base_url: (String) -> Builder + def default_header: (String, String) -> Builder + def default_headers: (Hash[String, String]) -> Builder + def server: (ServerConfiguration, ?Hash[String, String]) -> Builder + def build: () -> Configuration + end + end + + class TransportOptions + attr_reader verify_ssl: bool + attr_reader ca_cert_path: String? + attr_reader proxy: String? + attr_reader timeout: Integer? + attr_reader follow_redirects: bool + attr_reader max_redirects: Integer? + attr_reader user_agent: String? + attr_reader default_headers: Hash[String, String] + attr_reader inject_request_id: bool + def initialize: (verify_ssl: bool, ca_cert_path: String?, proxy: String?, timeout: Integer?, follow_redirects: bool, max_redirects: Integer?, user_agent: String?, default_headers: Hash[String, String], inject_request_id: bool) -> void + def self.builder: () -> TransportOptions::Builder + + class Builder + def verify_ssl: (bool) -> Builder + def ca_cert_path: (String?) -> Builder + def proxy: (String?) -> Builder + def timeout: (Integer?) -> Builder + def follow_redirects: (bool) -> Builder + def max_redirects: (Integer?) -> Builder + def user_agent: (String?) -> Builder + def default_header: (String, String) -> Builder + def default_headers: (Hash[String, String]) -> Builder + def inject_request_id: (bool) -> Builder + def build: () -> TransportOptions + end + end + + class ServerVariable + attr_reader default_value: String + attr_reader description: String? + attr_reader enum_values: Array[String] + def initialize: (default_value: String, ?description: String?, ?enum_values: Array[String]) -> void + end + + class ServerConfiguration + attr_reader url_template: String + attr_reader description: String? + attr_reader variables: Hash[String, ServerVariable] + def initialize: (url_template: String, ?description: String?, ?variables: Hash[String, ServerVariable]) -> void + def url: (?Hash[String, String]) -> String + end + + module Servers + SERVER_0: ServerConfiguration + ALL: Array[ServerConfiguration] + end + + class ApiHttpResponse + attr_reader status_code: Integer + attr_reader body: String + attr_reader headers: Hash[String, String] + def initialize: (status_code: Integer, body: String, headers: Hash[String, String]) -> void + end + + class ApiResult[T] + attr_reader status_code: Integer + attr_reader data: T + attr_reader raw_body: String + attr_reader headers: Hash[String, String] + def initialize: (status_code: Integer, data: T, raw_body: String, headers: Hash[String, String]) -> void + end + + class ApiError < ZitadelError + attr_reader status_code: Integer? + attr_reader response_headers: Hash[String, String]? + attr_reader response_body: String? + def initialize: (?untyped) -> void + def message: () -> String + def typed_error_body: (untyped) -> untyped + end + + module Errors + class ClientError < ApiError + end + + class BadRequestError < ClientError + def initialize: (?message: untyped, ?response_body: untyped, ?error_body: untyped) -> void + end + + class UnauthorizedError < ClientError + def initialize: (?message: untyped, ?response_body: untyped, ?error_body: untyped) -> void + end + + class ForbiddenError < ClientError + def initialize: (?message: untyped, ?response_body: untyped, ?error_body: untyped) -> void + end + + class NotFoundError < ClientError + def initialize: (?message: untyped, ?response_body: untyped, ?error_body: untyped) -> void + end + + class ConflictError < ClientError + def initialize: (?message: untyped, ?response_body: untyped, ?error_body: untyped) -> void + end + + class UnprocessableEntityError < ClientError + def initialize: (?message: untyped, ?response_body: untyped, ?error_body: untyped) -> void + end + + class ServerError < ApiError + end + + class InternalServerError < ServerError + def initialize: (?message: untyped, ?response_body: untyped, ?error_body: untyped) -> void + end + end + + class ApiClient + def send_request: (Symbol, String, Hash[String, String], untyped, ?no_redirect: bool) -> ApiHttpResponse + end + + class DefaultApiClient < ApiClient + EXTRA_SENSITIVE_HEADER_NAMES: Array[String] + def initialize: (?TransportOptions?) -> void + def send_request: (Symbol, String, Hash[String, String], untyped, ?no_redirect: bool) -> ApiHttpResponse + def close: () -> void + def self.supported_encodings: () -> String + private + def validate_ca_cert_path: (String?) -> void + def https_to_http_downgrade?: (String, String) -> bool + def text_content_type?: (String) -> bool + def decode_text_body: (String, String?) -> String + def detect_encoding: (String?) -> Encoding + def decompress_body: (untyped, untyped) -> untyped + def connection: () -> untyped + def build_connection: () -> untyped + def build_multipart_body: (Hash[String, untyped], String) -> String + def multipart_part: (String, untyped, String) -> String + def sanitize_multipart_field_name: (String | Symbol) -> String + def build_content_disposition: (String | Symbol, String?) -> String + def sniff_part_mime: (String?) -> String + def redirect_status?: (Integer | String) -> bool + def resolve_url: (String, String) -> String? + def safe_parse_uri: (String) -> URI::Generic? + def same_origin?: (String, String) -> bool + def effective_port: (URI::Generic) -> Integer + end + + UUID_REGEX: Regexp + + class SerializationError < ZitadelError + attr_reader cause: Exception? + def initialize: (String, ?Exception?) -> void + end + + class SchemaMismatchError < ZitadelError + end + + class ValueSerializer + def self.serialize: (untyped, Symbol, String, ?collection_format: Symbol?) -> untyped + def self.serialize_styled: (String, untyped, Symbol, String, Symbol?, String?, bool) -> untyped + def self.serialize_deep_object: (String, Hash[String, untyped]?) -> Hash[String, String] + + PRESERVE_ENCODED: Hash[String, String] + + private + + def self.serialize_nil: (Symbol) -> untyped + def self.serialize_array: (Array[untyped], Symbol, Symbol?) -> untyped + def self.serialize_query_array: (Array[untyped], Symbol?) -> untyped + def self.encode_path_segment: (String str) -> String + def self.encode_item: (untyped value, Symbol location) -> String + end + + class ObjectSerializer + DEFAULT_DATETIME_FORMAT: String + PROTOBUF_DURATION_REGEX: Regexp + def self.stringify: (untyped) -> String + def self.serialize: (untyped) -> String + def self.deserialize: (untyped, String) -> untyped + def self.to_path_value: (untyped) -> String + def self.to_query_value: (untyped, ?Symbol?) -> untyped + def self.to_header_value: (untyped) -> String + def self.to_cookie_value: (untyped) -> String + def self.to_form_value: (untyped) -> String + def self.convert_to_type: (untyped, String) -> untyped + def self.find_and_cast_into_type: (untyped, untyped) -> untyped + def self.sanitize_for_serialization: (untyped, ?Set[Integer]) -> untyped + def self.deserialize_model: (untyped, untyped) -> untyped + def self.resolve_one_of: (untyped, Array[Proc]) -> untyped + def self.resolve_any_of: (untyped, Array[Proc]) -> untyped + def self.apply_format_on_deserialize: (untyped, String?) -> untyped + def self.apply_format_on_serialize: (untyped, String?) -> untyped + def self.validate_uuid: (untyped) -> String + def self.encode_byte: (untyped) -> String + def self.decode_byte: (untyped) -> String + def self.duration_to_protobuf_json: (ISO8601::Duration) -> String + def self.duration_from_protobuf_json: (String) -> ISO8601::Duration + end + + class TraceContextUtil + def self.inject_trace_context: (Hash[String, String]) -> void + end + + class HeaderSelector + JSON_MIME_PATTERN: Regexp + def select_headers: (Array[String], String, bool) -> Hash[String, String] + def json_mime?: (String?) -> bool + private + def select_accept_header: (Array[String]?) -> String? + end + + module Auth + class Authenticator + def host: () -> String + def auth_headers: () -> Hash[String, String] + def query_params: () -> Hash[String, String] + def cookie_params: () -> Hash[String, String] + end + + class BaseAuthenticator < Authenticator + def query_params: () -> Hash[String, String] + def cookie_params: () -> Hash[String, String] + end + + module HttpAwareAuthenticator + def api_client=: (ApiClient) -> void + end + + class BearerAuthenticator < BaseAuthenticator + def initialize: (String, String) -> void + def inspect: () -> String + def to_s: () -> String + end + end + + class Zitadel + attr_reader action_service: Api::ActionServiceApi + attr_reader application_service: Api::ApplicationServiceApi + attr_reader authorization_service: Api::AuthorizationServiceApi + attr_reader beta_action_service: Api::BetaActionServiceApi + attr_reader beta_app_service: Api::BetaAppServiceApi + attr_reader beta_authorization_service: Api::BetaAuthorizationServiceApi + attr_reader beta_feature_service: Api::BetaFeatureServiceApi + attr_reader beta_instance_service: Api::BetaInstanceServiceApi + attr_reader beta_internal_permission_service: Api::BetaInternalPermissionServiceApi + attr_reader beta_oidc_service: Api::BetaOIDCServiceApi + attr_reader beta_organization_service: Api::BetaOrganizationServiceApi + attr_reader beta_project_service: Api::BetaProjectServiceApi + attr_reader beta_session_service: Api::BetaSessionServiceApi + attr_reader beta_settings_service: Api::BetaSettingsServiceApi + attr_reader beta_telemetry_service: Api::BetaTelemetryServiceApi + attr_reader beta_user_service: Api::BetaUserServiceApi + attr_reader beta_web_key_service: Api::BetaWebKeyServiceApi + attr_reader feature_service: Api::FeatureServiceApi + attr_reader identity_provider_service: Api::IdentityProviderServiceApi + attr_reader instance_service: Api::InstanceServiceApi + attr_reader internal_permission_service: Api::InternalPermissionServiceApi + attr_reader oidc_service: Api::OIDCServiceApi + attr_reader organization_service: Api::OrganizationServiceApi + attr_reader project_service: Api::ProjectServiceApi + attr_reader saml_service: Api::SAMLServiceApi + attr_reader session_service: Api::SessionServiceApi + attr_reader settings_service: Api::SettingsServiceApi + attr_reader user_service: Api::UserServiceApi + attr_reader web_key_service: Api::WebKeyServiceApi + def initialize: (Auth::Authenticator, ?TransportOptions?) -> void + def self.with_token: (String, String) -> Zitadel + def self.with_authenticator: (Auth::Authenticator, ?TransportOptions?) -> Zitadel + end + + module Models + end + + module Api + class BaseApi + attr_reader config: Configuration + def initialize: (?ApiClient?, ?Configuration, ?Auth::Authenticator?) -> void + def invoke_api_for_result: (Symbol, String, Hash[String, untyped], Hash[String, String], untyped, Array[String], String?, String?, Auth::Authenticator?) -> ApiResult[untyped] + def invoke_api: (Symbol, String, Hash[String, untyped], Hash[String, String], untyped, Array[String], String?, String?, Auth::Authenticator?) -> untyped + private + def throw_api_error: (ApiHttpResponse) -> void + def build_query_string: (Hash[String, untyped]) -> String + def serialize_body: (untyped, String?) -> untyped + def binary_return_type?: (String?) -> bool + def text_response_content_type?: (String?) -> bool + end + end +end + +module MIME + class Types + def self.type_for: (String) -> Array[untyped] + end +end diff --git a/sig/lib.rbs b/sig/lib.rbs index 5f340e08..e9452f45 100644 --- a/sig/lib.rbs +++ b/sig/lib.rbs @@ -1,388 +1,185 @@ +# Hand-written RBS for the keep-listed (hand-written) sources. +# +# The code generator emits signatures only for the files it generates +# (sig/infrastructure.rbs, sig/vendor.rbs and the per-model/per-api files under +# sig/zitadel/). The bespoke, keep-listed sources have no generated signature, +# so their types are declared here: +# - lib/zitadel/client/zitadel.rb (the `Zitadel` facade) +# - lib/zitadel/client/zitadel_error.rb (`ZitadelError`) +# - lib/zitadel/client/utils/url_util.rb (`Utils::UrlUtil`) +# - lib/zitadel/client/auth/*.rb (the bespoke authenticators) +# +# This file also provides the plain `module Zitadel` / `module Client` namespace +# anchor. Every generated signature uses the qualified `module Zitadel::Client` +# form, and RBS only resolves `::Zitadel::...` references once the outer +# namespace is declared with the nested form. +# +# Types owned by the generated signatures (Configuration, ApiClient, ApiError, +# TransportOptions, module Api, module Models, VERSION, Auth::Authenticator, +# Auth::BaseAuthenticator, Auth::HttpAwareAuthenticator) are intentionally NOT +# redeclared here. module Zitadel - module Client - - VERSION: String - - module Models - + class ZitadelError < StandardError end module Utils class UrlUtil - - def self.build_hostname: (String) -> String + def self.build_hostname: (String host) -> String end end - module Api - class FeatureServiceApi - def initialize: (ApiClient) -> void - end - - class IdentityProviderServiceApi - def initialize: (ApiClient) -> void - end - - class OIDCServiceApi - def initialize: (ApiClient) -> void - end - - class OrganizationServiceApi - def initialize: (ApiClient) -> void - end - - class SessionServiceApi - def initialize: (ApiClient) -> void - end - - class SettingsServiceApi - def initialize: (ApiClient) -> void - end + module Auth + class OpenId + attr_accessor host_endpoint: String + attr_accessor token_endpoint: String - class UserServiceApi - def initialize: (ApiClient) -> void - end + def initialize: (String hostname, ?transport_options: TransportOptions?) -> void - class WebKeyServiceApi - def initialize: (ApiClient) -> void - end + def self.build_well_known_url: (String hostname) -> String - class ActionServiceApi - def initialize: (ApiClient) -> void - end + private - class SAMLServiceApi - def initialize: (ApiClient) -> void - end + def fetch_token_endpoint: (URI::Generic uri, TransportOptions transport_options) -> String - # Beta Service APIs - class BetaProjectServiceApi - def initialize: (ApiClient) -> void - end + def build_http_client: (URI::Generic uri, TransportOptions transport_options) -> Net::HTTP - class BetaAppServiceApi - def initialize: (ApiClient) -> void - end + def new_http: (URI::Generic uri, String? proxy) -> Net::HTTP - class BetaOIDCServiceApi - def initialize: (ApiClient) -> void + def configure_tls: (Net::HTTP http, TransportOptions transport_options) -> void end - class BetaUserServiceApi - def initialize: (ApiClient) -> void - end - - class BetaOrganizationServiceApi - def initialize: (ApiClient) -> void - end - - class BetaSettingsServiceApi - def initialize: (ApiClient) -> void - end + class NoAuthAuthenticator < BaseAuthenticator + attr_reader host: String - class BetaInternalPermissionServiceApi - def initialize: (ApiClient) -> void - end + def initialize: (?String host) -> void - class BetaAuthorizationServiceApi - def initialize: (ApiClient) -> void + def auth_headers: () -> Hash[String, String] end - class BetaSessionServiceApi - def initialize: (ApiClient) -> void - end + class PersonalAccessTokenAuthenticator < BaseAuthenticator + attr_reader host: String - class BetaInstanceServiceApi - def initialize: (ApiClient) -> void - end + def initialize: (String host, String token) -> void - class BetaTelemetryServiceApi - def initialize: (ApiClient) -> void - end + def auth_headers: () -> Hash[String, String] - class BetaFeatureServiceApi - def initialize: (ApiClient) -> void - end + def inspect: () -> String - class BetaWebKeyServiceApi - def initialize: (ApiClient) -> void - end + def to_s: () -> String - class BetaActionServiceApi - def initialize: (ApiClient) -> void + def self.build_hostname: (String host) -> String end - end - - class Configuration - USER_AGENT: String - - @@default: Configuration - - attr_reader authenticator: Auth::Authenticator - attr_accessor debugging: bool - attr_accessor logger: untyped - attr_accessor temp_folder_path: String - attr_accessor timeout: Integer - attr_accessor client_side_validation: bool - attr_accessor user_agent: String - attr_accessor verify_ssl: bool - attr_accessor verify_ssl_host: bool - attr_accessor ssl_ca_cert: String? - attr_accessor cert_file: String? - attr_accessor key_file: String? - attr_accessor params_encoding: Symbol? - attr_accessor default_headers: Hash[String, String] - attr_accessor proxy_url: String? - - def self.default: () -> Configuration - - def initialize: (?Auth::Authenticator) ?{ (Configuration) -> untyped } -> void - - def configure: () ?{ (Configuration) -> untyped } -> void - - end - - class ApiClient - - @config: Configuration - @default_headers: Hash[String, String] - @user_agent: String - - attr_accessor config: Configuration - - attr_accessor default_headers: Hash[String, String] - - def initialize: (?Configuration) -> void - - def self.default: () -> untyped - - def call_api: (untyped http_method, untyped path, ?::Hash[untyped, untyped] opts) -> ::Array[untyped] - - def build_request: (Symbol http_method, String path, Hash[Symbol, untyped] opts) -> Typhoeus::Request - def build_request_body: (untyped header_params, untyped form_params, untyped body) -> untyped + class OAuthAuthenticator < BaseAuthenticator + include HttpAwareAuthenticator - def download_file: (untyped request) ?{ (untyped) -> untyped } -> untyped + REFRESH_SKEW_SECONDS: Integer - def ensure_tempfile: (::Tempfile?) -> ::Tempfile + def initialize: (OpenId open_id, String client_id, String scope) -> void - def json_mime?: (untyped mime) -> untyped + def api_client=: (ApiClient client) -> void - def deserialize: (untyped response, untyped return_type) -> (nil | untyped) - - def convert_to_type: (untyped data, untyped return_type) -> (nil | untyped) - - def sanitize_filename: (untyped filename) -> untyped - - def select_header_accept: (untyped accepts) -> (nil | untyped) - - def select_header_content_type: (untyped content_types) -> (nil | untyped) - - def object_to_http_body: (untyped model) -> untyped - - def object_to_hash: (untyped obj) -> untyped - - def build_collection_param: (untyped param, untyped collection_format) -> untyped - end - - class ZitadelError < StandardError - def initialize: (String) -> void - end - - # - # Represents an HTTP error returned from the Zitadel API. - # - # This class captures the HTTP status code, headers, and body, - # and provides a helpful string representation for debugging. - # - class ApiError < ZitadelError - attr_reader code: Integer - attr_reader response_headers: Hash[String, Array[String]] - attr_reader response_body: String | Typhoeus::Response - - def initialize: (Integer, Hash[String, Array[String]], String | Typhoeus::Response) -> void - end - - class TransportOptions - attr_reader default_headers: Hash[String, String] - attr_reader ca_cert_path: String? - attr_reader insecure: bool - attr_reader proxy_url: String? - def initialize: (?default_headers: Hash[String, String], ?ca_cert_path: String?, ?insecure: bool, ?proxy_url: String?) -> void - def self.defaults: -> TransportOptions - def to_connection_opts: -> Hash[Symbol, untyped] - end - - module Auth - - class Authenticator - - @host: String - - attr_reader host: String - - def initialize: (String) -> void + def host: () -> String def auth_headers: () -> Hash[String, String] - end - class ClientCredentialsAuthenticator < OAuthAuthenticator + def auth_token: () -> String - def initialize: (OpenId, String, String, Set[String], ?transport_options: TransportOptions?) -> void + def inspect: () -> String - def get_grant: (OAuth2::Client, String) -> OAuth2::AccessToken + def to_s: () -> String - def self.builder: (String, String, String, ?transport_options: TransportOptions?) -> ClientCredentialsAuthenticatorBuilder + def grant_type: () -> String - class ClientCredentialsAuthenticatorBuilder < OAuthAuthenticatorBuilder - @client_id: String - @client_secret: String + def access_token_options: () -> Hash[String, String] - def initialize: (String, String, String, ?transport_options: TransportOptions?) -> void + def refresh_token: () -> String - def build: -> ClientCredentialsAuthenticator - end + def post_token_request: () -> ApiHttpResponse - end + def require_api_client!: () -> void - class NoAuthAuthenticator < Authenticator + def parse_token_response: (ApiHttpResponse response) -> Hash[String, untyped] - def initialize: (?String) -> void + def decode_token_payload: (ApiHttpResponse response) -> untyped - def auth_headers: () -> Hash[String, String] + def token_error: (String detail, ApiHttpResponse response) -> ApiError + + def expires_at_from: (untyped expires_in) -> Float end class OAuthAuthenticatorBuilder - @auth_scopes: Set[String] - @open_id: OpenId + DEFAULT_SCOPES: Array[String] attr_reader open_id: OpenId attr_reader auth_scopes: Set[String] + attr_reader transport_options: TransportOptions - def initialize: (String, ?transport_options: TransportOptions?) -> void + def initialize: (String host, ?transport_options: TransportOptions?) -> void - def scopes: (*String) -> self + def scopes: (*String auth_scopes) -> self end - class OAuthAuthenticator < Authenticator - @auth_session: OAuth2::Client - @mutex: Thread::Mutex - @open_id: OpenId - @token: OAuth2::AccessToken - @auth_scopes: String - @transport_options: TransportOptions - - def initialize: (OpenId, Set[String], OAuth2::Client, ?transport_options: TransportOptions?) -> void - - def auth_token: () -> String + class ClientCredentialsAuthenticator < OAuthAuthenticator + GRANT_TYPE: String - def auth_headers: () -> Hash[String, String] + def initialize: (OpenId open_id, String client_id, String client_secret, Set[String] auth_scopes) -> void - def get_grant: (OAuth2::Client, String) -> OAuth2::AccessToken + def self.builder: (String host, String client_id, String client_secret, ?transport_options: TransportOptions?) -> ClientCredentialsAuthenticatorBuilder - def refresh_token: () -> OAuth2::AccessToken - end + def grant_type: () -> String - class OpenId - @host_endpoint: String - @token_endpoint: String + def access_token_options: () -> Hash[String, String] - attr_accessor host_endpoint: String - attr_accessor token_endpoint: String - - def initialize: (String, ?transport_options: TransportOptions?) -> void + class ClientCredentialsAuthenticatorBuilder < OAuthAuthenticatorBuilder + def initialize: (String host, String client_id, String client_secret, ?transport_options: TransportOptions?) -> void - def self.build_well_known_url: (String) -> String + def build: () -> ClientCredentialsAuthenticator + end end - class PersonalAccessTokenAuthenticator < Authenticator - @token: String + class WebTokenAuthenticator < OAuthAuthenticator + GRANT_TYPE: String + + class JwtAssertion + attr_reader issuer: String + attr_reader subject: String + attr_reader audience: String + attr_reader private_key: OpenSSL::PKey::RSA + attr_reader lifetime: Integer + attr_reader algorithm: String + attr_reader key_id: String? + + def self.new: (issuer: String, subject: String, audience: String, private_key: OpenSSL::PKey::RSA, lifetime: Integer, algorithm: String, key_id: String?) -> JwtAssertion + end - def initialize: (String, String) -> void + def initialize: (OpenId open_id, String client_id, Set[String] auth_scopes, JwtAssertion assertion) -> void - def auth_headers: -> Hash[String, String] - end + def self.from_json: (String host, String json_path, ?transport_options: TransportOptions?) -> WebTokenAuthenticator - class WebTokenAuthenticator < OAuthAuthenticator - @jwt_algorithm: String - @jwt_audience: String - @jwt_issuer: String - @jwt_lifetime: Integer - @jwt_subject: String - @key_id: String? - @private_key: OpenSSL::PKey::RSA + def self.parse_json_file: (String json_path) -> untyped - def self.builder: (String, String, String, ?transport_options: TransportOptions?) -> WebTokenAuthenticatorBuilder + def self.builder: (String host, String user_id, String private_key, ?transport_options: TransportOptions?) -> WebTokenAuthenticatorBuilder - def self.from_json: (String, String, ?transport_options: TransportOptions?) -> WebTokenAuthenticator + def grant_type: () -> String - def get_grant: (OAuth2::Client, String) -> OAuth2::AccessToken + def access_token_options: () -> Hash[String, String] - def initialize: (OpenId, Set[String], String, String, String, (String | OpenSSL::PKey::PKey), ?jwt_lifetime: Integer, ?jwt_algorithm: String, ?key_id: String?, ?transport_options: TransportOptions?) -> void + def encode_assertion: (JwtAssertion assertion) -> String class WebTokenAuthenticatorBuilder < OAuthAuthenticatorBuilder - @jwt_audience: String - @jwt_issuer: String - @jwt_lifetime: Integer - @jwt_subject: String - @key_id: String - @private_key: String + def initialize: (String host, String user_id, String private_key, ?transport_options: TransportOptions?) -> void - def initialize: (String, String, String, String, String, ?transport_options: TransportOptions?) -> void + def token_lifetime_seconds: (Integer seconds) -> self - def build: -> WebTokenAuthenticator + def jwt_algorithm: (String jwt_algorithm) -> self - def key_identifier: (String) -> self + def key_identifier: (String? key_id) -> self - def token_lifetime_seconds: (Integer) -> self + def build: () -> WebTokenAuthenticator end end end - - class Zitadel - - def self.with_access_token: (String, String, ?transport_options: TransportOptions?) ?{ (Configuration) -> void } -> Zitadel - - def self.with_client_credentials: (String, String, String, ?transport_options: TransportOptions?) ?{ (Configuration) -> void } -> Zitadel - - def self.with_private_key: (String, String, ?transport_options: TransportOptions?) ?{ (Configuration) -> void } -> Zitadel - - private - - def self.apply_transport_options: (Configuration, TransportOptions) -> void - - public - - attr_reader configuration: Configuration - attr_reader features: Api::FeatureServiceApi - attr_reader idps: Api::IdentityProviderServiceApi - attr_reader oidc: Api::OIDCServiceApi - attr_reader organizations: Api::OrganizationServiceApi - attr_reader saml: Api::SAMLServiceApi - attr_reader sessions: Api::SessionServiceApi - attr_reader settings: Api::SettingsServiceApi - attr_reader users: Api::UserServiceApi - attr_reader webkeys: Api::WebKeyServiceApi - attr_reader actions: Api::ActionServiceApi - attr_reader beta_projects: Api::BetaProjectServiceApi - attr_reader beta_apps: Api::BetaAppServiceApi - attr_reader beta_oidc: Api::BetaOIDCServiceApi - attr_reader beta_users: Api::BetaUserServiceApi - attr_reader beta_organizations: Api::BetaOrganizationServiceApi - attr_reader beta_settings: Api::BetaSettingsServiceApi - attr_reader beta_permissions: Api::BetaInternalPermissionServiceApi - attr_reader beta_authorizations: Api::BetaAuthorizationServiceApi - attr_reader beta_sessions: Api::BetaSessionServiceApi - attr_reader beta_instance: Api::BetaInstanceServiceApi - attr_reader beta_telemetry: Api::BetaTelemetryServiceApi - attr_reader beta_features: Api::BetaFeatureServiceApi - attr_reader beta_webkeys: Api::BetaWebKeyServiceApi - attr_reader beta_actions: Api::BetaActionServiceApi - - def initialize: (Auth::Authenticator) ?{ (Configuration) -> void } -> void - - end - end end diff --git a/sig/lib/oauth2/oauth2.rbs b/sig/lib/oauth2/oauth2.rbs deleted file mode 100644 index 13f7833c..00000000 --- a/sig/lib/oauth2/oauth2.rbs +++ /dev/null @@ -1,104 +0,0 @@ -module OAuth2 - - def self.configure: () { (untyped) -> untyped } -> untyped - - class AccessToken - - # Attributes - attr_reader client: Client - attr_reader token: String - attr_reader expires_in: untyped - attr_reader expires_at: Integer? - attr_reader expires_latency: untyped - attr_reader params: Hash[untyped, untyped] - attr_accessor options: Hash[Symbol, untyped] - attr_accessor refresh_token: String? - attr_accessor response: untyped - - # Instance Methods - def initialize: (Client, String, ?Hash[Symbol, untyped]) -> void - - def []: (String) -> untyped - - def expires?: () -> bool - - def expired?: () -> bool - - def refresh: (?Hash[Symbol, untyped], ?Hash[Symbol, untyped]) -> AccessToken - - def to_hash: () -> Hash[untyped, untyped] - - def request: (Symbol, String, ?Hash[Symbol, untyped]) { (untyped) -> untyped } -> untyped - - def get: (String, ?Hash[Symbol, untyped]) { (untyped) -> untyped } -> untyped - - def post: (String, ?Hash[Symbol, untyped]) { (untyped) -> untyped } -> untyped - - def put: (String, ?Hash[Symbol, untyped]) { (untyped) -> untyped } -> untyped - - def patch: (String, ?Hash[Symbol, untyped]) { (untyped) -> untyped } -> untyped - - def delete: (String, ?Hash[Symbol, untyped]) { (untyped) -> untyped } -> untyped - - def headers: () -> Hash[String, String] - - end - - module Strategy - class Base - def initialize: (Client) -> void - end - - class Assertion < Base - def authorize_url: () -> untyped - - def get_token: (Hash[Symbol, untyped], Hash[Symbol, untyped], ?Hash[Symbol, untyped], ?Hash[Symbol, untyped]) -> untyped - end - - class ClientCredentials < Base - def authorize_url: () -> untyped - - def get_token: (?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped - end - - class Password < Strategy::Base - def authorize_url: () -> untyped - - def get_token: (String, String, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped - end - - class Implicit < Base - def authorize_params: (?Hash[untyped, untyped]) -> Hash[untyped, untyped] - - def authorize_url: (?Hash[untyped, untyped]) -> String - - def get_token: (*untyped) -> untyped - end - - class AuthCode < Base - def authorize_params: (?Hash[untyped, untyped]) -> Hash[untyped, untyped] - - def authorize_url: (?Hash[untyped, untyped]) -> String - - def get_token: (String, ?Hash[untyped, untyped], ?Hash[untyped, untyped]) -> untyped - end - end - - class Client - def initialize: (String | nil, String | nil, Hash[Symbol, untyped]) -> void - - def fetch_token: (url: String, **untyped) -> AccessToken - - def auth_code: () -> Strategy::AuthCode - - def implicit: () -> Strategy::Implicit - - def password: () -> Strategy::Password - - def client_credentials: () -> Strategy::ClientCredentials - - def assertion: () -> Strategy::Assertion - end - -end - diff --git a/sig/lib/stdlib.rbs b/sig/lib/stdlib.rbs new file mode 100644 index 00000000..9a03aa15 --- /dev/null +++ b/sig/lib/stdlib.rbs @@ -0,0 +1,69 @@ +# Hand-written stubs for the standard-library and third-party APIs used by the +# keep-listed hand-written sources (the bespoke authenticators and the Zeitwerk +# entrypoint). The generated sig/vendor.rbs only covers what the generated code +# exercises; these declarations cover the additional surface used by the +# hand-written code. + +# Minimal Zeitwerk surface used by the hand-written entrypoint +# (lib/zitadel_client.rb). The zeitwerk gem ships no RBS in +# ruby/gem_rbs_collection, so the parent class and the loader API the +# entrypoint calls are stubbed here alongside the other third-party stubs. +module Zeitwerk + class Inflector + def camelize: (String basename, String abspath) -> String + end + + class Loader + def self.new: () -> Loader + attr_accessor tag: String + attr_accessor inflector: Inflector + def push_dir: (String dir, ?namespace: Module) -> void + def setup: () -> void + end +end + +# Top-level Zeitwerk inflector defined in lib/zitadel_inflector.rb. +class ZitadelInflector < Zeitwerk::Inflector + IGNORED_DECLARATIONS: Array[String] + + DECLARATION: Regexp + + def camelize: (String basename, String abspath) -> String + + def leaf_constant: (String abspath) -> String? + + def each_declaration: (String abspath) -> Array[[String, String]] +end + +# Additional Net::HTTP surface used by lib/zitadel/client/auth/open_id.rb +# (the proxy-aware constructor, TLS configuration setters and the GET request). +module Net + class HTTP + def self.new: (String? address, Integer? port, ?String? proxy_address, ?Integer? proxy_port, ?String? proxy_user, ?String? proxy_pass) -> HTTP + + def use_ssl=: (bool) -> void + + def verify_mode=: (Integer?) -> void + + def cert_store=: (OpenSSL::X509::Store) -> void + + def request: (untyped request) -> untyped + + class Get < HTTPRequest + def self.new: (URI::Generic | String) -> HTTPRequest + end + end +end + +# The `warning` gem reopens the core Warning module to add `Warning.ignore`, +# used by lib/zitadel_client.rb and the spec/test helpers to silence the +# redefinition warnings dry-struct emits. The gem ships no RBS, so the +# added singleton method is stubbed here. +module Warning + def self.ignore: (Symbol | Regexp pattern, ?String? path) -> void +end + +# The jwt gem, used by lib/zitadel/client/auth/web_token_authenticator.rb. +module JWT + def self.encode: (untyped payload, untyped key, ?String? algorithm, ?Hash[untyped, untyped] header_fields) -> String +end diff --git a/sig/lib/typhoeus/typhoeus.rbs b/sig/lib/typhoeus/typhoeus.rbs deleted file mode 100644 index 586fbbac..00000000 --- a/sig/lib/typhoeus/typhoeus.rbs +++ /dev/null @@ -1,387 +0,0 @@ -module Typhoeus::Config - - attr_accessor block_connection: untyped - - attr_accessor memoize: untyped - - attr_accessor verbose: untyped - - attr_accessor cache: untyped - - attr_accessor user_agent: untyped - - attr_accessor proxy: untyped -end - -class Typhoeus::EasyFactory - - attr_reader request: untyped - - attr_reader hydra: untyped - - def initialize: (untyped request, ?untyped? hydra) -> untyped - - def easy: () -> untyped - - def get: () -> untyped - - def sanitize: (untyped options) -> untyped - - def sanitize_timeout!: (untyped options, untyped timeout) -> untyped - - def set_callback: () -> untyped - - def provide_help: (untyped option) -> untyped -end - -Typhoeus::EasyFactory::RENAMED_OPTIONS: ::Hash[untyped, untyped] - -Typhoeus::EasyFactory::CHANGED_OPTIONS: ::Hash[untyped, untyped] - -Typhoeus::EasyFactory::REMOVED_OPTIONS: untyped - -Typhoeus::EasyFactory::SANITIZE_IGNORE: untyped - -Typhoeus::EasyFactory::SANITIZE_TIMEOUT: untyped - -class Typhoeus::Errors - -end - -class Typhoeus::Errors::NoStub < StandardError - def initialize: (untyped request) -> untyped -end - -class Typhoeus::Errors::TyphoeusError < StandardError -end - -class Typhoeus::Expectation - - attr_reader base_url: untyped - - attr_reader options: untyped - - attr_reader from: untyped - - def self.all: () -> untyped - - def self.clear: () -> untyped - - def self.response_for: (untyped request) -> untyped - - def self.find_by: (untyped request) -> untyped - - def initialize: (untyped base_url, ?::Hash[untyped, untyped] options) -> untyped - - def stubbed_from: (untyped value) -> untyped - - def and_return: (?untyped? response) { () -> untyped } -> untyped - - def matches?: (untyped request) -> untyped - - def responses: () -> untyped - - def response: (untyped request) -> untyped - - def options_match?: (untyped request) -> untyped - - def url_match?: (untyped request_url) -> untyped -end - -module Typhoeus::Pool - - def self.release: (untyped easy) -> untyped - - def self.get: () -> untyped - - def self.clear: () -> untyped - - def self.with_easy: () { (untyped) -> untyped } -> untyped - - def self.easies: () -> untyped -end - -module Typhoeus - extend Request::Actions - - extend Request::Callbacks::Types - - def self.configure: () { (untyped) -> untyped } -> untyped - - def self.stub: (untyped base_url, ?::Hash[untyped, untyped] options) { () -> untyped } -> untyped - - def self.before: () { () -> untyped } -> untyped - - def self.with_connection: () { () -> untyped } -> untyped -end - -Typhoeus::USER_AGENT: ::String - -module Typhoeus::Request::Actions - - def get: (untyped base_url, ?::Hash[untyped, untyped] options) -> untyped - - def post: (untyped base_url, ?::Hash[untyped, untyped] options) -> untyped - - def put: (untyped base_url, ?::Hash[untyped, untyped] options) -> untyped - - def delete: (untyped base_url, ?::Hash[untyped, untyped] options) -> untyped - - def head: (untyped base_url, ?::Hash[untyped, untyped] options) -> untyped - - def patch: (untyped base_url, ?::Hash[untyped, untyped] options) -> untyped - - def options: (untyped base_url, ?::Hash[untyped, untyped] options) -> untyped -end - -module Typhoeus::Request::Before - - def run: () -> untyped -end - -module Typhoeus::Request::BlockConnection - - def run: () -> untyped - - def blocked?: () -> untyped -end - -module Typhoeus::Request::Cacheable - def response=: (untyped response) -> untyped - - def cacheable?: () -> untyped - - def run: () -> untyped - - def cache_ttl: () -> untyped - - def cache: () -> untyped -end - -module Typhoeus::Request::Callbacks - - def execute_headers_callbacks: (untyped response) -> untyped - - def execute_callbacks: () -> untyped -end - -module Typhoeus::Request::Callbacks::Types - - def on_complete: () { (Typhoeus::Response) -> void } -> void - - def on_success: () { () -> untyped } -> untyped - - def on_failure: () { () -> untyped } -> untyped - - def on_headers: () { () -> untyped } -> untyped - - def on_progress: () { () -> untyped } -> untyped -end - -module Typhoeus::Request::Marshal - - def marshal_dump: () -> untyped - - def marshal_load: (untyped attributes) -> untyped -end - -module Typhoeus::Request::Memoizable - - def response=: (untyped response) -> untyped - - def memoizable?: () -> untyped -end - -module Typhoeus::Request::Operations - - def run: () -> untyped - - def finish: (untyped response, ?untyped? bypass_memoization) -> untyped -end - -class Typhoeus::Request - extend Actions - - include Callbacks::Types - - include Callbacks - - include Streamable - - include Marshal - - include Operations - - include Responseable - - include Memoizable - - include Cacheable - - include BlockConnection - - include Stubbable - - include Before - - attr_accessor base_url: untyped - - attr_accessor options: untyped - - attr_accessor hydra: untyped - - attr_accessor original_options: untyped - - attr_accessor block_connection: untyped - - def initialize: (untyped base_url, ?::Hash[untyped, untyped] options) -> untyped - - def url: () -> untyped - - def eql?: (untyped other) -> untyped - - def hash: () -> untyped - - def cache_key: () -> untyped - - def encoded_body: () -> untyped - - def fuzzy_hash_eql?: (untyped left, untyped right) -> untyped - - def hashable_string_for: (untyped obj) -> untyped - - def set_defaults: () -> untyped -end - -module Typhoeus::Request::Responseable - - def response=: (untyped value) -> untyped - - def response: () -> untyped -end - -module Typhoeus::Request::Streamable - - def on_body: () { () -> untyped } -> untyped - - def streaming?: () -> untyped -end - -module Typhoeus::Request::Stubbable - - def run: () -> untyped -end - -module Typhoeus::Response::Cacheable - - attr_writer cached: untyped - - def cached?: () -> untyped -end - -class Typhoeus::Response::Header - - def initialize: (untyped raw) -> untyped - - def []: (untyped key) -> untyped - - def parse: () -> untyped - - def process_line: (untyped header) -> untyped - - def process_pair: (untyped key, untyped value) -> untyped - - def set_value: (untyped key, untyped value, untyped hash) -> untyped - - def raw: () -> untyped - - def set_default_proc_on: (untyped hash, untyped default_proc) -> untyped -end - -module Typhoeus::Response::Informations - - def return_code: () -> untyped - - def return_message: () -> untyped - - def response_body: () -> untyped - - def response_headers: () -> untyped - - def response_code: () -> untyped - - def httpauth_avail: () -> untyped - - def total_time: () -> untyped - - def starttransfer_time: () -> untyped - - def appconnect_time: () -> untyped - - def pretransfer_time: () -> untyped - - def connect_time: () -> untyped - - def namelookup_time: () -> untyped - - def redirect_time: () -> untyped - - def effective_url: () -> untyped - - def primary_ip: () -> untyped - - def redirect_count: () -> untyped - - def request_size: () -> untyped - - def debug_info: () -> untyped - - def headers: () -> untyped - - def redirections: () -> untyped -end - -class Typhoeus::Response - include Informations - - include Status - - include Cacheable - - attr_accessor request: untyped - - attr_accessor options: untyped - - attr_writer handled_response: untyped - - attr_writer mock: untyped - - def initialize: (?::Hash[untyped, untyped] options) -> untyped - - def mock: () -> untyped - - def handled_response: () -> untyped -end - -module Typhoeus::Response::Status - - def status_message: () -> untyped - - def http_version: () -> untyped - - def success?: () -> untyped - - def failure?: () -> untyped - - def modified?: () -> untyped - - def timed_out?: () -> untyped - - def first_header_line: () -> untyped - - def has_good_response_code?: () -> untyped - - def has_bad_response_code?: () -> untyped -end - -Typhoeus::VERSION: ::String diff --git a/sig/lib/warning/warning.rbs b/sig/lib/warning/warning.rbs deleted file mode 100644 index 2ee46119..00000000 --- a/sig/lib/warning/warning.rbs +++ /dev/null @@ -1,3 +0,0 @@ -module Warning - def self.ignore: (Regexp | Symbol | Array[Symbol], String?) -> void -end diff --git a/sig/lib/zeitwerk/zeitwerk.rbs b/sig/lib/zeitwerk/zeitwerk.rbs deleted file mode 100644 index a9654159..00000000 --- a/sig/lib/zeitwerk/zeitwerk.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module Zeitwerk - class Inflector - def camelize: (String, String) -> String - - def inflect: (Hash[String, String]) -> void - end - - class Loader - attr_accessor tag: String - attr_accessor inflector: Inflector - - def initialize: () -> void - - def collapse: (*((String | Pathname) | Array[String | Pathname])) -> void - - def push_dir: (String | Pathname, namespace: Module) -> void - - def setup: () -> void - end - -end diff --git a/sig/spec/base_spec.rbs b/sig/spec/base_spec.rbs new file mode 100644 index 00000000..2e81c069 --- /dev/null +++ b/sig/spec/base_spec.rbs @@ -0,0 +1,61 @@ +# Signature for the integration-test base class and the minitest spec DSL it +# exposes to subclasses. +# +# BaseSpec is a Minitest::Spec (it/before/after DSL) that mixes in +# Minitest::Hooks for once-per-suite docker provisioning. The gem_rbs_collection +# types the spec-DSL blocks as `() -> untyped`, which loses the test-instance +# self — so `client`, instance variables, and expectations inside `it` blocks +# can't be resolved. We override it/before/after/_ here with `[self: instance]` +# block self-types (a subclass override, NOT a redeclaration of the collection's +# DSL, so there is no conflict). Subclasses inherit these, so their `it` blocks +# type-check against the concrete spec instance. + +# Expectation wrapper returned by `_(value)` — only the matchers the specs use. +interface _SpecExpectation[T] + def must_equal: (T expected) -> void + + def must_include: (untyped member) -> void + + def must_be_instance_of: (untyped klass) -> void +end + +class BaseSpec < Minitest::Spec + include Minitest::Hooks + + @compose_file_path: String + @base_url: String + @auth_token: String + @jwt_key: String + + def setup_docker_compose: () -> void + + def teardown_docker_compose: () -> void + + def before_all: () -> void + + def after_all: () -> void + + def load_file_content_into_property: (String relative_path, String property_name) -> String + + # Typed spec DSL — block bodies run against the test instance. + def self.it: (?::String desc) { () [self: instance] -> void } -> void + + def self.before: (?Symbol? kind) { () [self: instance] -> void } -> void + + def self.after: (?Symbol? kind) { () [self: instance] -> void } -> void + + def _: [T] (T value) -> _SpecExpectation[T] + + # Helpers and instance variables the concrete spec subclasses define and read + # inside it/before blocks. Because the block self-type resolves to BaseSpec, + # they are declared here so steep can see them across the DSL blocks. + def client: () -> Zitadel::Client::Zitadel + + def generate_user_secret: (untyped token, ?::String login_name) -> ::Hash[::Symbol, ::String] + + @user: untyped + + @session_id: ::String? + + @session_token: ::String? +end diff --git a/sig/test/oauth_authenticator_test.rbs b/sig/test/oauth_authenticator_test.rbs new file mode 100644 index 00000000..6435cec3 --- /dev/null +++ b/sig/test/oauth_authenticator_test.rbs @@ -0,0 +1,23 @@ +# Signature for the OAuth authenticator unit-test base class. +# +# OAuthAuthenticatorTest is a Minitest::Test that mixes in Minitest::Hooks and +# starts a mock OAuth2 server (Testcontainers) in before_all, exposing its URL +# via `oauth_host`. Declared here so the concrete authenticator test subclasses +# resolve their Minitest::Test assertions and `oauth_host` reader. +module Zitadel + module Client + module Auth + class OAuthAuthenticatorTest < ::Minitest::Test + include ::Minitest::Hooks + + attr_reader oauth_host: ::String + + # Wires the shared ApiClient into a bespoke OAuth authenticator (required + # before token exchange against the mock OAuth2 server) and returns it. + def inject_api_client: (Zitadel::Client::Auth::HttpAwareAuthenticator authenticator) -> Zitadel::Client::Auth::HttpAwareAuthenticator + + @mock_server: untyped + end + end + end +end diff --git a/sig/test/spec_dsl.rbs b/sig/test/spec_dsl.rbs new file mode 100644 index 00000000..845eac84 --- /dev/null +++ b/sig/test/spec_dsl.rbs @@ -0,0 +1,28 @@ +# Top-level Minitest spec-DSL entrypoints for the generator-owned unit tests +# (configuration_test, value_serializer_test, header_selector_test, +# transport_options_test, trace_context_util_test, default_api_client_unit_test). +# +# Those files use the spec DSL (`describe ... do`) at the file top level. At +# runtime `minitest/spec` injects `describe` into Kernel and runs each block +# with `self` set to a `Minitest::Spec` subclass, so `before`/`after`/`it`/`_` +# resolve. The gem_rbs_collection ships the DSL on `Minitest::Spec::DSL` but +# never declares the Kernel entrypoint, so Steep sees `::Object#describe` as +# missing and the whole block fails to resolve. Declare the entrypoint here so +# these untyped spec files type-check (mirrors the hand-written RBS the repo +# already keeps for the class-based auth tests under sig/test/). +module Kernel + def describe: (untyped desc, *untyped additional) ?{ () [self: singleton(Minitest::Spec)] -> void } -> singleton(Minitest::Spec) +end + +# Reopen the DSL so the example/hook blocks run with `self` typed as a spec +# *instance* (where `_`/`value`/`expect` and the assertion helpers live), and +# so nested `describe` inside a describe block resolves too. The collection +# declares these with bare blocks (no self-type), which leaves `_(...)` +# unresolved inside every `it`/`before`/`after`. +module Minitest::Spec::DSL + def describe: (untyped desc, *untyped additional) ?{ () [self: singleton(Minitest::Spec)] -> void } -> singleton(Minitest::Spec) + def it: (?::String desc) ?{ () [self: Minitest::Spec] -> void } -> untyped + def specify: (?::String desc) ?{ () [self: Minitest::Spec] -> void } -> untyped + def before: (?untyped? _type) { () [self: Minitest::Spec] -> void } -> untyped + def after: (?untyped? _type) { () [self: Minitest::Spec] -> void } -> untyped +end diff --git a/sig/test/zitadel_test.rbs b/sig/test/zitadel_test.rbs new file mode 100644 index 00000000..985eece7 --- /dev/null +++ b/sig/test/zitadel_test.rbs @@ -0,0 +1,34 @@ +# Signature for the Zitadel facade integration test. +# +# ZitadelTest is a Minitest::Test that mixes in Minitest::Hooks and boots a +# WireMock + Squid stack via Testcontainers in before_all. Declared here so the +# extracted container-lifecycle and assertion helpers resolve against the test +# class rather than the bare Minitest::Test. +module Zitadel + module Client + class ZitadelTest < ::Minitest::Test + include ::Minitest::Hooks + + def start_wiremock: () -> untyped + + def start_proxy: () -> untyped + + def capture_endpoints: () -> void + + def service_api_classes: (Array[untyped] klasses) -> Set[untyped] + + def general_settings: (String url, untyped transport_options) -> untyped + + def with_proxy_retry: (?attempts: Integer) { () -> untyped } -> untyped + + @ca_cert_path: String + @network: untyped + @wiremock: untyped + @proxy: untyped + @host: String + @http_port: Integer + @https_port: Integer + @proxy_port: Integer + end + end +end diff --git a/sig/vendor.rbs b/sig/vendor.rbs new file mode 100644 index 00000000..51960666 --- /dev/null +++ b/sig/vendor.rbs @@ -0,0 +1,81 @@ +module Dry + def self.Types: () -> Module + + module Types + class CoercionError < StandardError + end + end + + class Struct + def self.attribute: (Symbol, untyped) -> void + def self.transform_keys: () { (untyped) -> untyped } -> void + + # Dry::Struct instances are built from keyword attributes (the generated + # Models::* classes declare attr_readers but inherit construction from here). + # Accept arbitrary keywords so `Model.new(field: value)` type-checks; the + # readers on each subclass provide the precise per-field types. + def self.new: (**untyped) -> instance + def initialize: (**untyped) -> void + end +end + +module Types + Builder: untyped + Any: untyped + Required: untyped + String: untyped + Integer: untyped + Float: untyped + Decimal: untyped + Bool: untyped + Date: untyped + DateTime: untyped + Time: untyped + Hash: untyped + Array: untyped + Nil: untyped +end + +module Brotli + def self.inflate: (String) -> String +end + +module Zstd + def self.decompress: (String) -> String +end + +# 4.8: format: time — Tod::TimeOfDay surface for HH:MM:SS values. +module Tod + class TimeOfDay + def self.parse: (String) -> TimeOfDay + def self.new: (Integer, ?Integer, ?Integer) -> TimeOfDay + def strftime: (String) -> String + def to_s: () -> String + def hour: () -> Integer + def minute: () -> Integer + def second: () -> Integer + end +end + +# 4.8: format: duration — ISO8601::Duration surface for ISO-8601 durations. +module ISO8601 + class Duration + def self.new: (String) -> Duration + def to_s: () -> String + # to_seconds yields a concrete Float so arithmetic (`*`, `-`, `floor`) in + # ObjectSerializer.duration_to_protobuf_json type-checks; abstract Numeric + # declares none of those operators in RBS. + def to_seconds: () -> Float + end +end +# Faraday signatures come from the gem_rbs_collection (.gem_rbs_collection/faraday). +# Do NOT redeclare its classes (e.g. Error, TimeoutError, SSLOptions, +# RequestOptions) — the collection already defines them (with +# `TimeoutError < ServerError`), so redeclaring here triggers conflicting +# superclass errors. Only reopen Connection to ADD the one writer the +# collection omits but the generated client uses. +module Faraday + class Connection + def proxy=: (String?) -> void + end +end diff --git a/sig/vendor/docker.rbs b/sig/vendor/docker.rbs new file mode 100644 index 00000000..602f1bc3 --- /dev/null +++ b/sig/vendor/docker.rbs @@ -0,0 +1,15 @@ +# Signatures for the docker-api gem (no RBS in gem_rbs_collection). +# +# Only the Docker::Network surface used by test/zitadel/client/zitadel_test.rb +# is declared. +module Docker + class Network + def self.create: (String name, ?untyped opts) -> Network + + def connect: (String container, ?untyped opts, **untyped) -> untyped + + def remove: (?untyped opts) -> untyped + + def _id: () -> String + end +end diff --git a/sig/vendor/minitest_hooks.rbs b/sig/vendor/minitest_hooks.rbs new file mode 100644 index 00000000..a8e70e33 --- /dev/null +++ b/sig/vendor/minitest_hooks.rbs @@ -0,0 +1,29 @@ +# Signatures for the minitest-hooks gem (no RBS in gem_rbs_collection). +# +# Source: minitest-hooks 1.5.2, lib/minitest/hooks/test.rb. Only the surface +# that the test suite relies on is declared: the instance hooks that test +# classes override (before_all/after_all/around/around_all) and the +# self.included callback that wires in the class methods. +module Minitest + module Hooks + def self.included: (Module mod) -> void + + def before_all: () -> void + + def after_all: () -> void + + def around: () { () -> void } -> void + + def around_all: () { () -> void } -> void + + def time_it: () { () -> void } -> void + + module ClassMethods + def before: (?Symbol? type) { () -> void } -> void + + def after: (?Symbol? type) { () -> void } -> void + + def around: (?Symbol? type) { () -> void } -> void + end + end +end diff --git a/sig/vendor/minitest_reporters.rbs b/sig/vendor/minitest_reporters.rbs new file mode 100644 index 00000000..884ce903 --- /dev/null +++ b/sig/vendor/minitest_reporters.rbs @@ -0,0 +1,38 @@ +# Signatures for the minitest-reporters gem (no RBS in gem_rbs_collection). +# +# spec/spec_helper.rb and test/test_helper.rb reopen +# Minitest::Reporters::JUnitReporter to override #parse_xml_for, calling the +# reporter's own (inherited) private helpers. Declare just that surface plus the +# reporters and #use! entry point those helpers instantiate. +module Minitest + module Reporters + def self.use!: (untyped reporters, ?untyped env, ?untyped output) -> untyped + + class BaseReporter + end + + class SpecReporter < BaseReporter + def initialize: (?untyped options) -> void + end + + class JUnitReporter < BaseReporter + def initialize: (?String reports_dir, ?bool empty, ?untyped options) -> void + + def parse_xml_for: (untyped xml, untyped suite, untyped tests) -> untyped + + def testsuite_attributes: (untyped suite, untyped tests, untyped file_path) -> Hash[Symbol, untyped] + + def emit_testcase: (untyped xml, untyped suite, untyped file_path, untyped test) -> untyped + + def analyze_suite: (untyped tests) -> untyped + + def get_relative_path: (untyped result) -> untyped + + def get_source_location: (untyped result) -> untyped + + def xml_message_for: (untyped test) -> untyped + + def xml_attachment_for: (untyped test) -> untyped + end + end +end diff --git a/sig/vendor/simplecov.rbs b/sig/vendor/simplecov.rbs new file mode 100644 index 00000000..135574f2 --- /dev/null +++ b/sig/vendor/simplecov.rbs @@ -0,0 +1,19 @@ +# Supplemental SimpleCov signatures. +# +# The gem_rbs_collection ships SimpleCov (.gem_rbs_collection/simplecov), but +# its SimpleCov::Configuration omits a few accessors the test harness uses in +# spec/spec_helper.rb and test/test_helper.rb. Reopen the module to ADD them — +# do NOT redeclare anything the collection already provides. +module SimpleCov + module Configuration + def coverage_dir: (?String? dir) -> String + + def coverage_path: () -> String + + def formatters=: (untyped formatters) -> untyped + + def running=: (bool value) -> bool + + def running: () -> bool + end +end diff --git a/sig/vendor/testcontainers.rbs b/sig/vendor/testcontainers.rbs new file mode 100644 index 00000000..d51ac6e0 --- /dev/null +++ b/sig/vendor/testcontainers.rbs @@ -0,0 +1,37 @@ +# Signatures for the testcontainers-core gem (no RBS in gem_rbs_collection). +# +# Only the surface used by the test suite is declared: +# test/zitadel/client/zitadel_test.rb +# test/zitadel/client/auth/oauth_authenticator_test.rb +# +# The builder methods (with_*) return self so they can be chained; return types +# are kept loose (untyped) where the exact value is irrelevant to type checking. +module Testcontainers + class DockerContainer + def initialize: (String image, **untyped) -> void + + def with_command: (*String parts) -> DockerContainer + + def with_exposed_ports: (*Integer ports) -> DockerContainer + + def with_exposed_port: (Integer port) -> DockerContainer + + def with_filesystem_binds: (untyped binds) -> DockerContainer + + def start: () -> DockerContainer + + def stop: (?force: bool) -> untyped + + def remove: (?untyped options) -> untyped + + def host: () -> String + + def mapped_port: (Integer port) -> Integer + + def wait_for_tcp_port: (Integer port, ?timeout: Numeric, ?interval: Numeric) -> untyped + + def wait_for_http: (?timeout: Numeric, ?interval: Numeric, ?path: String, ?container_port: Integer, ?https: bool, ?status: Integer) -> untyped + + def _id: () -> String + end +end diff --git a/sig/zitadel/client/api/action_service_api.rbs b/sig/zitadel/client/api/action_service_api.rbs new file mode 100644 index 00000000..b9274f20 --- /dev/null +++ b/sig/zitadel/client/api/action_service_api.rbs @@ -0,0 +1,37 @@ +module Zitadel::Client + module Api + class ActionServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def activate_public_key: (Models::ActionServiceActivatePublicKeyRequest action_service_activate_public_key_request) -> Models::ActionServiceActivatePublicKeyResponse + def activate_public_key_with_http_info: (Models::ActionServiceActivatePublicKeyRequest action_service_activate_public_key_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceActivatePublicKeyResponse] + def add_public_key: (Models::ActionServiceAddPublicKeyRequest action_service_add_public_key_request) -> Models::ActionServiceAddPublicKeyResponse + def add_public_key_with_http_info: (Models::ActionServiceAddPublicKeyRequest action_service_add_public_key_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceAddPublicKeyResponse] + def create_target: (Models::ActionServiceCreateTargetRequest action_service_create_target_request) -> Models::ActionServiceCreateTargetResponse + def create_target_with_http_info: (Models::ActionServiceCreateTargetRequest action_service_create_target_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceCreateTargetResponse] + def deactivate_public_key: (Models::ActionServiceDeactivatePublicKeyRequest action_service_deactivate_public_key_request) -> Models::ActionServiceDeactivatePublicKeyResponse + def deactivate_public_key_with_http_info: (Models::ActionServiceDeactivatePublicKeyRequest action_service_deactivate_public_key_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceDeactivatePublicKeyResponse] + def delete_target: (Models::ActionServiceDeleteTargetRequest action_service_delete_target_request) -> Models::ActionServiceDeleteTargetResponse + def delete_target_with_http_info: (Models::ActionServiceDeleteTargetRequest action_service_delete_target_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceDeleteTargetResponse] + def get_target: (Models::ActionServiceGetTargetRequest action_service_get_target_request) -> Models::ActionServiceGetTargetResponse + def get_target_with_http_info: (Models::ActionServiceGetTargetRequest action_service_get_target_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceGetTargetResponse] + def list_execution_functions: (untyped body) -> Models::ActionServiceListExecutionFunctionsResponse + def list_execution_functions_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::ActionServiceListExecutionFunctionsResponse] + def list_execution_methods: (untyped body) -> Models::ActionServiceListExecutionMethodsResponse + def list_execution_methods_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::ActionServiceListExecutionMethodsResponse] + def list_execution_services: (untyped body) -> Models::ActionServiceListExecutionServicesResponse + def list_execution_services_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::ActionServiceListExecutionServicesResponse] + def list_executions: (Models::ActionServiceListExecutionsRequest action_service_list_executions_request) -> Models::ActionServiceListExecutionsResponse + def list_executions_with_http_info: (Models::ActionServiceListExecutionsRequest action_service_list_executions_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceListExecutionsResponse] + def list_public_keys: (Models::ActionServiceListPublicKeysRequest action_service_list_public_keys_request) -> Models::ActionServiceListPublicKeysResponse + def list_public_keys_with_http_info: (Models::ActionServiceListPublicKeysRequest action_service_list_public_keys_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceListPublicKeysResponse] + def list_targets: (Models::ActionServiceListTargetsRequest action_service_list_targets_request) -> Models::ActionServiceListTargetsResponse + def list_targets_with_http_info: (Models::ActionServiceListTargetsRequest action_service_list_targets_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceListTargetsResponse] + def remove_public_key: (Models::ActionServiceRemovePublicKeyRequest action_service_remove_public_key_request) -> Models::ActionServiceRemovePublicKeyResponse + def remove_public_key_with_http_info: (Models::ActionServiceRemovePublicKeyRequest action_service_remove_public_key_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceRemovePublicKeyResponse] + def set_execution: (Models::ActionServiceSetExecutionRequest action_service_set_execution_request) -> Models::ActionServiceSetExecutionResponse + def set_execution_with_http_info: (Models::ActionServiceSetExecutionRequest action_service_set_execution_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceSetExecutionResponse] + def update_target: (Models::ActionServiceUpdateTargetRequest action_service_update_target_request) -> Models::ActionServiceUpdateTargetResponse + def update_target_with_http_info: (Models::ActionServiceUpdateTargetRequest action_service_update_target_request) -> ::Zitadel::Client::ApiResult[Models::ActionServiceUpdateTargetResponse] + end + end +end diff --git a/sig/zitadel/client/api/application_service_api.rbs b/sig/zitadel/client/api/application_service_api.rbs new file mode 100644 index 00000000..4a07b39c --- /dev/null +++ b/sig/zitadel/client/api/application_service_api.rbs @@ -0,0 +1,31 @@ +module Zitadel::Client + module Api + class ApplicationServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def create_application: (Models::ApplicationServiceCreateApplicationRequest application_service_create_application_request) -> Models::ApplicationServiceCreateApplicationResponse + def create_application_with_http_info: (Models::ApplicationServiceCreateApplicationRequest application_service_create_application_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceCreateApplicationResponse] + def create_application_key: (Models::ApplicationServiceCreateApplicationKeyRequest application_service_create_application_key_request) -> Models::ApplicationServiceCreateApplicationKeyResponse + def create_application_key_with_http_info: (Models::ApplicationServiceCreateApplicationKeyRequest application_service_create_application_key_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceCreateApplicationKeyResponse] + def deactivate_application: (Models::ApplicationServiceDeactivateApplicationRequest application_service_deactivate_application_request) -> Models::ApplicationServiceDeactivateApplicationResponse + def deactivate_application_with_http_info: (Models::ApplicationServiceDeactivateApplicationRequest application_service_deactivate_application_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceDeactivateApplicationResponse] + def delete_application: (Models::ApplicationServiceDeleteApplicationRequest application_service_delete_application_request) -> Models::ApplicationServiceDeleteApplicationResponse + def delete_application_with_http_info: (Models::ApplicationServiceDeleteApplicationRequest application_service_delete_application_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceDeleteApplicationResponse] + def delete_application_key: (Models::ApplicationServiceDeleteApplicationKeyRequest application_service_delete_application_key_request) -> Models::ApplicationServiceDeleteApplicationKeyResponse + def delete_application_key_with_http_info: (Models::ApplicationServiceDeleteApplicationKeyRequest application_service_delete_application_key_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceDeleteApplicationKeyResponse] + def generate_client_secret: (Models::ApplicationServiceGenerateClientSecretRequest application_service_generate_client_secret_request) -> Models::ApplicationServiceGenerateClientSecretResponse + def generate_client_secret_with_http_info: (Models::ApplicationServiceGenerateClientSecretRequest application_service_generate_client_secret_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceGenerateClientSecretResponse] + def get_application: (Models::ApplicationServiceGetApplicationRequest application_service_get_application_request) -> Models::ApplicationServiceGetApplicationResponse + def get_application_with_http_info: (Models::ApplicationServiceGetApplicationRequest application_service_get_application_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceGetApplicationResponse] + def get_application_key: (Models::ApplicationServiceGetApplicationKeyRequest application_service_get_application_key_request) -> Models::ApplicationServiceGetApplicationKeyResponse + def get_application_key_with_http_info: (Models::ApplicationServiceGetApplicationKeyRequest application_service_get_application_key_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceGetApplicationKeyResponse] + def list_application_keys: (Models::ApplicationServiceListApplicationKeysRequest application_service_list_application_keys_request) -> Models::ApplicationServiceListApplicationKeysResponse + def list_application_keys_with_http_info: (Models::ApplicationServiceListApplicationKeysRequest application_service_list_application_keys_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceListApplicationKeysResponse] + def list_applications: (Models::ApplicationServiceListApplicationsRequest application_service_list_applications_request) -> Models::ApplicationServiceListApplicationsResponse + def list_applications_with_http_info: (Models::ApplicationServiceListApplicationsRequest application_service_list_applications_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceListApplicationsResponse] + def reactivate_application: (Models::ApplicationServiceReactivateApplicationRequest application_service_reactivate_application_request) -> Models::ApplicationServiceReactivateApplicationResponse + def reactivate_application_with_http_info: (Models::ApplicationServiceReactivateApplicationRequest application_service_reactivate_application_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceReactivateApplicationResponse] + def update_application: (Models::ApplicationServiceUpdateApplicationRequest application_service_update_application_request) -> Models::ApplicationServiceUpdateApplicationResponse + def update_application_with_http_info: (Models::ApplicationServiceUpdateApplicationRequest application_service_update_application_request) -> ::Zitadel::Client::ApiResult[Models::ApplicationServiceUpdateApplicationResponse] + end + end +end diff --git a/sig/zitadel/client/api/authorization_service_api.rbs b/sig/zitadel/client/api/authorization_service_api.rbs new file mode 100644 index 00000000..861b735e --- /dev/null +++ b/sig/zitadel/client/api/authorization_service_api.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client + module Api + class AuthorizationServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def activate_authorization: (Models::AuthorizationServiceActivateAuthorizationRequest authorization_service_activate_authorization_request) -> Models::AuthorizationServiceActivateAuthorizationResponse + def activate_authorization_with_http_info: (Models::AuthorizationServiceActivateAuthorizationRequest authorization_service_activate_authorization_request) -> ::Zitadel::Client::ApiResult[Models::AuthorizationServiceActivateAuthorizationResponse] + def create_authorization: (Models::AuthorizationServiceCreateAuthorizationRequest authorization_service_create_authorization_request) -> Models::AuthorizationServiceCreateAuthorizationResponse + def create_authorization_with_http_info: (Models::AuthorizationServiceCreateAuthorizationRequest authorization_service_create_authorization_request) -> ::Zitadel::Client::ApiResult[Models::AuthorizationServiceCreateAuthorizationResponse] + def deactivate_authorization: (Models::AuthorizationServiceDeactivateAuthorizationRequest authorization_service_deactivate_authorization_request) -> Models::AuthorizationServiceDeactivateAuthorizationResponse + def deactivate_authorization_with_http_info: (Models::AuthorizationServiceDeactivateAuthorizationRequest authorization_service_deactivate_authorization_request) -> ::Zitadel::Client::ApiResult[Models::AuthorizationServiceDeactivateAuthorizationResponse] + def delete_authorization: (Models::AuthorizationServiceDeleteAuthorizationRequest authorization_service_delete_authorization_request) -> Models::AuthorizationServiceDeleteAuthorizationResponse + def delete_authorization_with_http_info: (Models::AuthorizationServiceDeleteAuthorizationRequest authorization_service_delete_authorization_request) -> ::Zitadel::Client::ApiResult[Models::AuthorizationServiceDeleteAuthorizationResponse] + def list_authorizations: (Models::AuthorizationServiceListAuthorizationsRequest authorization_service_list_authorizations_request) -> Models::AuthorizationServiceListAuthorizationsResponse + def list_authorizations_with_http_info: (Models::AuthorizationServiceListAuthorizationsRequest authorization_service_list_authorizations_request) -> ::Zitadel::Client::ApiResult[Models::AuthorizationServiceListAuthorizationsResponse] + def update_authorization: (Models::AuthorizationServiceUpdateAuthorizationRequest authorization_service_update_authorization_request) -> Models::AuthorizationServiceUpdateAuthorizationResponse + def update_authorization_with_http_info: (Models::AuthorizationServiceUpdateAuthorizationRequest authorization_service_update_authorization_request) -> ::Zitadel::Client::ApiResult[Models::AuthorizationServiceUpdateAuthorizationResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_action_service_api.rbs b/sig/zitadel/client/api/beta_action_service_api.rbs new file mode 100644 index 00000000..892f631d --- /dev/null +++ b/sig/zitadel/client/api/beta_action_service_api.rbs @@ -0,0 +1,27 @@ +module Zitadel::Client + module Api + class BetaActionServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def create_target: (Models::BetaActionServiceCreateTargetRequest beta_action_service_create_target_request) -> Models::BetaActionServiceCreateTargetResponse + def create_target_with_http_info: (Models::BetaActionServiceCreateTargetRequest beta_action_service_create_target_request) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceCreateTargetResponse] + def delete_target: (Models::BetaActionServiceDeleteTargetRequest beta_action_service_delete_target_request) -> Models::BetaActionServiceDeleteTargetResponse + def delete_target_with_http_info: (Models::BetaActionServiceDeleteTargetRequest beta_action_service_delete_target_request) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceDeleteTargetResponse] + def get_target: (Models::BetaActionServiceGetTargetRequest beta_action_service_get_target_request) -> Models::BetaActionServiceGetTargetResponse + def get_target_with_http_info: (Models::BetaActionServiceGetTargetRequest beta_action_service_get_target_request) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceGetTargetResponse] + def list_execution_functions: (untyped body) -> Models::BetaActionServiceListExecutionFunctionsResponse + def list_execution_functions_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceListExecutionFunctionsResponse] + def list_execution_methods: (untyped body) -> Models::BetaActionServiceListExecutionMethodsResponse + def list_execution_methods_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceListExecutionMethodsResponse] + def list_execution_services: (untyped body) -> Models::BetaActionServiceListExecutionServicesResponse + def list_execution_services_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceListExecutionServicesResponse] + def list_executions: (Models::BetaActionServiceListExecutionsRequest beta_action_service_list_executions_request) -> Models::BetaActionServiceListExecutionsResponse + def list_executions_with_http_info: (Models::BetaActionServiceListExecutionsRequest beta_action_service_list_executions_request) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceListExecutionsResponse] + def list_targets: (Models::BetaActionServiceListTargetsRequest beta_action_service_list_targets_request) -> Models::BetaActionServiceListTargetsResponse + def list_targets_with_http_info: (Models::BetaActionServiceListTargetsRequest beta_action_service_list_targets_request) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceListTargetsResponse] + def set_execution: (Models::BetaActionServiceSetExecutionRequest beta_action_service_set_execution_request) -> Models::BetaActionServiceSetExecutionResponse + def set_execution_with_http_info: (Models::BetaActionServiceSetExecutionRequest beta_action_service_set_execution_request) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceSetExecutionResponse] + def update_target: (Models::BetaActionServiceUpdateTargetRequest beta_action_service_update_target_request) -> Models::BetaActionServiceUpdateTargetResponse + def update_target_with_http_info: (Models::BetaActionServiceUpdateTargetRequest beta_action_service_update_target_request) -> ::Zitadel::Client::ApiResult[Models::BetaActionServiceUpdateTargetResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_app_service_api.rbs b/sig/zitadel/client/api/beta_app_service_api.rbs new file mode 100644 index 00000000..cb432c40 --- /dev/null +++ b/sig/zitadel/client/api/beta_app_service_api.rbs @@ -0,0 +1,31 @@ +module Zitadel::Client + module Api + class BetaAppServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def create_application: (Models::BetaAppServiceCreateApplicationRequest beta_app_service_create_application_request) -> Models::BetaAppServiceCreateApplicationResponse + def create_application_with_http_info: (Models::BetaAppServiceCreateApplicationRequest beta_app_service_create_application_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceCreateApplicationResponse] + def create_application_key: (Models::BetaAppServiceCreateApplicationKeyRequest beta_app_service_create_application_key_request) -> Models::BetaAppServiceCreateApplicationKeyResponse + def create_application_key_with_http_info: (Models::BetaAppServiceCreateApplicationKeyRequest beta_app_service_create_application_key_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceCreateApplicationKeyResponse] + def deactivate_application: (Models::BetaAppServiceDeactivateApplicationRequest beta_app_service_deactivate_application_request) -> Models::BetaAppServiceDeactivateApplicationResponse + def deactivate_application_with_http_info: (Models::BetaAppServiceDeactivateApplicationRequest beta_app_service_deactivate_application_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceDeactivateApplicationResponse] + def delete_application: (Models::BetaAppServiceDeleteApplicationRequest beta_app_service_delete_application_request) -> Models::BetaAppServiceDeleteApplicationResponse + def delete_application_with_http_info: (Models::BetaAppServiceDeleteApplicationRequest beta_app_service_delete_application_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceDeleteApplicationResponse] + def delete_application_key: (Models::BetaAppServiceDeleteApplicationKeyRequest beta_app_service_delete_application_key_request) -> Models::BetaAppServiceDeleteApplicationKeyResponse + def delete_application_key_with_http_info: (Models::BetaAppServiceDeleteApplicationKeyRequest beta_app_service_delete_application_key_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceDeleteApplicationKeyResponse] + def get_application: (Models::BetaAppServiceGetApplicationRequest beta_app_service_get_application_request) -> Models::BetaAppServiceGetApplicationResponse + def get_application_with_http_info: (Models::BetaAppServiceGetApplicationRequest beta_app_service_get_application_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceGetApplicationResponse] + def get_application_key: (Models::BetaAppServiceGetApplicationKeyRequest beta_app_service_get_application_key_request) -> Models::BetaAppServiceGetApplicationKeyResponse + def get_application_key_with_http_info: (Models::BetaAppServiceGetApplicationKeyRequest beta_app_service_get_application_key_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceGetApplicationKeyResponse] + def list_application_keys: (Models::BetaAppServiceListApplicationKeysRequest beta_app_service_list_application_keys_request) -> Models::BetaAppServiceListApplicationKeysResponse + def list_application_keys_with_http_info: (Models::BetaAppServiceListApplicationKeysRequest beta_app_service_list_application_keys_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceListApplicationKeysResponse] + def list_applications: (Models::BetaAppServiceListApplicationsRequest beta_app_service_list_applications_request) -> Models::BetaAppServiceListApplicationsResponse + def list_applications_with_http_info: (Models::BetaAppServiceListApplicationsRequest beta_app_service_list_applications_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceListApplicationsResponse] + def reactivate_application: (Models::BetaAppServiceReactivateApplicationRequest beta_app_service_reactivate_application_request) -> Models::BetaAppServiceReactivateApplicationResponse + def reactivate_application_with_http_info: (Models::BetaAppServiceReactivateApplicationRequest beta_app_service_reactivate_application_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceReactivateApplicationResponse] + def regenerate_client_secret: (Models::BetaAppServiceRegenerateClientSecretRequest beta_app_service_regenerate_client_secret_request) -> Models::BetaAppServiceRegenerateClientSecretResponse + def regenerate_client_secret_with_http_info: (Models::BetaAppServiceRegenerateClientSecretRequest beta_app_service_regenerate_client_secret_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceRegenerateClientSecretResponse] + def update_application: (Models::BetaAppServiceUpdateApplicationRequest beta_app_service_update_application_request) -> Models::BetaAppServiceUpdateApplicationResponse + def update_application_with_http_info: (Models::BetaAppServiceUpdateApplicationRequest beta_app_service_update_application_request) -> ::Zitadel::Client::ApiResult[Models::BetaAppServiceUpdateApplicationResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_authorization_service_api.rbs b/sig/zitadel/client/api/beta_authorization_service_api.rbs new file mode 100644 index 00000000..6e18db36 --- /dev/null +++ b/sig/zitadel/client/api/beta_authorization_service_api.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client + module Api + class BetaAuthorizationServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def activate_authorization: (Models::BetaAuthorizationServiceActivateAuthorizationRequest beta_authorization_service_activate_authorization_request) -> Models::BetaAuthorizationServiceActivateAuthorizationResponse + def activate_authorization_with_http_info: (Models::BetaAuthorizationServiceActivateAuthorizationRequest beta_authorization_service_activate_authorization_request) -> ::Zitadel::Client::ApiResult[Models::BetaAuthorizationServiceActivateAuthorizationResponse] + def create_authorization: (Models::BetaAuthorizationServiceCreateAuthorizationRequest beta_authorization_service_create_authorization_request) -> Models::BetaAuthorizationServiceCreateAuthorizationResponse + def create_authorization_with_http_info: (Models::BetaAuthorizationServiceCreateAuthorizationRequest beta_authorization_service_create_authorization_request) -> ::Zitadel::Client::ApiResult[Models::BetaAuthorizationServiceCreateAuthorizationResponse] + def deactivate_authorization: (Models::BetaAuthorizationServiceDeactivateAuthorizationRequest beta_authorization_service_deactivate_authorization_request) -> Models::BetaAuthorizationServiceDeactivateAuthorizationResponse + def deactivate_authorization_with_http_info: (Models::BetaAuthorizationServiceDeactivateAuthorizationRequest beta_authorization_service_deactivate_authorization_request) -> ::Zitadel::Client::ApiResult[Models::BetaAuthorizationServiceDeactivateAuthorizationResponse] + def delete_authorization: (Models::BetaAuthorizationServiceDeleteAuthorizationRequest beta_authorization_service_delete_authorization_request) -> Models::BetaAuthorizationServiceDeleteAuthorizationResponse + def delete_authorization_with_http_info: (Models::BetaAuthorizationServiceDeleteAuthorizationRequest beta_authorization_service_delete_authorization_request) -> ::Zitadel::Client::ApiResult[Models::BetaAuthorizationServiceDeleteAuthorizationResponse] + def list_authorizations: (Models::BetaAuthorizationServiceListAuthorizationsRequest beta_authorization_service_list_authorizations_request) -> Models::BetaAuthorizationServiceListAuthorizationsResponse + def list_authorizations_with_http_info: (Models::BetaAuthorizationServiceListAuthorizationsRequest beta_authorization_service_list_authorizations_request) -> ::Zitadel::Client::ApiResult[Models::BetaAuthorizationServiceListAuthorizationsResponse] + def update_authorization: (Models::BetaAuthorizationServiceUpdateAuthorizationRequest beta_authorization_service_update_authorization_request) -> Models::BetaAuthorizationServiceUpdateAuthorizationResponse + def update_authorization_with_http_info: (Models::BetaAuthorizationServiceUpdateAuthorizationRequest beta_authorization_service_update_authorization_request) -> ::Zitadel::Client::ApiResult[Models::BetaAuthorizationServiceUpdateAuthorizationResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_feature_service_api.rbs b/sig/zitadel/client/api/beta_feature_service_api.rbs new file mode 100644 index 00000000..5c413725 --- /dev/null +++ b/sig/zitadel/client/api/beta_feature_service_api.rbs @@ -0,0 +1,31 @@ +module Zitadel::Client + module Api + class BetaFeatureServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def get_instance_features: (Models::BetaFeatureServiceGetInstanceFeaturesRequest beta_feature_service_get_instance_features_request) -> Models::BetaFeatureServiceGetInstanceFeaturesResponse + def get_instance_features_with_http_info: (Models::BetaFeatureServiceGetInstanceFeaturesRequest beta_feature_service_get_instance_features_request) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceGetInstanceFeaturesResponse] + def get_organization_features: (Models::BetaFeatureServiceGetOrganizationFeaturesRequest beta_feature_service_get_organization_features_request) -> Models::BetaFeatureServiceGetOrganizationFeaturesResponse + def get_organization_features_with_http_info: (Models::BetaFeatureServiceGetOrganizationFeaturesRequest beta_feature_service_get_organization_features_request) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceGetOrganizationFeaturesResponse] + def get_system_features: (untyped body) -> Models::BetaFeatureServiceGetSystemFeaturesResponse + def get_system_features_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceGetSystemFeaturesResponse] + def get_user_features: (Models::BetaFeatureServiceGetUserFeaturesRequest beta_feature_service_get_user_features_request) -> Models::BetaFeatureServiceGetUserFeaturesResponse + def get_user_features_with_http_info: (Models::BetaFeatureServiceGetUserFeaturesRequest beta_feature_service_get_user_features_request) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceGetUserFeaturesResponse] + def reset_instance_features: (untyped body) -> Models::BetaFeatureServiceResetInstanceFeaturesResponse + def reset_instance_features_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceResetInstanceFeaturesResponse] + def reset_organization_features: (Models::BetaFeatureServiceResetOrganizationFeaturesRequest beta_feature_service_reset_organization_features_request) -> Models::BetaFeatureServiceResetOrganizationFeaturesResponse + def reset_organization_features_with_http_info: (Models::BetaFeatureServiceResetOrganizationFeaturesRequest beta_feature_service_reset_organization_features_request) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceResetOrganizationFeaturesResponse] + def reset_system_features: (untyped body) -> Models::BetaFeatureServiceResetSystemFeaturesResponse + def reset_system_features_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceResetSystemFeaturesResponse] + def reset_user_features: (Models::BetaFeatureServiceResetUserFeaturesRequest beta_feature_service_reset_user_features_request) -> Models::BetaFeatureServiceResetUserFeaturesResponse + def reset_user_features_with_http_info: (Models::BetaFeatureServiceResetUserFeaturesRequest beta_feature_service_reset_user_features_request) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceResetUserFeaturesResponse] + def set_instance_features: (Models::BetaFeatureServiceSetInstanceFeaturesRequest beta_feature_service_set_instance_features_request) -> Models::BetaFeatureServiceSetInstanceFeaturesResponse + def set_instance_features_with_http_info: (Models::BetaFeatureServiceSetInstanceFeaturesRequest beta_feature_service_set_instance_features_request) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceSetInstanceFeaturesResponse] + def set_organization_features: (Models::BetaFeatureServiceSetOrganizationFeaturesRequest beta_feature_service_set_organization_features_request) -> Models::BetaFeatureServiceSetOrganizationFeaturesResponse + def set_organization_features_with_http_info: (Models::BetaFeatureServiceSetOrganizationFeaturesRequest beta_feature_service_set_organization_features_request) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceSetOrganizationFeaturesResponse] + def set_system_features: (Models::BetaFeatureServiceSetSystemFeaturesRequest beta_feature_service_set_system_features_request) -> Models::BetaFeatureServiceSetSystemFeaturesResponse + def set_system_features_with_http_info: (Models::BetaFeatureServiceSetSystemFeaturesRequest beta_feature_service_set_system_features_request) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceSetSystemFeaturesResponse] + def set_user_features: (Models::BetaFeatureServiceSetUserFeatureRequest beta_feature_service_set_user_feature_request) -> Models::BetaFeatureServiceSetUserFeaturesResponse + def set_user_features_with_http_info: (Models::BetaFeatureServiceSetUserFeatureRequest beta_feature_service_set_user_feature_request) -> ::Zitadel::Client::ApiResult[Models::BetaFeatureServiceSetUserFeaturesResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_instance_service_api.rbs b/sig/zitadel/client/api/beta_instance_service_api.rbs new file mode 100644 index 00000000..858e5617 --- /dev/null +++ b/sig/zitadel/client/api/beta_instance_service_api.rbs @@ -0,0 +1,27 @@ +module Zitadel::Client + module Api + class BetaInstanceServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def add_custom_domain: (Models::BetaInstanceServiceAddCustomDomainRequest beta_instance_service_add_custom_domain_request) -> Models::BetaInstanceServiceAddCustomDomainResponse + def add_custom_domain_with_http_info: (Models::BetaInstanceServiceAddCustomDomainRequest beta_instance_service_add_custom_domain_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceAddCustomDomainResponse] + def add_trusted_domain: (Models::BetaInstanceServiceAddTrustedDomainRequest beta_instance_service_add_trusted_domain_request) -> Models::BetaInstanceServiceAddTrustedDomainResponse + def add_trusted_domain_with_http_info: (Models::BetaInstanceServiceAddTrustedDomainRequest beta_instance_service_add_trusted_domain_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceAddTrustedDomainResponse] + def delete_instance: (Models::BetaInstanceServiceDeleteInstanceRequest beta_instance_service_delete_instance_request) -> Models::BetaInstanceServiceDeleteInstanceResponse + def delete_instance_with_http_info: (Models::BetaInstanceServiceDeleteInstanceRequest beta_instance_service_delete_instance_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceDeleteInstanceResponse] + def get_instance: (Models::BetaInstanceServiceGetInstanceRequest beta_instance_service_get_instance_request) -> Models::BetaInstanceServiceGetInstanceResponse + def get_instance_with_http_info: (Models::BetaInstanceServiceGetInstanceRequest beta_instance_service_get_instance_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceGetInstanceResponse] + def list_custom_domains: (Models::BetaInstanceServiceListCustomDomainsRequest beta_instance_service_list_custom_domains_request) -> Models::BetaInstanceServiceListCustomDomainsResponse + def list_custom_domains_with_http_info: (Models::BetaInstanceServiceListCustomDomainsRequest beta_instance_service_list_custom_domains_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceListCustomDomainsResponse] + def list_instances: (Models::BetaInstanceServiceListInstancesRequest beta_instance_service_list_instances_request) -> Models::BetaInstanceServiceListInstancesResponse + def list_instances_with_http_info: (Models::BetaInstanceServiceListInstancesRequest beta_instance_service_list_instances_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceListInstancesResponse] + def list_trusted_domains: (Models::BetaInstanceServiceListTrustedDomainsRequest beta_instance_service_list_trusted_domains_request) -> Models::BetaInstanceServiceListTrustedDomainsResponse + def list_trusted_domains_with_http_info: (Models::BetaInstanceServiceListTrustedDomainsRequest beta_instance_service_list_trusted_domains_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceListTrustedDomainsResponse] + def remove_custom_domain: (Models::BetaInstanceServiceRemoveCustomDomainRequest beta_instance_service_remove_custom_domain_request) -> Models::BetaInstanceServiceRemoveCustomDomainResponse + def remove_custom_domain_with_http_info: (Models::BetaInstanceServiceRemoveCustomDomainRequest beta_instance_service_remove_custom_domain_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceRemoveCustomDomainResponse] + def remove_trusted_domain: (Models::BetaInstanceServiceRemoveTrustedDomainRequest beta_instance_service_remove_trusted_domain_request) -> Models::BetaInstanceServiceRemoveTrustedDomainResponse + def remove_trusted_domain_with_http_info: (Models::BetaInstanceServiceRemoveTrustedDomainRequest beta_instance_service_remove_trusted_domain_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceRemoveTrustedDomainResponse] + def update_instance: (Models::BetaInstanceServiceUpdateInstanceRequest beta_instance_service_update_instance_request) -> Models::BetaInstanceServiceUpdateInstanceResponse + def update_instance_with_http_info: (Models::BetaInstanceServiceUpdateInstanceRequest beta_instance_service_update_instance_request) -> ::Zitadel::Client::ApiResult[Models::BetaInstanceServiceUpdateInstanceResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_internal_permission_service_api.rbs b/sig/zitadel/client/api/beta_internal_permission_service_api.rbs new file mode 100644 index 00000000..4d95b791 --- /dev/null +++ b/sig/zitadel/client/api/beta_internal_permission_service_api.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client + module Api + class BetaInternalPermissionServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def create_administrator: (Models::BetaInternalPermissionServiceCreateAdministratorRequest beta_internal_permission_service_create_administrator_request) -> Models::BetaInternalPermissionServiceCreateAdministratorResponse + def create_administrator_with_http_info: (Models::BetaInternalPermissionServiceCreateAdministratorRequest beta_internal_permission_service_create_administrator_request) -> ::Zitadel::Client::ApiResult[Models::BetaInternalPermissionServiceCreateAdministratorResponse] + def delete_administrator: (Models::BetaInternalPermissionServiceDeleteAdministratorRequest beta_internal_permission_service_delete_administrator_request) -> Models::BetaInternalPermissionServiceDeleteAdministratorResponse + def delete_administrator_with_http_info: (Models::BetaInternalPermissionServiceDeleteAdministratorRequest beta_internal_permission_service_delete_administrator_request) -> ::Zitadel::Client::ApiResult[Models::BetaInternalPermissionServiceDeleteAdministratorResponse] + def list_administrators: (Models::BetaInternalPermissionServiceListAdministratorsRequest beta_internal_permission_service_list_administrators_request) -> Models::BetaInternalPermissionServiceListAdministratorsResponse + def list_administrators_with_http_info: (Models::BetaInternalPermissionServiceListAdministratorsRequest beta_internal_permission_service_list_administrators_request) -> ::Zitadel::Client::ApiResult[Models::BetaInternalPermissionServiceListAdministratorsResponse] + def update_administrator: (Models::BetaInternalPermissionServiceUpdateAdministratorRequest beta_internal_permission_service_update_administrator_request) -> Models::BetaInternalPermissionServiceUpdateAdministratorResponse + def update_administrator_with_http_info: (Models::BetaInternalPermissionServiceUpdateAdministratorRequest beta_internal_permission_service_update_administrator_request) -> ::Zitadel::Client::ApiResult[Models::BetaInternalPermissionServiceUpdateAdministratorResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_oidc_service_api.rbs b/sig/zitadel/client/api/beta_oidc_service_api.rbs new file mode 100644 index 00000000..a2133a50 --- /dev/null +++ b/sig/zitadel/client/api/beta_oidc_service_api.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client + module Api + class BetaOIDCServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def create_callback: (Models::BetaOIDCServiceCreateCallbackRequest beta_oidc_service_create_callback_request) -> Models::BetaOIDCServiceCreateCallbackResponse + def create_callback_with_http_info: (Models::BetaOIDCServiceCreateCallbackRequest beta_oidc_service_create_callback_request) -> ::Zitadel::Client::ApiResult[Models::BetaOIDCServiceCreateCallbackResponse] + def get_auth_request: (Models::BetaOIDCServiceGetAuthRequestRequest beta_oidc_service_get_auth_request_request) -> Models::BetaOIDCServiceGetAuthRequestResponse + def get_auth_request_with_http_info: (Models::BetaOIDCServiceGetAuthRequestRequest beta_oidc_service_get_auth_request_request) -> ::Zitadel::Client::ApiResult[Models::BetaOIDCServiceGetAuthRequestResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_organization_service_api.rbs b/sig/zitadel/client/api/beta_organization_service_api.rbs new file mode 100644 index 00000000..253194d4 --- /dev/null +++ b/sig/zitadel/client/api/beta_organization_service_api.rbs @@ -0,0 +1,35 @@ +module Zitadel::Client + module Api + class BetaOrganizationServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def activate_organization: (Models::BetaOrganizationServiceActivateOrganizationRequest beta_organization_service_activate_organization_request) -> Models::BetaOrganizationServiceActivateOrganizationResponse + def activate_organization_with_http_info: (Models::BetaOrganizationServiceActivateOrganizationRequest beta_organization_service_activate_organization_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceActivateOrganizationResponse] + def add_organization_domain: (Models::BetaOrganizationServiceAddOrganizationDomainRequest beta_organization_service_add_organization_domain_request) -> Models::BetaOrganizationServiceAddOrganizationDomainResponse + def add_organization_domain_with_http_info: (Models::BetaOrganizationServiceAddOrganizationDomainRequest beta_organization_service_add_organization_domain_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceAddOrganizationDomainResponse] + def create_organization: (Models::BetaOrganizationServiceCreateOrganizationRequest beta_organization_service_create_organization_request) -> Models::BetaOrganizationServiceCreateOrganizationResponse + def create_organization_with_http_info: (Models::BetaOrganizationServiceCreateOrganizationRequest beta_organization_service_create_organization_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceCreateOrganizationResponse] + def deactivate_organization: (Models::BetaOrganizationServiceDeactivateOrganizationRequest beta_organization_service_deactivate_organization_request) -> Models::BetaOrganizationServiceDeactivateOrganizationResponse + def deactivate_organization_with_http_info: (Models::BetaOrganizationServiceDeactivateOrganizationRequest beta_organization_service_deactivate_organization_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceDeactivateOrganizationResponse] + def delete_organization: (Models::BetaOrganizationServiceDeleteOrganizationRequest beta_organization_service_delete_organization_request) -> Models::BetaOrganizationServiceDeleteOrganizationResponse + def delete_organization_with_http_info: (Models::BetaOrganizationServiceDeleteOrganizationRequest beta_organization_service_delete_organization_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceDeleteOrganizationResponse] + def delete_organization_domain: (Models::BetaOrganizationServiceDeleteOrganizationDomainRequest beta_organization_service_delete_organization_domain_request) -> Models::BetaOrganizationServiceDeleteOrganizationDomainResponse + def delete_organization_domain_with_http_info: (Models::BetaOrganizationServiceDeleteOrganizationDomainRequest beta_organization_service_delete_organization_domain_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceDeleteOrganizationDomainResponse] + def delete_organization_metadata: (Models::BetaOrganizationServiceDeleteOrganizationMetadataRequest beta_organization_service_delete_organization_metadata_request) -> Models::BetaOrganizationServiceDeleteOrganizationMetadataResponse + def delete_organization_metadata_with_http_info: (Models::BetaOrganizationServiceDeleteOrganizationMetadataRequest beta_organization_service_delete_organization_metadata_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceDeleteOrganizationMetadataResponse] + def generate_organization_domain_validation: (Models::BetaOrganizationServiceGenerateOrganizationDomainValidationRequest beta_organization_service_generate_organization_domain_validation_request) -> Models::BetaOrganizationServiceGenerateOrganizationDomainValidationResponse + def generate_organization_domain_validation_with_http_info: (Models::BetaOrganizationServiceGenerateOrganizationDomainValidationRequest beta_organization_service_generate_organization_domain_validation_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceGenerateOrganizationDomainValidationResponse] + def list_organization_domains: (Models::BetaOrganizationServiceListOrganizationDomainsRequest beta_organization_service_list_organization_domains_request) -> Models::BetaOrganizationServiceListOrganizationDomainsResponse + def list_organization_domains_with_http_info: (Models::BetaOrganizationServiceListOrganizationDomainsRequest beta_organization_service_list_organization_domains_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceListOrganizationDomainsResponse] + def list_organization_metadata: (Models::BetaOrganizationServiceListOrganizationMetadataRequest beta_organization_service_list_organization_metadata_request) -> Models::BetaOrganizationServiceListOrganizationMetadataResponse + def list_organization_metadata_with_http_info: (Models::BetaOrganizationServiceListOrganizationMetadataRequest beta_organization_service_list_organization_metadata_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceListOrganizationMetadataResponse] + def list_organizations: (Models::BetaOrganizationServiceListOrganizationsRequest beta_organization_service_list_organizations_request) -> Models::BetaOrganizationServiceListOrganizationsResponse + def list_organizations_with_http_info: (Models::BetaOrganizationServiceListOrganizationsRequest beta_organization_service_list_organizations_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceListOrganizationsResponse] + def set_organization_metadata: (Models::BetaOrganizationServiceSetOrganizationMetadataRequest beta_organization_service_set_organization_metadata_request) -> Models::BetaOrganizationServiceSetOrganizationMetadataResponse + def set_organization_metadata_with_http_info: (Models::BetaOrganizationServiceSetOrganizationMetadataRequest beta_organization_service_set_organization_metadata_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceSetOrganizationMetadataResponse] + def update_organization: (Models::BetaOrganizationServiceUpdateOrganizationRequest beta_organization_service_update_organization_request) -> Models::BetaOrganizationServiceUpdateOrganizationResponse + def update_organization_with_http_info: (Models::BetaOrganizationServiceUpdateOrganizationRequest beta_organization_service_update_organization_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceUpdateOrganizationResponse] + def verify_organization_domain: (Models::BetaOrganizationServiceVerifyOrganizationDomainRequest beta_organization_service_verify_organization_domain_request) -> Models::BetaOrganizationServiceVerifyOrganizationDomainResponse + def verify_organization_domain_with_http_info: (Models::BetaOrganizationServiceVerifyOrganizationDomainRequest beta_organization_service_verify_organization_domain_request) -> ::Zitadel::Client::ApiResult[Models::BetaOrganizationServiceVerifyOrganizationDomainResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_project_service_api.rbs b/sig/zitadel/client/api/beta_project_service_api.rbs new file mode 100644 index 00000000..53fb628b --- /dev/null +++ b/sig/zitadel/client/api/beta_project_service_api.rbs @@ -0,0 +1,41 @@ +module Zitadel::Client + module Api + class BetaProjectServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def activate_project: (Models::BetaProjectServiceActivateProjectRequest beta_project_service_activate_project_request) -> Models::BetaProjectServiceActivateProjectResponse + def activate_project_with_http_info: (Models::BetaProjectServiceActivateProjectRequest beta_project_service_activate_project_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceActivateProjectResponse] + def activate_project_grant: (Models::BetaProjectServiceActivateProjectGrantRequest beta_project_service_activate_project_grant_request) -> Models::BetaProjectServiceActivateProjectGrantResponse + def activate_project_grant_with_http_info: (Models::BetaProjectServiceActivateProjectGrantRequest beta_project_service_activate_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceActivateProjectGrantResponse] + def add_project_role: (Models::BetaProjectServiceAddProjectRoleRequest beta_project_service_add_project_role_request) -> Models::BetaProjectServiceAddProjectRoleResponse + def add_project_role_with_http_info: (Models::BetaProjectServiceAddProjectRoleRequest beta_project_service_add_project_role_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceAddProjectRoleResponse] + def create_project: (Models::BetaProjectServiceCreateProjectRequest beta_project_service_create_project_request) -> Models::BetaProjectServiceCreateProjectResponse + def create_project_with_http_info: (Models::BetaProjectServiceCreateProjectRequest beta_project_service_create_project_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceCreateProjectResponse] + def create_project_grant: (Models::BetaProjectServiceCreateProjectGrantRequest beta_project_service_create_project_grant_request) -> Models::BetaProjectServiceCreateProjectGrantResponse + def create_project_grant_with_http_info: (Models::BetaProjectServiceCreateProjectGrantRequest beta_project_service_create_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceCreateProjectGrantResponse] + def deactivate_project: (Models::BetaProjectServiceDeactivateProjectRequest beta_project_service_deactivate_project_request) -> Models::BetaProjectServiceDeactivateProjectResponse + def deactivate_project_with_http_info: (Models::BetaProjectServiceDeactivateProjectRequest beta_project_service_deactivate_project_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceDeactivateProjectResponse] + def deactivate_project_grant: (Models::BetaProjectServiceDeactivateProjectGrantRequest beta_project_service_deactivate_project_grant_request) -> Models::BetaProjectServiceDeactivateProjectGrantResponse + def deactivate_project_grant_with_http_info: (Models::BetaProjectServiceDeactivateProjectGrantRequest beta_project_service_deactivate_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceDeactivateProjectGrantResponse] + def delete_project: (Models::BetaProjectServiceDeleteProjectRequest beta_project_service_delete_project_request) -> Models::BetaProjectServiceDeleteProjectResponse + def delete_project_with_http_info: (Models::BetaProjectServiceDeleteProjectRequest beta_project_service_delete_project_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceDeleteProjectResponse] + def delete_project_grant: (Models::BetaProjectServiceDeleteProjectGrantRequest beta_project_service_delete_project_grant_request) -> Models::BetaProjectServiceDeleteProjectGrantResponse + def delete_project_grant_with_http_info: (Models::BetaProjectServiceDeleteProjectGrantRequest beta_project_service_delete_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceDeleteProjectGrantResponse] + def get_project: (Models::BetaProjectServiceGetProjectRequest beta_project_service_get_project_request) -> Models::BetaProjectServiceGetProjectResponse + def get_project_with_http_info: (Models::BetaProjectServiceGetProjectRequest beta_project_service_get_project_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceGetProjectResponse] + def list_project_grants: (Models::BetaProjectServiceListProjectGrantsRequest beta_project_service_list_project_grants_request) -> Models::BetaProjectServiceListProjectGrantsResponse + def list_project_grants_with_http_info: (Models::BetaProjectServiceListProjectGrantsRequest beta_project_service_list_project_grants_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceListProjectGrantsResponse] + def list_project_roles: (Models::BetaProjectServiceListProjectRolesRequest beta_project_service_list_project_roles_request) -> Models::BetaProjectServiceListProjectRolesResponse + def list_project_roles_with_http_info: (Models::BetaProjectServiceListProjectRolesRequest beta_project_service_list_project_roles_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceListProjectRolesResponse] + def list_projects: (Models::BetaProjectServiceListProjectsRequest beta_project_service_list_projects_request) -> Models::BetaProjectServiceListProjectsResponse + def list_projects_with_http_info: (Models::BetaProjectServiceListProjectsRequest beta_project_service_list_projects_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceListProjectsResponse] + def remove_project_role: (Models::BetaProjectServiceRemoveProjectRoleRequest beta_project_service_remove_project_role_request) -> Models::BetaProjectServiceRemoveProjectRoleResponse + def remove_project_role_with_http_info: (Models::BetaProjectServiceRemoveProjectRoleRequest beta_project_service_remove_project_role_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceRemoveProjectRoleResponse] + def update_project: (Models::BetaProjectServiceUpdateProjectRequest beta_project_service_update_project_request) -> Models::BetaProjectServiceUpdateProjectResponse + def update_project_with_http_info: (Models::BetaProjectServiceUpdateProjectRequest beta_project_service_update_project_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceUpdateProjectResponse] + def update_project_grant: (Models::BetaProjectServiceUpdateProjectGrantRequest beta_project_service_update_project_grant_request) -> Models::BetaProjectServiceUpdateProjectGrantResponse + def update_project_grant_with_http_info: (Models::BetaProjectServiceUpdateProjectGrantRequest beta_project_service_update_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceUpdateProjectGrantResponse] + def update_project_role: (Models::BetaProjectServiceUpdateProjectRoleRequest beta_project_service_update_project_role_request) -> Models::BetaProjectServiceUpdateProjectRoleResponse + def update_project_role_with_http_info: (Models::BetaProjectServiceUpdateProjectRoleRequest beta_project_service_update_project_role_request) -> ::Zitadel::Client::ApiResult[Models::BetaProjectServiceUpdateProjectRoleResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_session_service_api.rbs b/sig/zitadel/client/api/beta_session_service_api.rbs new file mode 100644 index 00000000..24d16e3e --- /dev/null +++ b/sig/zitadel/client/api/beta_session_service_api.rbs @@ -0,0 +1,17 @@ +module Zitadel::Client + module Api + class BetaSessionServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def create_session: (Models::BetaSessionServiceCreateSessionRequest beta_session_service_create_session_request) -> Models::BetaSessionServiceCreateSessionResponse + def create_session_with_http_info: (Models::BetaSessionServiceCreateSessionRequest beta_session_service_create_session_request) -> ::Zitadel::Client::ApiResult[Models::BetaSessionServiceCreateSessionResponse] + def delete_session: (Models::BetaSessionServiceDeleteSessionRequest beta_session_service_delete_session_request) -> Models::BetaSessionServiceDeleteSessionResponse + def delete_session_with_http_info: (Models::BetaSessionServiceDeleteSessionRequest beta_session_service_delete_session_request) -> ::Zitadel::Client::ApiResult[Models::BetaSessionServiceDeleteSessionResponse] + def get_session: (Models::BetaSessionServiceGetSessionRequest beta_session_service_get_session_request) -> Models::BetaSessionServiceGetSessionResponse + def get_session_with_http_info: (Models::BetaSessionServiceGetSessionRequest beta_session_service_get_session_request) -> ::Zitadel::Client::ApiResult[Models::BetaSessionServiceGetSessionResponse] + def list_sessions: (Models::BetaSessionServiceListSessionsRequest beta_session_service_list_sessions_request) -> Models::BetaSessionServiceListSessionsResponse + def list_sessions_with_http_info: (Models::BetaSessionServiceListSessionsRequest beta_session_service_list_sessions_request) -> ::Zitadel::Client::ApiResult[Models::BetaSessionServiceListSessionsResponse] + def set_session: (Models::BetaSessionServiceSetSessionRequest beta_session_service_set_session_request) -> Models::BetaSessionServiceSetSessionResponse + def set_session_with_http_info: (Models::BetaSessionServiceSetSessionRequest beta_session_service_set_session_request) -> ::Zitadel::Client::ApiResult[Models::BetaSessionServiceSetSessionResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_settings_service_api.rbs b/sig/zitadel/client/api/beta_settings_service_api.rbs new file mode 100644 index 00000000..8dc0a7dc --- /dev/null +++ b/sig/zitadel/client/api/beta_settings_service_api.rbs @@ -0,0 +1,29 @@ +module Zitadel::Client + module Api + class BetaSettingsServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def get_active_identity_providers: (Models::BetaSettingsServiceGetActiveIdentityProvidersRequest beta_settings_service_get_active_identity_providers_request) -> Models::BetaSettingsServiceGetActiveIdentityProvidersResponse + def get_active_identity_providers_with_http_info: (Models::BetaSettingsServiceGetActiveIdentityProvidersRequest beta_settings_service_get_active_identity_providers_request) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetActiveIdentityProvidersResponse] + def get_branding_settings: (Models::BetaSettingsServiceGetBrandingSettingsRequest beta_settings_service_get_branding_settings_request) -> Models::BetaSettingsServiceGetBrandingSettingsResponse + def get_branding_settings_with_http_info: (Models::BetaSettingsServiceGetBrandingSettingsRequest beta_settings_service_get_branding_settings_request) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetBrandingSettingsResponse] + def get_domain_settings: (Models::BetaSettingsServiceGetDomainSettingsRequest beta_settings_service_get_domain_settings_request) -> Models::BetaSettingsServiceGetDomainSettingsResponse + def get_domain_settings_with_http_info: (Models::BetaSettingsServiceGetDomainSettingsRequest beta_settings_service_get_domain_settings_request) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetDomainSettingsResponse] + def get_general_settings: (untyped body) -> Models::BetaSettingsServiceGetGeneralSettingsResponse + def get_general_settings_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetGeneralSettingsResponse] + def get_legal_and_support_settings: (Models::BetaSettingsServiceGetLegalAndSupportSettingsRequest beta_settings_service_get_legal_and_support_settings_request) -> Models::BetaSettingsServiceGetLegalAndSupportSettingsResponse + def get_legal_and_support_settings_with_http_info: (Models::BetaSettingsServiceGetLegalAndSupportSettingsRequest beta_settings_service_get_legal_and_support_settings_request) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetLegalAndSupportSettingsResponse] + def get_lockout_settings: (Models::BetaSettingsServiceGetLockoutSettingsRequest beta_settings_service_get_lockout_settings_request) -> Models::BetaSettingsServiceGetLockoutSettingsResponse + def get_lockout_settings_with_http_info: (Models::BetaSettingsServiceGetLockoutSettingsRequest beta_settings_service_get_lockout_settings_request) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetLockoutSettingsResponse] + def get_login_settings: (Models::BetaSettingsServiceGetLoginSettingsRequest beta_settings_service_get_login_settings_request) -> Models::BetaSettingsServiceGetLoginSettingsResponse + def get_login_settings_with_http_info: (Models::BetaSettingsServiceGetLoginSettingsRequest beta_settings_service_get_login_settings_request) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetLoginSettingsResponse] + def get_password_complexity_settings: (Models::BetaSettingsServiceGetPasswordComplexitySettingsRequest beta_settings_service_get_password_complexity_settings_request) -> Models::BetaSettingsServiceGetPasswordComplexitySettingsResponse + def get_password_complexity_settings_with_http_info: (Models::BetaSettingsServiceGetPasswordComplexitySettingsRequest beta_settings_service_get_password_complexity_settings_request) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetPasswordComplexitySettingsResponse] + def get_password_expiry_settings: (Models::BetaSettingsServiceGetPasswordExpirySettingsRequest beta_settings_service_get_password_expiry_settings_request) -> Models::BetaSettingsServiceGetPasswordExpirySettingsResponse + def get_password_expiry_settings_with_http_info: (Models::BetaSettingsServiceGetPasswordExpirySettingsRequest beta_settings_service_get_password_expiry_settings_request) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetPasswordExpirySettingsResponse] + def get_security_settings: (untyped body) -> Models::BetaSettingsServiceGetSecuritySettingsResponse + def get_security_settings_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceGetSecuritySettingsResponse] + def set_security_settings: (Models::BetaSettingsServiceSetSecuritySettingsRequest beta_settings_service_set_security_settings_request) -> Models::BetaSettingsServiceSetSecuritySettingsResponse + def set_security_settings_with_http_info: (Models::BetaSettingsServiceSetSecuritySettingsRequest beta_settings_service_set_security_settings_request) -> ::Zitadel::Client::ApiResult[Models::BetaSettingsServiceSetSecuritySettingsResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_telemetry_service_api.rbs b/sig/zitadel/client/api/beta_telemetry_service_api.rbs new file mode 100644 index 00000000..e7380d82 --- /dev/null +++ b/sig/zitadel/client/api/beta_telemetry_service_api.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client + module Api + class BetaTelemetryServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def report_base_information: (Models::BetaTelemetryServiceReportBaseInformationRequest beta_telemetry_service_report_base_information_request) -> Models::BetaTelemetryServiceReportBaseInformationResponse + def report_base_information_with_http_info: (Models::BetaTelemetryServiceReportBaseInformationRequest beta_telemetry_service_report_base_information_request) -> ::Zitadel::Client::ApiResult[Models::BetaTelemetryServiceReportBaseInformationResponse] + def report_resource_counts: (Models::BetaTelemetryServiceReportResourceCountsRequest beta_telemetry_service_report_resource_counts_request) -> Models::BetaTelemetryServiceReportResourceCountsResponse + def report_resource_counts_with_http_info: (Models::BetaTelemetryServiceReportResourceCountsRequest beta_telemetry_service_report_resource_counts_request) -> ::Zitadel::Client::ApiResult[Models::BetaTelemetryServiceReportResourceCountsResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_user_service_api.rbs b/sig/zitadel/client/api/beta_user_service_api.rbs new file mode 100644 index 00000000..6efc8419 --- /dev/null +++ b/sig/zitadel/client/api/beta_user_service_api.rbs @@ -0,0 +1,75 @@ +module Zitadel::Client + module Api + class BetaUserServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def add_human_user: (Models::BetaUserServiceAddHumanUserRequest beta_user_service_add_human_user_request) -> Models::BetaUserServiceAddHumanUserResponse + def add_human_user_with_http_info: (Models::BetaUserServiceAddHumanUserRequest beta_user_service_add_human_user_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceAddHumanUserResponse] + def add_idp_link: (Models::BetaUserServiceAddIDPLinkRequest beta_user_service_add_idp_link_request) -> Models::BetaUserServiceAddIDPLinkResponse + def add_idp_link_with_http_info: (Models::BetaUserServiceAddIDPLinkRequest beta_user_service_add_idp_link_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceAddIDPLinkResponse] + def add_otp_email: (Models::BetaUserServiceAddOTPEmailRequest beta_user_service_add_otp_email_request) -> Models::BetaUserServiceAddOTPEmailResponse + def add_otp_email_with_http_info: (Models::BetaUserServiceAddOTPEmailRequest beta_user_service_add_otp_email_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceAddOTPEmailResponse] + def add_otpsms: (Models::BetaUserServiceAddOTPSMSRequest beta_user_service_add_otpsms_request) -> Models::BetaUserServiceAddOTPSMSResponse + def add_otpsms_with_http_info: (Models::BetaUserServiceAddOTPSMSRequest beta_user_service_add_otpsms_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceAddOTPSMSResponse] + def create_passkey_registration_link: (Models::BetaUserServiceCreatePasskeyRegistrationLinkRequest beta_user_service_create_passkey_registration_link_request) -> Models::BetaUserServiceCreatePasskeyRegistrationLinkResponse + def create_passkey_registration_link_with_http_info: (Models::BetaUserServiceCreatePasskeyRegistrationLinkRequest beta_user_service_create_passkey_registration_link_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceCreatePasskeyRegistrationLinkResponse] + def deactivate_user: (Models::BetaUserServiceDeactivateUserRequest beta_user_service_deactivate_user_request) -> Models::BetaUserServiceDeactivateUserResponse + def deactivate_user_with_http_info: (Models::BetaUserServiceDeactivateUserRequest beta_user_service_deactivate_user_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceDeactivateUserResponse] + def delete_user: (Models::BetaUserServiceDeleteUserRequest beta_user_service_delete_user_request) -> Models::BetaUserServiceDeleteUserResponse + def delete_user_with_http_info: (Models::BetaUserServiceDeleteUserRequest beta_user_service_delete_user_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceDeleteUserResponse] + def get_user_by_id: (Models::BetaUserServiceGetUserByIDRequest beta_user_service_get_user_by_id_request) -> Models::BetaUserServiceGetUserByIDResponse + def get_user_by_id_with_http_info: (Models::BetaUserServiceGetUserByIDRequest beta_user_service_get_user_by_id_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceGetUserByIDResponse] + def list_authentication_method_types: (Models::BetaUserServiceListAuthenticationMethodTypesRequest beta_user_service_list_authentication_method_types_request) -> Models::BetaUserServiceListAuthenticationMethodTypesResponse + def list_authentication_method_types_with_http_info: (Models::BetaUserServiceListAuthenticationMethodTypesRequest beta_user_service_list_authentication_method_types_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceListAuthenticationMethodTypesResponse] + def list_users: (Models::BetaUserServiceListUsersRequest beta_user_service_list_users_request) -> Models::BetaUserServiceListUsersResponse + def list_users_with_http_info: (Models::BetaUserServiceListUsersRequest beta_user_service_list_users_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceListUsersResponse] + def lock_user: (Models::BetaUserServiceLockUserRequest beta_user_service_lock_user_request) -> Models::BetaUserServiceLockUserResponse + def lock_user_with_http_info: (Models::BetaUserServiceLockUserRequest beta_user_service_lock_user_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceLockUserResponse] + def password_reset: (Models::BetaUserServicePasswordResetRequest beta_user_service_password_reset_request) -> Models::BetaUserServicePasswordResetResponse + def password_reset_with_http_info: (Models::BetaUserServicePasswordResetRequest beta_user_service_password_reset_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServicePasswordResetResponse] + def reactivate_user: (Models::BetaUserServiceReactivateUserRequest beta_user_service_reactivate_user_request) -> Models::BetaUserServiceReactivateUserResponse + def reactivate_user_with_http_info: (Models::BetaUserServiceReactivateUserRequest beta_user_service_reactivate_user_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceReactivateUserResponse] + def register_passkey: (Models::BetaUserServiceRegisterPasskeyRequest beta_user_service_register_passkey_request) -> Models::BetaUserServiceRegisterPasskeyResponse + def register_passkey_with_http_info: (Models::BetaUserServiceRegisterPasskeyRequest beta_user_service_register_passkey_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceRegisterPasskeyResponse] + def register_totp: (Models::BetaUserServiceRegisterTOTPRequest beta_user_service_register_totp_request) -> Models::BetaUserServiceRegisterTOTPResponse + def register_totp_with_http_info: (Models::BetaUserServiceRegisterTOTPRequest beta_user_service_register_totp_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceRegisterTOTPResponse] + def register_u2_f: (Models::BetaUserServiceRegisterU2FRequest beta_user_service_register_u2_f_request) -> Models::BetaUserServiceRegisterU2FResponse + def register_u2_f_with_http_info: (Models::BetaUserServiceRegisterU2FRequest beta_user_service_register_u2_f_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceRegisterU2FResponse] + def remove_otp_email: (Models::BetaUserServiceRemoveOTPEmailRequest beta_user_service_remove_otp_email_request) -> Models::BetaUserServiceRemoveOTPEmailResponse + def remove_otp_email_with_http_info: (Models::BetaUserServiceRemoveOTPEmailRequest beta_user_service_remove_otp_email_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceRemoveOTPEmailResponse] + def remove_otpsms: (Models::BetaUserServiceRemoveOTPSMSRequest beta_user_service_remove_otpsms_request) -> Models::BetaUserServiceRemoveOTPSMSResponse + def remove_otpsms_with_http_info: (Models::BetaUserServiceRemoveOTPSMSRequest beta_user_service_remove_otpsms_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceRemoveOTPSMSResponse] + def remove_phone: (Models::BetaUserServiceRemovePhoneRequest beta_user_service_remove_phone_request) -> Models::BetaUserServiceRemovePhoneResponse + def remove_phone_with_http_info: (Models::BetaUserServiceRemovePhoneRequest beta_user_service_remove_phone_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceRemovePhoneResponse] + def remove_totp: (Models::BetaUserServiceRemoveTOTPRequest beta_user_service_remove_totp_request) -> Models::BetaUserServiceRemoveTOTPResponse + def remove_totp_with_http_info: (Models::BetaUserServiceRemoveTOTPRequest beta_user_service_remove_totp_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceRemoveTOTPResponse] + def resend_email_code: (Models::BetaUserServiceResendEmailCodeRequest beta_user_service_resend_email_code_request) -> Models::BetaUserServiceResendEmailCodeResponse + def resend_email_code_with_http_info: (Models::BetaUserServiceResendEmailCodeRequest beta_user_service_resend_email_code_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceResendEmailCodeResponse] + def resend_phone_code: (Models::BetaUserServiceResendPhoneCodeRequest beta_user_service_resend_phone_code_request) -> Models::BetaUserServiceResendPhoneCodeResponse + def resend_phone_code_with_http_info: (Models::BetaUserServiceResendPhoneCodeRequest beta_user_service_resend_phone_code_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceResendPhoneCodeResponse] + def retrieve_identity_provider_intent: (Models::BetaUserServiceRetrieveIdentityProviderIntentRequest beta_user_service_retrieve_identity_provider_intent_request) -> Models::BetaUserServiceRetrieveIdentityProviderIntentResponse + def retrieve_identity_provider_intent_with_http_info: (Models::BetaUserServiceRetrieveIdentityProviderIntentRequest beta_user_service_retrieve_identity_provider_intent_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceRetrieveIdentityProviderIntentResponse] + def set_email: (Models::BetaUserServiceSetEmailRequest beta_user_service_set_email_request) -> Models::BetaUserServiceSetEmailResponse + def set_email_with_http_info: (Models::BetaUserServiceSetEmailRequest beta_user_service_set_email_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceSetEmailResponse] + def set_password: (Models::BetaUserServiceSetPasswordRequest beta_user_service_set_password_request) -> Models::BetaUserServiceSetPasswordResponse + def set_password_with_http_info: (Models::BetaUserServiceSetPasswordRequest beta_user_service_set_password_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceSetPasswordResponse] + def set_phone: (Models::BetaUserServiceSetPhoneRequest beta_user_service_set_phone_request) -> Models::BetaUserServiceSetPhoneResponse + def set_phone_with_http_info: (Models::BetaUserServiceSetPhoneRequest beta_user_service_set_phone_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceSetPhoneResponse] + def start_identity_provider_intent: (Models::BetaUserServiceStartIdentityProviderIntentRequest beta_user_service_start_identity_provider_intent_request) -> Models::BetaUserServiceStartIdentityProviderIntentResponse + def start_identity_provider_intent_with_http_info: (Models::BetaUserServiceStartIdentityProviderIntentRequest beta_user_service_start_identity_provider_intent_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceStartIdentityProviderIntentResponse] + def unlock_user: (Models::BetaUserServiceUnlockUserRequest beta_user_service_unlock_user_request) -> Models::BetaUserServiceUnlockUserResponse + def unlock_user_with_http_info: (Models::BetaUserServiceUnlockUserRequest beta_user_service_unlock_user_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceUnlockUserResponse] + def update_human_user: (Models::BetaUserServiceUpdateHumanUserRequest beta_user_service_update_human_user_request) -> Models::BetaUserServiceUpdateHumanUserResponse + def update_human_user_with_http_info: (Models::BetaUserServiceUpdateHumanUserRequest beta_user_service_update_human_user_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceUpdateHumanUserResponse] + def verify_email: (Models::BetaUserServiceVerifyEmailRequest beta_user_service_verify_email_request) -> Models::BetaUserServiceVerifyEmailResponse + def verify_email_with_http_info: (Models::BetaUserServiceVerifyEmailRequest beta_user_service_verify_email_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceVerifyEmailResponse] + def verify_passkey_registration: (Models::BetaUserServiceVerifyPasskeyRegistrationRequest beta_user_service_verify_passkey_registration_request) -> Models::BetaUserServiceVerifyPasskeyRegistrationResponse + def verify_passkey_registration_with_http_info: (Models::BetaUserServiceVerifyPasskeyRegistrationRequest beta_user_service_verify_passkey_registration_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceVerifyPasskeyRegistrationResponse] + def verify_phone: (Models::BetaUserServiceVerifyPhoneRequest beta_user_service_verify_phone_request) -> Models::BetaUserServiceVerifyPhoneResponse + def verify_phone_with_http_info: (Models::BetaUserServiceVerifyPhoneRequest beta_user_service_verify_phone_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceVerifyPhoneResponse] + def verify_totp_registration: (Models::BetaUserServiceVerifyTOTPRegistrationRequest beta_user_service_verify_totp_registration_request) -> Models::BetaUserServiceVerifyTOTPRegistrationResponse + def verify_totp_registration_with_http_info: (Models::BetaUserServiceVerifyTOTPRegistrationRequest beta_user_service_verify_totp_registration_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceVerifyTOTPRegistrationResponse] + def verify_u2_f_registration: (Models::BetaUserServiceVerifyU2FRegistrationRequest beta_user_service_verify_u2_f_registration_request) -> Models::BetaUserServiceVerifyU2FRegistrationResponse + def verify_u2_f_registration_with_http_info: (Models::BetaUserServiceVerifyU2FRegistrationRequest beta_user_service_verify_u2_f_registration_request) -> ::Zitadel::Client::ApiResult[Models::BetaUserServiceVerifyU2FRegistrationResponse] + end + end +end diff --git a/sig/zitadel/client/api/beta_web_key_service_api.rbs b/sig/zitadel/client/api/beta_web_key_service_api.rbs new file mode 100644 index 00000000..e3f20fe3 --- /dev/null +++ b/sig/zitadel/client/api/beta_web_key_service_api.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client + module Api + class BetaWebKeyServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def activate_web_key: (Models::BetaWebKeyServiceActivateWebKeyRequest beta_web_key_service_activate_web_key_request) -> Models::BetaWebKeyServiceActivateWebKeyResponse + def activate_web_key_with_http_info: (Models::BetaWebKeyServiceActivateWebKeyRequest beta_web_key_service_activate_web_key_request) -> ::Zitadel::Client::ApiResult[Models::BetaWebKeyServiceActivateWebKeyResponse] + def create_web_key: (Models::BetaWebKeyServiceCreateWebKeyRequest beta_web_key_service_create_web_key_request) -> Models::BetaWebKeyServiceCreateWebKeyResponse + def create_web_key_with_http_info: (Models::BetaWebKeyServiceCreateWebKeyRequest beta_web_key_service_create_web_key_request) -> ::Zitadel::Client::ApiResult[Models::BetaWebKeyServiceCreateWebKeyResponse] + def delete_web_key: (Models::BetaWebKeyServiceDeleteWebKeyRequest beta_web_key_service_delete_web_key_request) -> Models::BetaWebKeyServiceDeleteWebKeyResponse + def delete_web_key_with_http_info: (Models::BetaWebKeyServiceDeleteWebKeyRequest beta_web_key_service_delete_web_key_request) -> ::Zitadel::Client::ApiResult[Models::BetaWebKeyServiceDeleteWebKeyResponse] + def list_web_keys: (untyped body) -> Models::BetaWebKeyServiceListWebKeysResponse + def list_web_keys_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::BetaWebKeyServiceListWebKeysResponse] + end + end +end diff --git a/sig/zitadel/client/api/feature_service_api.rbs b/sig/zitadel/client/api/feature_service_api.rbs new file mode 100644 index 00000000..05d54374 --- /dev/null +++ b/sig/zitadel/client/api/feature_service_api.rbs @@ -0,0 +1,31 @@ +module Zitadel::Client + module Api + class FeatureServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def get_instance_features: (Models::FeatureServiceGetInstanceFeaturesRequest feature_service_get_instance_features_request) -> Models::FeatureServiceGetInstanceFeaturesResponse + def get_instance_features_with_http_info: (Models::FeatureServiceGetInstanceFeaturesRequest feature_service_get_instance_features_request) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceGetInstanceFeaturesResponse] + def get_organization_features: (Models::FeatureServiceGetOrganizationFeaturesRequest feature_service_get_organization_features_request) -> Models::FeatureServiceGetOrganizationFeaturesResponse + def get_organization_features_with_http_info: (Models::FeatureServiceGetOrganizationFeaturesRequest feature_service_get_organization_features_request) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceGetOrganizationFeaturesResponse] + def get_system_features: (untyped body) -> Models::FeatureServiceGetSystemFeaturesResponse + def get_system_features_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceGetSystemFeaturesResponse] + def get_user_features: (Models::FeatureServiceGetUserFeaturesRequest feature_service_get_user_features_request) -> Models::FeatureServiceGetUserFeaturesResponse + def get_user_features_with_http_info: (Models::FeatureServiceGetUserFeaturesRequest feature_service_get_user_features_request) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceGetUserFeaturesResponse] + def reset_instance_features: (untyped body) -> Models::FeatureServiceResetInstanceFeaturesResponse + def reset_instance_features_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceResetInstanceFeaturesResponse] + def reset_organization_features: (Models::FeatureServiceResetOrganizationFeaturesRequest feature_service_reset_organization_features_request) -> Models::FeatureServiceResetOrganizationFeaturesResponse + def reset_organization_features_with_http_info: (Models::FeatureServiceResetOrganizationFeaturesRequest feature_service_reset_organization_features_request) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceResetOrganizationFeaturesResponse] + def reset_system_features: (untyped body) -> Models::FeatureServiceResetSystemFeaturesResponse + def reset_system_features_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceResetSystemFeaturesResponse] + def reset_user_features: (Models::FeatureServiceResetUserFeaturesRequest feature_service_reset_user_features_request) -> Models::FeatureServiceResetUserFeaturesResponse + def reset_user_features_with_http_info: (Models::FeatureServiceResetUserFeaturesRequest feature_service_reset_user_features_request) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceResetUserFeaturesResponse] + def set_instance_features: (Models::FeatureServiceSetInstanceFeaturesRequest feature_service_set_instance_features_request) -> Models::FeatureServiceSetInstanceFeaturesResponse + def set_instance_features_with_http_info: (Models::FeatureServiceSetInstanceFeaturesRequest feature_service_set_instance_features_request) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceSetInstanceFeaturesResponse] + def set_organization_features: (Models::FeatureServiceSetOrganizationFeaturesRequest feature_service_set_organization_features_request) -> Models::FeatureServiceSetOrganizationFeaturesResponse + def set_organization_features_with_http_info: (Models::FeatureServiceSetOrganizationFeaturesRequest feature_service_set_organization_features_request) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceSetOrganizationFeaturesResponse] + def set_system_features: (Models::FeatureServiceSetSystemFeaturesRequest feature_service_set_system_features_request) -> Models::FeatureServiceSetSystemFeaturesResponse + def set_system_features_with_http_info: (Models::FeatureServiceSetSystemFeaturesRequest feature_service_set_system_features_request) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceSetSystemFeaturesResponse] + def set_user_features: (Models::FeatureServiceSetUserFeatureRequest feature_service_set_user_feature_request) -> Models::FeatureServiceSetUserFeaturesResponse + def set_user_features_with_http_info: (Models::FeatureServiceSetUserFeatureRequest feature_service_set_user_feature_request) -> ::Zitadel::Client::ApiResult[Models::FeatureServiceSetUserFeaturesResponse] + end + end +end diff --git a/sig/zitadel/client/api/identity_provider_service_api.rbs b/sig/zitadel/client/api/identity_provider_service_api.rbs new file mode 100644 index 00000000..9f1a35e9 --- /dev/null +++ b/sig/zitadel/client/api/identity_provider_service_api.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client + module Api + class IdentityProviderServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def get_idpby_id: (Models::IdentityProviderServiceGetIDPByIDRequest identity_provider_service_get_idpby_id_request) -> Models::IdentityProviderServiceGetIDPByIDResponse + def get_idpby_id_with_http_info: (Models::IdentityProviderServiceGetIDPByIDRequest identity_provider_service_get_idpby_id_request) -> ::Zitadel::Client::ApiResult[Models::IdentityProviderServiceGetIDPByIDResponse] + end + end +end diff --git a/sig/zitadel/client/api/instance_service_api.rbs b/sig/zitadel/client/api/instance_service_api.rbs new file mode 100644 index 00000000..f307e463 --- /dev/null +++ b/sig/zitadel/client/api/instance_service_api.rbs @@ -0,0 +1,27 @@ +module Zitadel::Client + module Api + class InstanceServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def add_custom_domain: (Models::InstanceServiceAddCustomDomainRequest instance_service_add_custom_domain_request) -> Models::InstanceServiceAddCustomDomainResponse + def add_custom_domain_with_http_info: (Models::InstanceServiceAddCustomDomainRequest instance_service_add_custom_domain_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceAddCustomDomainResponse] + def add_trusted_domain: (Models::InstanceServiceAddTrustedDomainRequest instance_service_add_trusted_domain_request) -> Models::InstanceServiceAddTrustedDomainResponse + def add_trusted_domain_with_http_info: (Models::InstanceServiceAddTrustedDomainRequest instance_service_add_trusted_domain_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceAddTrustedDomainResponse] + def delete_instance: (Models::InstanceServiceDeleteInstanceRequest instance_service_delete_instance_request) -> Models::InstanceServiceDeleteInstanceResponse + def delete_instance_with_http_info: (Models::InstanceServiceDeleteInstanceRequest instance_service_delete_instance_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceDeleteInstanceResponse] + def get_instance: (Models::InstanceServiceGetInstanceRequest instance_service_get_instance_request) -> Models::InstanceServiceGetInstanceResponse + def get_instance_with_http_info: (Models::InstanceServiceGetInstanceRequest instance_service_get_instance_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceGetInstanceResponse] + def list_custom_domains: (Models::InstanceServiceListCustomDomainsRequest instance_service_list_custom_domains_request) -> Models::InstanceServiceListCustomDomainsResponse + def list_custom_domains_with_http_info: (Models::InstanceServiceListCustomDomainsRequest instance_service_list_custom_domains_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceListCustomDomainsResponse] + def list_instances: (Models::InstanceServiceListInstancesRequest instance_service_list_instances_request) -> Models::InstanceServiceListInstancesResponse + def list_instances_with_http_info: (Models::InstanceServiceListInstancesRequest instance_service_list_instances_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceListInstancesResponse] + def list_trusted_domains: (Models::InstanceServiceListTrustedDomainsRequest instance_service_list_trusted_domains_request) -> Models::InstanceServiceListTrustedDomainsResponse + def list_trusted_domains_with_http_info: (Models::InstanceServiceListTrustedDomainsRequest instance_service_list_trusted_domains_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceListTrustedDomainsResponse] + def remove_custom_domain: (Models::InstanceServiceRemoveCustomDomainRequest instance_service_remove_custom_domain_request) -> Models::InstanceServiceRemoveCustomDomainResponse + def remove_custom_domain_with_http_info: (Models::InstanceServiceRemoveCustomDomainRequest instance_service_remove_custom_domain_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceRemoveCustomDomainResponse] + def remove_trusted_domain: (Models::InstanceServiceRemoveTrustedDomainRequest instance_service_remove_trusted_domain_request) -> Models::InstanceServiceRemoveTrustedDomainResponse + def remove_trusted_domain_with_http_info: (Models::InstanceServiceRemoveTrustedDomainRequest instance_service_remove_trusted_domain_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceRemoveTrustedDomainResponse] + def update_instance: (Models::InstanceServiceUpdateInstanceRequest instance_service_update_instance_request) -> Models::InstanceServiceUpdateInstanceResponse + def update_instance_with_http_info: (Models::InstanceServiceUpdateInstanceRequest instance_service_update_instance_request) -> ::Zitadel::Client::ApiResult[Models::InstanceServiceUpdateInstanceResponse] + end + end +end diff --git a/sig/zitadel/client/api/internal_permission_service_api.rbs b/sig/zitadel/client/api/internal_permission_service_api.rbs new file mode 100644 index 00000000..c941944f --- /dev/null +++ b/sig/zitadel/client/api/internal_permission_service_api.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client + module Api + class InternalPermissionServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def create_administrator: (Models::InternalPermissionServiceCreateAdministratorRequest internal_permission_service_create_administrator_request) -> Models::InternalPermissionServiceCreateAdministratorResponse + def create_administrator_with_http_info: (Models::InternalPermissionServiceCreateAdministratorRequest internal_permission_service_create_administrator_request) -> ::Zitadel::Client::ApiResult[Models::InternalPermissionServiceCreateAdministratorResponse] + def delete_administrator: (Models::InternalPermissionServiceDeleteAdministratorRequest internal_permission_service_delete_administrator_request) -> Models::InternalPermissionServiceDeleteAdministratorResponse + def delete_administrator_with_http_info: (Models::InternalPermissionServiceDeleteAdministratorRequest internal_permission_service_delete_administrator_request) -> ::Zitadel::Client::ApiResult[Models::InternalPermissionServiceDeleteAdministratorResponse] + def list_administrators: (Models::InternalPermissionServiceListAdministratorsRequest internal_permission_service_list_administrators_request) -> Models::InternalPermissionServiceListAdministratorsResponse + def list_administrators_with_http_info: (Models::InternalPermissionServiceListAdministratorsRequest internal_permission_service_list_administrators_request) -> ::Zitadel::Client::ApiResult[Models::InternalPermissionServiceListAdministratorsResponse] + def update_administrator: (Models::InternalPermissionServiceUpdateAdministratorRequest internal_permission_service_update_administrator_request) -> Models::InternalPermissionServiceUpdateAdministratorResponse + def update_administrator_with_http_info: (Models::InternalPermissionServiceUpdateAdministratorRequest internal_permission_service_update_administrator_request) -> ::Zitadel::Client::ApiResult[Models::InternalPermissionServiceUpdateAdministratorResponse] + end + end +end diff --git a/sig/zitadel/client/api/oidc_service_api.rbs b/sig/zitadel/client/api/oidc_service_api.rbs new file mode 100644 index 00000000..3f632978 --- /dev/null +++ b/sig/zitadel/client/api/oidc_service_api.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client + module Api + class OIDCServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def authorize_or_deny_device_authorization: (Models::OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest oidc_service_authorize_or_deny_device_authorization_request) -> untyped + def authorize_or_deny_device_authorization_with_http_info: (Models::OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest oidc_service_authorize_or_deny_device_authorization_request) -> ::Zitadel::Client::ApiResult[untyped] + def create_callback: (Models::OIDCServiceCreateCallbackRequest oidc_service_create_callback_request) -> Models::OIDCServiceCreateCallbackResponse + def create_callback_with_http_info: (Models::OIDCServiceCreateCallbackRequest oidc_service_create_callback_request) -> ::Zitadel::Client::ApiResult[Models::OIDCServiceCreateCallbackResponse] + def get_auth_request: (Models::OIDCServiceGetAuthRequestRequest oidc_service_get_auth_request_request) -> Models::OIDCServiceGetAuthRequestResponse + def get_auth_request_with_http_info: (Models::OIDCServiceGetAuthRequestRequest oidc_service_get_auth_request_request) -> ::Zitadel::Client::ApiResult[Models::OIDCServiceGetAuthRequestResponse] + def get_device_authorization_request: (Models::OIDCServiceGetDeviceAuthorizationRequestRequest oidc_service_get_device_authorization_request_request) -> Models::OIDCServiceGetDeviceAuthorizationRequestResponse + def get_device_authorization_request_with_http_info: (Models::OIDCServiceGetDeviceAuthorizationRequestRequest oidc_service_get_device_authorization_request_request) -> ::Zitadel::Client::ApiResult[Models::OIDCServiceGetDeviceAuthorizationRequestResponse] + end + end +end diff --git a/sig/zitadel/client/api/organization_service_api.rbs b/sig/zitadel/client/api/organization_service_api.rbs new file mode 100644 index 00000000..a1c4715a --- /dev/null +++ b/sig/zitadel/client/api/organization_service_api.rbs @@ -0,0 +1,35 @@ +module Zitadel::Client + module Api + class OrganizationServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def activate_organization: (Models::OrganizationServiceActivateOrganizationRequest organization_service_activate_organization_request) -> Models::OrganizationServiceActivateOrganizationResponse + def activate_organization_with_http_info: (Models::OrganizationServiceActivateOrganizationRequest organization_service_activate_organization_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceActivateOrganizationResponse] + def add_organization: (Models::OrganizationServiceAddOrganizationRequest organization_service_add_organization_request) -> Models::OrganizationServiceAddOrganizationResponse + def add_organization_with_http_info: (Models::OrganizationServiceAddOrganizationRequest organization_service_add_organization_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceAddOrganizationResponse] + def add_organization_domain: (Models::OrganizationServiceAddOrganizationDomainRequest organization_service_add_organization_domain_request) -> Models::OrganizationServiceAddOrganizationDomainResponse + def add_organization_domain_with_http_info: (Models::OrganizationServiceAddOrganizationDomainRequest organization_service_add_organization_domain_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceAddOrganizationDomainResponse] + def deactivate_organization: (Models::OrganizationServiceDeactivateOrganizationRequest organization_service_deactivate_organization_request) -> Models::OrganizationServiceDeactivateOrganizationResponse + def deactivate_organization_with_http_info: (Models::OrganizationServiceDeactivateOrganizationRequest organization_service_deactivate_organization_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceDeactivateOrganizationResponse] + def delete_organization: (Models::OrganizationServiceDeleteOrganizationRequest organization_service_delete_organization_request) -> Models::OrganizationServiceDeleteOrganizationResponse + def delete_organization_with_http_info: (Models::OrganizationServiceDeleteOrganizationRequest organization_service_delete_organization_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceDeleteOrganizationResponse] + def delete_organization_domain: (Models::OrganizationServiceDeleteOrganizationDomainRequest organization_service_delete_organization_domain_request) -> Models::OrganizationServiceDeleteOrganizationDomainResponse + def delete_organization_domain_with_http_info: (Models::OrganizationServiceDeleteOrganizationDomainRequest organization_service_delete_organization_domain_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceDeleteOrganizationDomainResponse] + def delete_organization_metadata: (Models::OrganizationServiceDeleteOrganizationMetadataRequest organization_service_delete_organization_metadata_request) -> Models::OrganizationServiceDeleteOrganizationMetadataResponse + def delete_organization_metadata_with_http_info: (Models::OrganizationServiceDeleteOrganizationMetadataRequest organization_service_delete_organization_metadata_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceDeleteOrganizationMetadataResponse] + def generate_organization_domain_validation: (Models::OrganizationServiceGenerateOrganizationDomainValidationRequest organization_service_generate_organization_domain_validation_request) -> Models::OrganizationServiceGenerateOrganizationDomainValidationResponse + def generate_organization_domain_validation_with_http_info: (Models::OrganizationServiceGenerateOrganizationDomainValidationRequest organization_service_generate_organization_domain_validation_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceGenerateOrganizationDomainValidationResponse] + def list_organization_domains: (Models::OrganizationServiceListOrganizationDomainsRequest organization_service_list_organization_domains_request) -> Models::OrganizationServiceListOrganizationDomainsResponse + def list_organization_domains_with_http_info: (Models::OrganizationServiceListOrganizationDomainsRequest organization_service_list_organization_domains_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceListOrganizationDomainsResponse] + def list_organization_metadata: (Models::OrganizationServiceListOrganizationMetadataRequest organization_service_list_organization_metadata_request) -> Models::OrganizationServiceListOrganizationMetadataResponse + def list_organization_metadata_with_http_info: (Models::OrganizationServiceListOrganizationMetadataRequest organization_service_list_organization_metadata_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceListOrganizationMetadataResponse] + def list_organizations: (Models::OrganizationServiceListOrganizationsRequest organization_service_list_organizations_request) -> Models::OrganizationServiceListOrganizationsResponse + def list_organizations_with_http_info: (Models::OrganizationServiceListOrganizationsRequest organization_service_list_organizations_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceListOrganizationsResponse] + def set_organization_metadata: (Models::OrganizationServiceSetOrganizationMetadataRequest organization_service_set_organization_metadata_request) -> Models::OrganizationServiceSetOrganizationMetadataResponse + def set_organization_metadata_with_http_info: (Models::OrganizationServiceSetOrganizationMetadataRequest organization_service_set_organization_metadata_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceSetOrganizationMetadataResponse] + def update_organization: (Models::OrganizationServiceUpdateOrganizationRequest organization_service_update_organization_request) -> Models::OrganizationServiceUpdateOrganizationResponse + def update_organization_with_http_info: (Models::OrganizationServiceUpdateOrganizationRequest organization_service_update_organization_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceUpdateOrganizationResponse] + def verify_organization_domain: (Models::OrganizationServiceVerifyOrganizationDomainRequest organization_service_verify_organization_domain_request) -> Models::OrganizationServiceVerifyOrganizationDomainResponse + def verify_organization_domain_with_http_info: (Models::OrganizationServiceVerifyOrganizationDomainRequest organization_service_verify_organization_domain_request) -> ::Zitadel::Client::ApiResult[Models::OrganizationServiceVerifyOrganizationDomainResponse] + end + end +end diff --git a/sig/zitadel/client/api/project_service_api.rbs b/sig/zitadel/client/api/project_service_api.rbs new file mode 100644 index 00000000..2502cb05 --- /dev/null +++ b/sig/zitadel/client/api/project_service_api.rbs @@ -0,0 +1,41 @@ +module Zitadel::Client + module Api + class ProjectServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def activate_project: (Models::ProjectServiceActivateProjectRequest project_service_activate_project_request) -> Models::ProjectServiceActivateProjectResponse + def activate_project_with_http_info: (Models::ProjectServiceActivateProjectRequest project_service_activate_project_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceActivateProjectResponse] + def activate_project_grant: (Models::ProjectServiceActivateProjectGrantRequest project_service_activate_project_grant_request) -> Models::ProjectServiceActivateProjectGrantResponse + def activate_project_grant_with_http_info: (Models::ProjectServiceActivateProjectGrantRequest project_service_activate_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceActivateProjectGrantResponse] + def add_project_role: (Models::ProjectServiceAddProjectRoleRequest project_service_add_project_role_request) -> Models::ProjectServiceAddProjectRoleResponse + def add_project_role_with_http_info: (Models::ProjectServiceAddProjectRoleRequest project_service_add_project_role_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceAddProjectRoleResponse] + def create_project: (Models::ProjectServiceCreateProjectRequest project_service_create_project_request) -> Models::ProjectServiceCreateProjectResponse + def create_project_with_http_info: (Models::ProjectServiceCreateProjectRequest project_service_create_project_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceCreateProjectResponse] + def create_project_grant: (Models::ProjectServiceCreateProjectGrantRequest project_service_create_project_grant_request) -> Models::ProjectServiceCreateProjectGrantResponse + def create_project_grant_with_http_info: (Models::ProjectServiceCreateProjectGrantRequest project_service_create_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceCreateProjectGrantResponse] + def deactivate_project: (Models::ProjectServiceDeactivateProjectRequest project_service_deactivate_project_request) -> Models::ProjectServiceDeactivateProjectResponse + def deactivate_project_with_http_info: (Models::ProjectServiceDeactivateProjectRequest project_service_deactivate_project_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceDeactivateProjectResponse] + def deactivate_project_grant: (Models::ProjectServiceDeactivateProjectGrantRequest project_service_deactivate_project_grant_request) -> Models::ProjectServiceDeactivateProjectGrantResponse + def deactivate_project_grant_with_http_info: (Models::ProjectServiceDeactivateProjectGrantRequest project_service_deactivate_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceDeactivateProjectGrantResponse] + def delete_project: (Models::ProjectServiceDeleteProjectRequest project_service_delete_project_request) -> Models::ProjectServiceDeleteProjectResponse + def delete_project_with_http_info: (Models::ProjectServiceDeleteProjectRequest project_service_delete_project_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceDeleteProjectResponse] + def delete_project_grant: (Models::ProjectServiceDeleteProjectGrantRequest project_service_delete_project_grant_request) -> Models::ProjectServiceDeleteProjectGrantResponse + def delete_project_grant_with_http_info: (Models::ProjectServiceDeleteProjectGrantRequest project_service_delete_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceDeleteProjectGrantResponse] + def get_project: (Models::ProjectServiceGetProjectRequest project_service_get_project_request) -> Models::ProjectServiceGetProjectResponse + def get_project_with_http_info: (Models::ProjectServiceGetProjectRequest project_service_get_project_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceGetProjectResponse] + def list_project_grants: (Models::ProjectServiceListProjectGrantsRequest project_service_list_project_grants_request) -> Models::ProjectServiceListProjectGrantsResponse + def list_project_grants_with_http_info: (Models::ProjectServiceListProjectGrantsRequest project_service_list_project_grants_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceListProjectGrantsResponse] + def list_project_roles: (Models::ProjectServiceListProjectRolesRequest project_service_list_project_roles_request) -> Models::ProjectServiceListProjectRolesResponse + def list_project_roles_with_http_info: (Models::ProjectServiceListProjectRolesRequest project_service_list_project_roles_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceListProjectRolesResponse] + def list_projects: (Models::ProjectServiceListProjectsRequest project_service_list_projects_request) -> Models::ProjectServiceListProjectsResponse + def list_projects_with_http_info: (Models::ProjectServiceListProjectsRequest project_service_list_projects_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceListProjectsResponse] + def remove_project_role: (Models::ProjectServiceRemoveProjectRoleRequest project_service_remove_project_role_request) -> Models::ProjectServiceRemoveProjectRoleResponse + def remove_project_role_with_http_info: (Models::ProjectServiceRemoveProjectRoleRequest project_service_remove_project_role_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceRemoveProjectRoleResponse] + def update_project: (Models::ProjectServiceUpdateProjectRequest project_service_update_project_request) -> Models::ProjectServiceUpdateProjectResponse + def update_project_with_http_info: (Models::ProjectServiceUpdateProjectRequest project_service_update_project_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceUpdateProjectResponse] + def update_project_grant: (Models::ProjectServiceUpdateProjectGrantRequest project_service_update_project_grant_request) -> Models::ProjectServiceUpdateProjectGrantResponse + def update_project_grant_with_http_info: (Models::ProjectServiceUpdateProjectGrantRequest project_service_update_project_grant_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceUpdateProjectGrantResponse] + def update_project_role: (Models::ProjectServiceUpdateProjectRoleRequest project_service_update_project_role_request) -> Models::ProjectServiceUpdateProjectRoleResponse + def update_project_role_with_http_info: (Models::ProjectServiceUpdateProjectRoleRequest project_service_update_project_role_request) -> ::Zitadel::Client::ApiResult[Models::ProjectServiceUpdateProjectRoleResponse] + end + end +end diff --git a/sig/zitadel/client/api/saml_service_api.rbs b/sig/zitadel/client/api/saml_service_api.rbs new file mode 100644 index 00000000..bf8a5c4d --- /dev/null +++ b/sig/zitadel/client/api/saml_service_api.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client + module Api + class SAMLServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def create_response: (Models::SAMLServiceCreateResponseRequest saml_service_create_response_request) -> Models::SAMLServiceCreateResponseResponse + def create_response_with_http_info: (Models::SAMLServiceCreateResponseRequest saml_service_create_response_request) -> ::Zitadel::Client::ApiResult[Models::SAMLServiceCreateResponseResponse] + def get_saml_request: (Models::SAMLServiceGetSAMLRequestRequest saml_service_get_saml_request_request) -> Models::SAMLServiceGetSAMLRequestResponse + def get_saml_request_with_http_info: (Models::SAMLServiceGetSAMLRequestRequest saml_service_get_saml_request_request) -> ::Zitadel::Client::ApiResult[Models::SAMLServiceGetSAMLRequestResponse] + end + end +end diff --git a/sig/zitadel/client/api/session_service_api.rbs b/sig/zitadel/client/api/session_service_api.rbs new file mode 100644 index 00000000..9fdcc28f --- /dev/null +++ b/sig/zitadel/client/api/session_service_api.rbs @@ -0,0 +1,17 @@ +module Zitadel::Client + module Api + class SessionServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def create_session: (Models::SessionServiceCreateSessionRequest session_service_create_session_request) -> Models::SessionServiceCreateSessionResponse + def create_session_with_http_info: (Models::SessionServiceCreateSessionRequest session_service_create_session_request) -> ::Zitadel::Client::ApiResult[Models::SessionServiceCreateSessionResponse] + def delete_session: (Models::SessionServiceDeleteSessionRequest session_service_delete_session_request) -> Models::SessionServiceDeleteSessionResponse + def delete_session_with_http_info: (Models::SessionServiceDeleteSessionRequest session_service_delete_session_request) -> ::Zitadel::Client::ApiResult[Models::SessionServiceDeleteSessionResponse] + def get_session: (Models::SessionServiceGetSessionRequest session_service_get_session_request) -> Models::SessionServiceGetSessionResponse + def get_session_with_http_info: (Models::SessionServiceGetSessionRequest session_service_get_session_request) -> ::Zitadel::Client::ApiResult[Models::SessionServiceGetSessionResponse] + def list_sessions: (Models::SessionServiceListSessionsRequest session_service_list_sessions_request) -> Models::SessionServiceListSessionsResponse + def list_sessions_with_http_info: (Models::SessionServiceListSessionsRequest session_service_list_sessions_request) -> ::Zitadel::Client::ApiResult[Models::SessionServiceListSessionsResponse] + def set_session: (Models::SessionServiceSetSessionRequest session_service_set_session_request) -> Models::SessionServiceSetSessionResponse + def set_session_with_http_info: (Models::SessionServiceSetSessionRequest session_service_set_session_request) -> ::Zitadel::Client::ApiResult[Models::SessionServiceSetSessionResponse] + end + end +end diff --git a/sig/zitadel/client/api/settings_service_api.rbs b/sig/zitadel/client/api/settings_service_api.rbs new file mode 100644 index 00000000..00269e01 --- /dev/null +++ b/sig/zitadel/client/api/settings_service_api.rbs @@ -0,0 +1,33 @@ +module Zitadel::Client + module Api + class SettingsServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def get_active_identity_providers: (Models::SettingsServiceGetActiveIdentityProvidersRequest settings_service_get_active_identity_providers_request) -> Models::SettingsServiceGetActiveIdentityProvidersResponse + def get_active_identity_providers_with_http_info: (Models::SettingsServiceGetActiveIdentityProvidersRequest settings_service_get_active_identity_providers_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetActiveIdentityProvidersResponse] + def get_branding_settings: (Models::SettingsServiceGetBrandingSettingsRequest settings_service_get_branding_settings_request) -> Models::SettingsServiceGetBrandingSettingsResponse + def get_branding_settings_with_http_info: (Models::SettingsServiceGetBrandingSettingsRequest settings_service_get_branding_settings_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetBrandingSettingsResponse] + def get_domain_settings: (Models::SettingsServiceGetDomainSettingsRequest settings_service_get_domain_settings_request) -> Models::SettingsServiceGetDomainSettingsResponse + def get_domain_settings_with_http_info: (Models::SettingsServiceGetDomainSettingsRequest settings_service_get_domain_settings_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetDomainSettingsResponse] + def get_general_settings: (untyped body) -> Models::SettingsServiceGetGeneralSettingsResponse + def get_general_settings_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetGeneralSettingsResponse] + def get_hosted_login_translation: (Models::SettingsServiceGetHostedLoginTranslationRequest settings_service_get_hosted_login_translation_request) -> Models::SettingsServiceGetHostedLoginTranslationResponse + def get_hosted_login_translation_with_http_info: (Models::SettingsServiceGetHostedLoginTranslationRequest settings_service_get_hosted_login_translation_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetHostedLoginTranslationResponse] + def get_legal_and_support_settings: (Models::SettingsServiceGetLegalAndSupportSettingsRequest settings_service_get_legal_and_support_settings_request) -> Models::SettingsServiceGetLegalAndSupportSettingsResponse + def get_legal_and_support_settings_with_http_info: (Models::SettingsServiceGetLegalAndSupportSettingsRequest settings_service_get_legal_and_support_settings_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetLegalAndSupportSettingsResponse] + def get_lockout_settings: (Models::SettingsServiceGetLockoutSettingsRequest settings_service_get_lockout_settings_request) -> Models::SettingsServiceGetLockoutSettingsResponse + def get_lockout_settings_with_http_info: (Models::SettingsServiceGetLockoutSettingsRequest settings_service_get_lockout_settings_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetLockoutSettingsResponse] + def get_login_settings: (Models::SettingsServiceGetLoginSettingsRequest settings_service_get_login_settings_request) -> Models::SettingsServiceGetLoginSettingsResponse + def get_login_settings_with_http_info: (Models::SettingsServiceGetLoginSettingsRequest settings_service_get_login_settings_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetLoginSettingsResponse] + def get_password_complexity_settings: (Models::SettingsServiceGetPasswordComplexitySettingsRequest settings_service_get_password_complexity_settings_request) -> Models::SettingsServiceGetPasswordComplexitySettingsResponse + def get_password_complexity_settings_with_http_info: (Models::SettingsServiceGetPasswordComplexitySettingsRequest settings_service_get_password_complexity_settings_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetPasswordComplexitySettingsResponse] + def get_password_expiry_settings: (Models::SettingsServiceGetPasswordExpirySettingsRequest settings_service_get_password_expiry_settings_request) -> Models::SettingsServiceGetPasswordExpirySettingsResponse + def get_password_expiry_settings_with_http_info: (Models::SettingsServiceGetPasswordExpirySettingsRequest settings_service_get_password_expiry_settings_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetPasswordExpirySettingsResponse] + def get_security_settings: (untyped body) -> Models::SettingsServiceGetSecuritySettingsResponse + def get_security_settings_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceGetSecuritySettingsResponse] + def set_hosted_login_translation: (Models::SettingsServiceSetHostedLoginTranslationRequest settings_service_set_hosted_login_translation_request) -> Models::SettingsServiceSetHostedLoginTranslationResponse + def set_hosted_login_translation_with_http_info: (Models::SettingsServiceSetHostedLoginTranslationRequest settings_service_set_hosted_login_translation_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceSetHostedLoginTranslationResponse] + def set_security_settings: (Models::SettingsServiceSetSecuritySettingsRequest settings_service_set_security_settings_request) -> Models::SettingsServiceSetSecuritySettingsResponse + def set_security_settings_with_http_info: (Models::SettingsServiceSetSecuritySettingsRequest settings_service_set_security_settings_request) -> ::Zitadel::Client::ApiResult[Models::SettingsServiceSetSecuritySettingsResponse] + end + end +end diff --git a/sig/zitadel/client/api/user_service_api.rbs b/sig/zitadel/client/api/user_service_api.rbs new file mode 100644 index 00000000..4e83aa93 --- /dev/null +++ b/sig/zitadel/client/api/user_service_api.rbs @@ -0,0 +1,127 @@ +module Zitadel::Client + module Api + class UserServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def add_human_user: (Models::UserServiceAddHumanUserRequest user_service_add_human_user_request) -> Models::UserServiceAddHumanUserResponse + def add_human_user_with_http_info: (Models::UserServiceAddHumanUserRequest user_service_add_human_user_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceAddHumanUserResponse] + def add_idp_link: (Models::UserServiceAddIDPLinkRequest user_service_add_idp_link_request) -> Models::UserServiceAddIDPLinkResponse + def add_idp_link_with_http_info: (Models::UserServiceAddIDPLinkRequest user_service_add_idp_link_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceAddIDPLinkResponse] + def add_key: (Models::UserServiceAddKeyRequest user_service_add_key_request) -> Models::UserServiceAddKeyResponse + def add_key_with_http_info: (Models::UserServiceAddKeyRequest user_service_add_key_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceAddKeyResponse] + def add_otp_email: (Models::UserServiceAddOTPEmailRequest user_service_add_otp_email_request) -> Models::UserServiceAddOTPEmailResponse + def add_otp_email_with_http_info: (Models::UserServiceAddOTPEmailRequest user_service_add_otp_email_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceAddOTPEmailResponse] + def add_otpsms: (Models::UserServiceAddOTPSMSRequest user_service_add_otpsms_request) -> Models::UserServiceAddOTPSMSResponse + def add_otpsms_with_http_info: (Models::UserServiceAddOTPSMSRequest user_service_add_otpsms_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceAddOTPSMSResponse] + def add_personal_access_token: (Models::UserServiceAddPersonalAccessTokenRequest user_service_add_personal_access_token_request) -> Models::UserServiceAddPersonalAccessTokenResponse + def add_personal_access_token_with_http_info: (Models::UserServiceAddPersonalAccessTokenRequest user_service_add_personal_access_token_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceAddPersonalAccessTokenResponse] + def add_secret: (Models::UserServiceAddSecretRequest user_service_add_secret_request) -> Models::UserServiceAddSecretResponse + def add_secret_with_http_info: (Models::UserServiceAddSecretRequest user_service_add_secret_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceAddSecretResponse] + def create_invite_code: (Models::UserServiceCreateInviteCodeRequest user_service_create_invite_code_request) -> Models::UserServiceCreateInviteCodeResponse + def create_invite_code_with_http_info: (Models::UserServiceCreateInviteCodeRequest user_service_create_invite_code_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceCreateInviteCodeResponse] + def create_passkey_registration_link: (Models::UserServiceCreatePasskeyRegistrationLinkRequest user_service_create_passkey_registration_link_request) -> Models::UserServiceCreatePasskeyRegistrationLinkResponse + def create_passkey_registration_link_with_http_info: (Models::UserServiceCreatePasskeyRegistrationLinkRequest user_service_create_passkey_registration_link_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceCreatePasskeyRegistrationLinkResponse] + def create_user: (Models::UserServiceCreateUserRequest user_service_create_user_request) -> Models::UserServiceCreateUserResponse + def create_user_with_http_info: (Models::UserServiceCreateUserRequest user_service_create_user_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceCreateUserResponse] + def deactivate_user: (Models::UserServiceDeactivateUserRequest user_service_deactivate_user_request) -> Models::UserServiceDeactivateUserResponse + def deactivate_user_with_http_info: (Models::UserServiceDeactivateUserRequest user_service_deactivate_user_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceDeactivateUserResponse] + def delete_user: (Models::UserServiceDeleteUserRequest user_service_delete_user_request) -> Models::UserServiceDeleteUserResponse + def delete_user_with_http_info: (Models::UserServiceDeleteUserRequest user_service_delete_user_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceDeleteUserResponse] + def delete_user_metadata: (Models::UserServiceDeleteUserMetadataRequest user_service_delete_user_metadata_request) -> Models::UserServiceDeleteUserMetadataResponse + def delete_user_metadata_with_http_info: (Models::UserServiceDeleteUserMetadataRequest user_service_delete_user_metadata_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceDeleteUserMetadataResponse] + def generate_recovery_codes: (Models::UserServiceGenerateRecoveryCodesRequest user_service_generate_recovery_codes_request) -> Models::UserServiceGenerateRecoveryCodesResponse + def generate_recovery_codes_with_http_info: (Models::UserServiceGenerateRecoveryCodesRequest user_service_generate_recovery_codes_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceGenerateRecoveryCodesResponse] + def get_user_by_id: (Models::UserServiceGetUserByIDRequest user_service_get_user_by_id_request) -> Models::UserServiceGetUserByIDResponse + def get_user_by_id_with_http_info: (Models::UserServiceGetUserByIDRequest user_service_get_user_by_id_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceGetUserByIDResponse] + def human_mfa_init_skipped: (Models::UserServiceHumanMFAInitSkippedRequest user_service_human_mfa_init_skipped_request) -> Models::UserServiceHumanMFAInitSkippedResponse + def human_mfa_init_skipped_with_http_info: (Models::UserServiceHumanMFAInitSkippedRequest user_service_human_mfa_init_skipped_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceHumanMFAInitSkippedResponse] + def list_authentication_factors: (Models::UserServiceListAuthenticationFactorsRequest user_service_list_authentication_factors_request) -> Models::UserServiceListAuthenticationFactorsResponse + def list_authentication_factors_with_http_info: (Models::UserServiceListAuthenticationFactorsRequest user_service_list_authentication_factors_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceListAuthenticationFactorsResponse] + def list_authentication_method_types: (Models::UserServiceListAuthenticationMethodTypesRequest user_service_list_authentication_method_types_request) -> Models::UserServiceListAuthenticationMethodTypesResponse + def list_authentication_method_types_with_http_info: (Models::UserServiceListAuthenticationMethodTypesRequest user_service_list_authentication_method_types_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceListAuthenticationMethodTypesResponse] + def list_idp_links: (Models::UserServiceListIDPLinksRequest user_service_list_idp_links_request) -> Models::UserServiceListIDPLinksResponse + def list_idp_links_with_http_info: (Models::UserServiceListIDPLinksRequest user_service_list_idp_links_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceListIDPLinksResponse] + def list_keys: (Models::UserServiceListKeysRequest user_service_list_keys_request) -> Models::UserServiceListKeysResponse + def list_keys_with_http_info: (Models::UserServiceListKeysRequest user_service_list_keys_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceListKeysResponse] + def list_passkeys: (Models::UserServiceListPasskeysRequest user_service_list_passkeys_request) -> Models::UserServiceListPasskeysResponse + def list_passkeys_with_http_info: (Models::UserServiceListPasskeysRequest user_service_list_passkeys_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceListPasskeysResponse] + def list_personal_access_tokens: (Models::UserServiceListPersonalAccessTokensRequest user_service_list_personal_access_tokens_request) -> Models::UserServiceListPersonalAccessTokensResponse + def list_personal_access_tokens_with_http_info: (Models::UserServiceListPersonalAccessTokensRequest user_service_list_personal_access_tokens_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceListPersonalAccessTokensResponse] + def list_user_metadata: (Models::UserServiceListUserMetadataRequest user_service_list_user_metadata_request) -> Models::UserServiceListUserMetadataResponse + def list_user_metadata_with_http_info: (Models::UserServiceListUserMetadataRequest user_service_list_user_metadata_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceListUserMetadataResponse] + def list_users: (Models::UserServiceListUsersRequest user_service_list_users_request) -> Models::UserServiceListUsersResponse + def list_users_with_http_info: (Models::UserServiceListUsersRequest user_service_list_users_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceListUsersResponse] + def lock_user: (Models::UserServiceLockUserRequest user_service_lock_user_request) -> Models::UserServiceLockUserResponse + def lock_user_with_http_info: (Models::UserServiceLockUserRequest user_service_lock_user_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceLockUserResponse] + def password_reset: (Models::UserServicePasswordResetRequest user_service_password_reset_request) -> Models::UserServicePasswordResetResponse + def password_reset_with_http_info: (Models::UserServicePasswordResetRequest user_service_password_reset_request) -> ::Zitadel::Client::ApiResult[Models::UserServicePasswordResetResponse] + def reactivate_user: (Models::UserServiceReactivateUserRequest user_service_reactivate_user_request) -> Models::UserServiceReactivateUserResponse + def reactivate_user_with_http_info: (Models::UserServiceReactivateUserRequest user_service_reactivate_user_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceReactivateUserResponse] + def register_passkey: (Models::UserServiceRegisterPasskeyRequest user_service_register_passkey_request) -> Models::UserServiceRegisterPasskeyResponse + def register_passkey_with_http_info: (Models::UserServiceRegisterPasskeyRequest user_service_register_passkey_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRegisterPasskeyResponse] + def register_totp: (Models::UserServiceRegisterTOTPRequest user_service_register_totp_request) -> Models::UserServiceRegisterTOTPResponse + def register_totp_with_http_info: (Models::UserServiceRegisterTOTPRequest user_service_register_totp_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRegisterTOTPResponse] + def register_u2_f: (Models::UserServiceRegisterU2FRequest user_service_register_u2_f_request) -> Models::UserServiceRegisterU2FResponse + def register_u2_f_with_http_info: (Models::UserServiceRegisterU2FRequest user_service_register_u2_f_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRegisterU2FResponse] + def remove_idp_link: (Models::UserServiceRemoveIDPLinkRequest user_service_remove_idp_link_request) -> Models::UserServiceRemoveIDPLinkResponse + def remove_idp_link_with_http_info: (Models::UserServiceRemoveIDPLinkRequest user_service_remove_idp_link_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemoveIDPLinkResponse] + def remove_key: (Models::UserServiceRemoveKeyRequest user_service_remove_key_request) -> Models::UserServiceRemoveKeyResponse + def remove_key_with_http_info: (Models::UserServiceRemoveKeyRequest user_service_remove_key_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemoveKeyResponse] + def remove_otp_email: (Models::UserServiceRemoveOTPEmailRequest user_service_remove_otp_email_request) -> Models::UserServiceRemoveOTPEmailResponse + def remove_otp_email_with_http_info: (Models::UserServiceRemoveOTPEmailRequest user_service_remove_otp_email_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemoveOTPEmailResponse] + def remove_otpsms: (Models::UserServiceRemoveOTPSMSRequest user_service_remove_otpsms_request) -> Models::UserServiceRemoveOTPSMSResponse + def remove_otpsms_with_http_info: (Models::UserServiceRemoveOTPSMSRequest user_service_remove_otpsms_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemoveOTPSMSResponse] + def remove_passkey: (Models::UserServiceRemovePasskeyRequest user_service_remove_passkey_request) -> Models::UserServiceRemovePasskeyResponse + def remove_passkey_with_http_info: (Models::UserServiceRemovePasskeyRequest user_service_remove_passkey_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemovePasskeyResponse] + def remove_personal_access_token: (Models::UserServiceRemovePersonalAccessTokenRequest user_service_remove_personal_access_token_request) -> Models::UserServiceRemovePersonalAccessTokenResponse + def remove_personal_access_token_with_http_info: (Models::UserServiceRemovePersonalAccessTokenRequest user_service_remove_personal_access_token_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemovePersonalAccessTokenResponse] + def remove_phone: (Models::UserServiceRemovePhoneRequest user_service_remove_phone_request) -> Models::UserServiceRemovePhoneResponse + def remove_phone_with_http_info: (Models::UserServiceRemovePhoneRequest user_service_remove_phone_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemovePhoneResponse] + def remove_recovery_codes: (Models::UserServiceRemoveRecoveryCodesRequest user_service_remove_recovery_codes_request) -> Models::UserServiceRemoveRecoveryCodesResponse + def remove_recovery_codes_with_http_info: (Models::UserServiceRemoveRecoveryCodesRequest user_service_remove_recovery_codes_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemoveRecoveryCodesResponse] + def remove_secret: (Models::UserServiceRemoveSecretRequest user_service_remove_secret_request) -> Models::UserServiceRemoveSecretResponse + def remove_secret_with_http_info: (Models::UserServiceRemoveSecretRequest user_service_remove_secret_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemoveSecretResponse] + def remove_totp: (Models::UserServiceRemoveTOTPRequest user_service_remove_totp_request) -> Models::UserServiceRemoveTOTPResponse + def remove_totp_with_http_info: (Models::UserServiceRemoveTOTPRequest user_service_remove_totp_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemoveTOTPResponse] + def remove_u2_f: (Models::UserServiceRemoveU2FRequest user_service_remove_u2_f_request) -> Models::UserServiceRemoveU2FResponse + def remove_u2_f_with_http_info: (Models::UserServiceRemoveU2FRequest user_service_remove_u2_f_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRemoveU2FResponse] + def resend_email_code: (Models::UserServiceResendEmailCodeRequest user_service_resend_email_code_request) -> Models::UserServiceResendEmailCodeResponse + def resend_email_code_with_http_info: (Models::UserServiceResendEmailCodeRequest user_service_resend_email_code_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceResendEmailCodeResponse] + def resend_invite_code: (Models::UserServiceResendInviteCodeRequest user_service_resend_invite_code_request) -> Models::UserServiceResendInviteCodeResponse + def resend_invite_code_with_http_info: (Models::UserServiceResendInviteCodeRequest user_service_resend_invite_code_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceResendInviteCodeResponse] + def resend_phone_code: (Models::UserServiceResendPhoneCodeRequest user_service_resend_phone_code_request) -> Models::UserServiceResendPhoneCodeResponse + def resend_phone_code_with_http_info: (Models::UserServiceResendPhoneCodeRequest user_service_resend_phone_code_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceResendPhoneCodeResponse] + def retrieve_identity_provider_intent: (Models::UserServiceRetrieveIdentityProviderIntentRequest user_service_retrieve_identity_provider_intent_request) -> Models::UserServiceRetrieveIdentityProviderIntentResponse + def retrieve_identity_provider_intent_with_http_info: (Models::UserServiceRetrieveIdentityProviderIntentRequest user_service_retrieve_identity_provider_intent_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceRetrieveIdentityProviderIntentResponse] + def send_email_code: (Models::UserServiceSendEmailCodeRequest user_service_send_email_code_request) -> Models::UserServiceSendEmailCodeResponse + def send_email_code_with_http_info: (Models::UserServiceSendEmailCodeRequest user_service_send_email_code_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceSendEmailCodeResponse] + def set_email: (Models::UserServiceSetEmailRequest user_service_set_email_request) -> Models::UserServiceSetEmailResponse + def set_email_with_http_info: (Models::UserServiceSetEmailRequest user_service_set_email_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceSetEmailResponse] + def set_password: (Models::UserServiceSetPasswordRequest user_service_set_password_request) -> Models::UserServiceSetPasswordResponse + def set_password_with_http_info: (Models::UserServiceSetPasswordRequest user_service_set_password_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceSetPasswordResponse] + def set_phone: (Models::UserServiceSetPhoneRequest user_service_set_phone_request) -> Models::UserServiceSetPhoneResponse + def set_phone_with_http_info: (Models::UserServiceSetPhoneRequest user_service_set_phone_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceSetPhoneResponse] + def set_user_metadata: (Models::UserServiceSetUserMetadataRequest user_service_set_user_metadata_request) -> Models::UserServiceSetUserMetadataResponse + def set_user_metadata_with_http_info: (Models::UserServiceSetUserMetadataRequest user_service_set_user_metadata_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceSetUserMetadataResponse] + def start_identity_provider_intent: (Models::UserServiceStartIdentityProviderIntentRequest user_service_start_identity_provider_intent_request) -> Models::UserServiceStartIdentityProviderIntentResponse + def start_identity_provider_intent_with_http_info: (Models::UserServiceStartIdentityProviderIntentRequest user_service_start_identity_provider_intent_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceStartIdentityProviderIntentResponse] + def unlock_user: (Models::UserServiceUnlockUserRequest user_service_unlock_user_request) -> Models::UserServiceUnlockUserResponse + def unlock_user_with_http_info: (Models::UserServiceUnlockUserRequest user_service_unlock_user_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceUnlockUserResponse] + def update_human_user: (Models::UserServiceUpdateHumanUserRequest user_service_update_human_user_request) -> Models::UserServiceUpdateHumanUserResponse + def update_human_user_with_http_info: (Models::UserServiceUpdateHumanUserRequest user_service_update_human_user_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceUpdateHumanUserResponse] + def update_user: (Models::UserServiceUpdateUserRequest user_service_update_user_request) -> Models::UserServiceUpdateUserResponse + def update_user_with_http_info: (Models::UserServiceUpdateUserRequest user_service_update_user_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceUpdateUserResponse] + def verify_email: (Models::UserServiceVerifyEmailRequest user_service_verify_email_request) -> Models::UserServiceVerifyEmailResponse + def verify_email_with_http_info: (Models::UserServiceVerifyEmailRequest user_service_verify_email_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceVerifyEmailResponse] + def verify_invite_code: (Models::UserServiceVerifyInviteCodeRequest user_service_verify_invite_code_request) -> Models::UserServiceVerifyInviteCodeResponse + def verify_invite_code_with_http_info: (Models::UserServiceVerifyInviteCodeRequest user_service_verify_invite_code_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceVerifyInviteCodeResponse] + def verify_passkey_registration: (Models::UserServiceVerifyPasskeyRegistrationRequest user_service_verify_passkey_registration_request) -> Models::UserServiceVerifyPasskeyRegistrationResponse + def verify_passkey_registration_with_http_info: (Models::UserServiceVerifyPasskeyRegistrationRequest user_service_verify_passkey_registration_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceVerifyPasskeyRegistrationResponse] + def verify_phone: (Models::UserServiceVerifyPhoneRequest user_service_verify_phone_request) -> Models::UserServiceVerifyPhoneResponse + def verify_phone_with_http_info: (Models::UserServiceVerifyPhoneRequest user_service_verify_phone_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceVerifyPhoneResponse] + def verify_totp_registration: (Models::UserServiceVerifyTOTPRegistrationRequest user_service_verify_totp_registration_request) -> Models::UserServiceVerifyTOTPRegistrationResponse + def verify_totp_registration_with_http_info: (Models::UserServiceVerifyTOTPRegistrationRequest user_service_verify_totp_registration_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceVerifyTOTPRegistrationResponse] + def verify_u2_f_registration: (Models::UserServiceVerifyU2FRegistrationRequest user_service_verify_u2_f_registration_request) -> Models::UserServiceVerifyU2FRegistrationResponse + def verify_u2_f_registration_with_http_info: (Models::UserServiceVerifyU2FRegistrationRequest user_service_verify_u2_f_registration_request) -> ::Zitadel::Client::ApiResult[Models::UserServiceVerifyU2FRegistrationResponse] + end + end +end diff --git a/sig/zitadel/client/api/web_key_service_api.rbs b/sig/zitadel/client/api/web_key_service_api.rbs new file mode 100644 index 00000000..5c01fa50 --- /dev/null +++ b/sig/zitadel/client/api/web_key_service_api.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client + module Api + class WebKeyServiceApi < BaseApi + def initialize: (?::Zitadel::Client::ApiClient? api_client, ?::Zitadel::Client::Configuration config, ?::Zitadel::Client::Auth::Authenticator? authenticator) -> void + def activate_web_key: (Models::WebKeyServiceActivateWebKeyRequest web_key_service_activate_web_key_request) -> Models::WebKeyServiceActivateWebKeyResponse + def activate_web_key_with_http_info: (Models::WebKeyServiceActivateWebKeyRequest web_key_service_activate_web_key_request) -> ::Zitadel::Client::ApiResult[Models::WebKeyServiceActivateWebKeyResponse] + def create_web_key: (Models::WebKeyServiceCreateWebKeyRequest web_key_service_create_web_key_request) -> Models::WebKeyServiceCreateWebKeyResponse + def create_web_key_with_http_info: (Models::WebKeyServiceCreateWebKeyRequest web_key_service_create_web_key_request) -> ::Zitadel::Client::ApiResult[Models::WebKeyServiceCreateWebKeyResponse] + def delete_web_key: (Models::WebKeyServiceDeleteWebKeyRequest web_key_service_delete_web_key_request) -> Models::WebKeyServiceDeleteWebKeyResponse + def delete_web_key_with_http_info: (Models::WebKeyServiceDeleteWebKeyRequest web_key_service_delete_web_key_request) -> ::Zitadel::Client::ApiResult[Models::WebKeyServiceDeleteWebKeyResponse] + def list_web_keys: (untyped body) -> Models::WebKeyServiceListWebKeysResponse + def list_web_keys_with_http_info: (untyped body) -> ::Zitadel::Client::ApiResult[Models::WebKeyServiceListWebKeysResponse] + end + end +end diff --git a/sig/zitadel/client/auth/zitadel_access_token_authenticator.rbs b/sig/zitadel/client/auth/zitadel_access_token_authenticator.rbs new file mode 100644 index 00000000..bb8dcbc5 --- /dev/null +++ b/sig/zitadel/client/auth/zitadel_access_token_authenticator.rbs @@ -0,0 +1,7 @@ +module Zitadel::Client + module Auth + class ZitadelAccessTokenAuthenticator < BearerAuthenticator + def initialize: (host: String, token: String) -> void + end + end +end diff --git a/sig/zitadel/client/models/action_service_activate_public_key_request.rbs b/sig/zitadel/client/models/action_service_activate_public_key_request.rbs new file mode 100644 index 00000000..b25b065d --- /dev/null +++ b/sig/zitadel/client/models/action_service_activate_public_key_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceActivatePublicKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_id: String? + attr_reader key_id: String? + end +end diff --git a/sig/zitadel/client/models/action_service_activate_public_key_response.rbs b/sig/zitadel/client/models/action_service_activate_public_key_response.rbs new file mode 100644 index 00000000..7ce1974d --- /dev/null +++ b/sig/zitadel/client/models/action_service_activate_public_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceActivatePublicKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/action_service_add_public_key_request.rbs b/sig/zitadel/client/models/action_service_add_public_key_request.rbs new file mode 100644 index 00000000..4bf6a64a --- /dev/null +++ b/sig/zitadel/client/models/action_service_add_public_key_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServiceAddPublicKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_id: String? + attr_reader public_key: String? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/action_service_add_public_key_response.rbs b/sig/zitadel/client/models/action_service_add_public_key_response.rbs new file mode 100644 index 00000000..48a2edb6 --- /dev/null +++ b/sig/zitadel/client/models/action_service_add_public_key_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceAddPublicKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_id: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/action_service_any.rbs b/sig/zitadel/client/models/action_service_any.rbs new file mode 100644 index 00000000..df6251cb --- /dev/null +++ b/sig/zitadel/client/models/action_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ActionServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/action_service_condition.rbs b/sig/zitadel/client/models/action_service_condition.rbs new file mode 100644 index 00000000..dc298098 --- /dev/null +++ b/sig/zitadel/client/models/action_service_condition.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ActionServiceCondition < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader event: ActionServiceEventExecution? + attr_reader function: ActionServiceFunctionExecution? + attr_reader request: ActionServiceRequestExecution? + attr_reader response: ActionServiceResponseExecution? + end +end diff --git a/sig/zitadel/client/models/action_service_connect_error.rbs b/sig/zitadel/client/models/action_service_connect_error.rbs new file mode 100644 index 00000000..742a6525 --- /dev/null +++ b/sig/zitadel/client/models/action_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ActionServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[ActionServiceAny]? + end +end diff --git a/sig/zitadel/client/models/action_service_create_target_request.rbs b/sig/zitadel/client/models/action_service_create_target_request.rbs new file mode 100644 index 00000000..cace1603 --- /dev/null +++ b/sig/zitadel/client/models/action_service_create_target_request.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class ActionServiceCreateTargetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader timeout: ISO8601::Duration? + attr_reader endpoint: String? + attr_reader payload_type: ActionServicePayloadType? + attr_reader rest_async: untyped? + attr_reader rest_call: ActionServiceRESTCall? + attr_reader rest_webhook: ActionServiceRESTWebhook? + end +end diff --git a/sig/zitadel/client/models/action_service_create_target_response.rbs b/sig/zitadel/client/models/action_service_create_target_response.rbs new file mode 100644 index 00000000..05abf352 --- /dev/null +++ b/sig/zitadel/client/models/action_service_create_target_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServiceCreateTargetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader signing_key: String? + end +end diff --git a/sig/zitadel/client/models/action_service_deactivate_public_key_request.rbs b/sig/zitadel/client/models/action_service_deactivate_public_key_request.rbs new file mode 100644 index 00000000..ff32551d --- /dev/null +++ b/sig/zitadel/client/models/action_service_deactivate_public_key_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceDeactivatePublicKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_id: String? + attr_reader key_id: String? + end +end diff --git a/sig/zitadel/client/models/action_service_deactivate_public_key_response.rbs b/sig/zitadel/client/models/action_service_deactivate_public_key_response.rbs new file mode 100644 index 00000000..b9c07dc2 --- /dev/null +++ b/sig/zitadel/client/models/action_service_deactivate_public_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceDeactivatePublicKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/action_service_delete_target_request.rbs b/sig/zitadel/client/models/action_service_delete_target_request.rbs new file mode 100644 index 00000000..d672c462 --- /dev/null +++ b/sig/zitadel/client/models/action_service_delete_target_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceDeleteTargetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/action_service_delete_target_response.rbs b/sig/zitadel/client/models/action_service_delete_target_response.rbs new file mode 100644 index 00000000..f272670e --- /dev/null +++ b/sig/zitadel/client/models/action_service_delete_target_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceDeleteTargetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/action_service_event_execution.rbs b/sig/zitadel/client/models/action_service_event_execution.rbs new file mode 100644 index 00000000..6781d6df --- /dev/null +++ b/sig/zitadel/client/models/action_service_event_execution.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServiceEventExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader all: bool? + attr_reader event: String? + attr_reader group: String? + end +end diff --git a/sig/zitadel/client/models/action_service_execution.rbs b/sig/zitadel/client/models/action_service_execution.rbs new file mode 100644 index 00000000..53ae273b --- /dev/null +++ b/sig/zitadel/client/models/action_service_execution.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ActionServiceExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader condition: ActionServiceCondition? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader targets: Array[String]? + end +end diff --git a/sig/zitadel/client/models/action_service_execution_field_name.rbs b/sig/zitadel/client/models/action_service_execution_field_name.rbs new file mode 100644 index 00000000..77a281be --- /dev/null +++ b/sig/zitadel/client/models/action_service_execution_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServiceExecutionFieldName + EXECUTION_FIELD_NAME_UNSPECIFIED: String + EXECUTION_FIELD_NAME_ID: String + EXECUTION_FIELD_NAME_CREATED_DATE: String + EXECUTION_FIELD_NAME_CHANGED_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/action_service_execution_search_filter.rbs b/sig/zitadel/client/models/action_service_execution_search_filter.rbs new file mode 100644 index 00000000..d26007d2 --- /dev/null +++ b/sig/zitadel/client/models/action_service_execution_search_filter.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServiceExecutionSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader execution_type_filter: ActionServiceExecutionTypeFilter? + attr_reader in_conditions_filter: ActionServiceInConditionsFilter? + attr_reader target_filter: ActionServiceTargetFilter? + end +end diff --git a/sig/zitadel/client/models/action_service_execution_type.rbs b/sig/zitadel/client/models/action_service_execution_type.rbs new file mode 100644 index 00000000..69f72ad0 --- /dev/null +++ b/sig/zitadel/client/models/action_service_execution_type.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ActionServiceExecutionType + EXECUTION_TYPE_UNSPECIFIED: String + EXECUTION_TYPE_REQUEST: String + EXECUTION_TYPE_RESPONSE: String + EXECUTION_TYPE_EVENT: String + EXECUTION_TYPE_FUNCTION: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/action_service_execution_type_filter.rbs b/sig/zitadel/client/models/action_service_execution_type_filter.rbs new file mode 100644 index 00000000..4a54c2d4 --- /dev/null +++ b/sig/zitadel/client/models/action_service_execution_type_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceExecutionTypeFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader execution_type: ActionServiceExecutionType? + end +end diff --git a/sig/zitadel/client/models/action_service_function_execution.rbs b/sig/zitadel/client/models/action_service_function_execution.rbs new file mode 100644 index 00000000..2c2ddb07 --- /dev/null +++ b/sig/zitadel/client/models/action_service_function_execution.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceFunctionExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + end +end diff --git a/sig/zitadel/client/models/action_service_get_target_request.rbs b/sig/zitadel/client/models/action_service_get_target_request.rbs new file mode 100644 index 00000000..ca70872d --- /dev/null +++ b/sig/zitadel/client/models/action_service_get_target_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceGetTargetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/action_service_get_target_response.rbs b/sig/zitadel/client/models/action_service_get_target_response.rbs new file mode 100644 index 00000000..cb31f0b9 --- /dev/null +++ b/sig/zitadel/client/models/action_service_get_target_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceGetTargetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target: ActionServiceTarget? + end +end diff --git a/sig/zitadel/client/models/action_service_in_conditions_filter.rbs b/sig/zitadel/client/models/action_service_in_conditions_filter.rbs new file mode 100644 index 00000000..0b8228ef --- /dev/null +++ b/sig/zitadel/client/models/action_service_in_conditions_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceInConditionsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader conditions: Array[ActionServiceCondition]? + end +end diff --git a/sig/zitadel/client/models/action_service_in_ids_filter.rbs b/sig/zitadel/client/models/action_service_in_ids_filter.rbs new file mode 100644 index 00000000..a2f9463e --- /dev/null +++ b/sig/zitadel/client/models/action_service_in_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceInIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/action_service_in_target_ids_filter.rbs b/sig/zitadel/client/models/action_service_in_target_ids_filter.rbs new file mode 100644 index 00000000..3b7fa6e1 --- /dev/null +++ b/sig/zitadel/client/models/action_service_in_target_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceInTargetIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/action_service_list_execution_functions_response.rbs b/sig/zitadel/client/models/action_service_list_execution_functions_response.rbs new file mode 100644 index 00000000..a4e3bd46 --- /dev/null +++ b/sig/zitadel/client/models/action_service_list_execution_functions_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceListExecutionFunctionsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader functions: Array[String]? + end +end diff --git a/sig/zitadel/client/models/action_service_list_execution_methods_response.rbs b/sig/zitadel/client/models/action_service_list_execution_methods_response.rbs new file mode 100644 index 00000000..97532261 --- /dev/null +++ b/sig/zitadel/client/models/action_service_list_execution_methods_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceListExecutionMethodsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader methods: Array[String]? + end +end diff --git a/sig/zitadel/client/models/action_service_list_execution_services_response.rbs b/sig/zitadel/client/models/action_service_list_execution_services_response.rbs new file mode 100644 index 00000000..f1fcb9f8 --- /dev/null +++ b/sig/zitadel/client/models/action_service_list_execution_services_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceListExecutionServicesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader services: Array[String]? + end +end diff --git a/sig/zitadel/client/models/action_service_list_executions_request.rbs b/sig/zitadel/client/models/action_service_list_executions_request.rbs new file mode 100644 index 00000000..d8f8aa53 --- /dev/null +++ b/sig/zitadel/client/models/action_service_list_executions_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServiceListExecutionsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ActionServicePaginationRequest? + attr_reader sorting_column: ActionServiceExecutionFieldName? + attr_reader filters: Array[ActionServiceExecutionSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/action_service_list_executions_response.rbs b/sig/zitadel/client/models/action_service_list_executions_response.rbs new file mode 100644 index 00000000..7382c71d --- /dev/null +++ b/sig/zitadel/client/models/action_service_list_executions_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceListExecutionsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ActionServicePaginationResponse? + attr_reader executions: Array[ActionServiceExecution]? + end +end diff --git a/sig/zitadel/client/models/action_service_list_public_keys_request.rbs b/sig/zitadel/client/models/action_service_list_public_keys_request.rbs new file mode 100644 index 00000000..ab5c807a --- /dev/null +++ b/sig/zitadel/client/models/action_service_list_public_keys_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ActionServiceListPublicKeysRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_id: String? + attr_reader pagination: ActionServicePaginationRequest? + attr_reader sorting_column: ActionServicePublicKeyFieldName? + attr_reader filters: Array[ActionServicePublicKeySearchFilter]? + end +end diff --git a/sig/zitadel/client/models/action_service_list_public_keys_response.rbs b/sig/zitadel/client/models/action_service_list_public_keys_response.rbs new file mode 100644 index 00000000..b28bfeb0 --- /dev/null +++ b/sig/zitadel/client/models/action_service_list_public_keys_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceListPublicKeysResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ActionServicePaginationResponse? + attr_reader public_keys: Array[ActionServicePublicKey]? + end +end diff --git a/sig/zitadel/client/models/action_service_list_targets_request.rbs b/sig/zitadel/client/models/action_service_list_targets_request.rbs new file mode 100644 index 00000000..ec859f63 --- /dev/null +++ b/sig/zitadel/client/models/action_service_list_targets_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServiceListTargetsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ActionServicePaginationRequest? + attr_reader sorting_column: ActionServiceTargetFieldName? + attr_reader filters: Array[ActionServiceTargetSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/action_service_list_targets_response.rbs b/sig/zitadel/client/models/action_service_list_targets_response.rbs new file mode 100644 index 00000000..a36470ca --- /dev/null +++ b/sig/zitadel/client/models/action_service_list_targets_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceListTargetsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ActionServicePaginationResponse? + attr_reader targets: Array[ActionServiceTarget]? + end +end diff --git a/sig/zitadel/client/models/action_service_pagination_request.rbs b/sig/zitadel/client/models/action_service_pagination_request.rbs new file mode 100644 index 00000000..125a0450 --- /dev/null +++ b/sig/zitadel/client/models/action_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/action_service_pagination_response.rbs b/sig/zitadel/client/models/action_service_pagination_response.rbs new file mode 100644 index 00000000..e763176e --- /dev/null +++ b/sig/zitadel/client/models/action_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/action_service_payload_type.rbs b/sig/zitadel/client/models/action_service_payload_type.rbs new file mode 100644 index 00000000..07b72124 --- /dev/null +++ b/sig/zitadel/client/models/action_service_payload_type.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServicePayloadType + PAYLOAD_TYPE_UNSPECIFIED: String + PAYLOAD_TYPE_JSON: String + PAYLOAD_TYPE_JWT: String + PAYLOAD_TYPE_JWE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/action_service_public_key.rbs b/sig/zitadel/client/models/action_service_public_key.rbs new file mode 100644 index 00000000..8e79e4fd --- /dev/null +++ b/sig/zitadel/client/models/action_service_public_key.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class ActionServicePublicKey < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_id: String? + attr_reader active: bool? + attr_reader public_key: String? + attr_reader fingerprint: String? + attr_reader expiration_date: Time? + attr_reader creation_date: Time? + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/action_service_public_key_field_name.rbs b/sig/zitadel/client/models/action_service_public_key_field_name.rbs new file mode 100644 index 00000000..59172ac9 --- /dev/null +++ b/sig/zitadel/client/models/action_service_public_key_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServicePublicKeyFieldName + PUBLIC_KEY_FIELD_NAME_UNSPECIFIED: String + PUBLIC_KEY_FIELD_NAME_CREATION_DATE: String + PUBLIC_KEY_FIELD_NAME_CHANGE_DATE: String + PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/action_service_public_key_search_filter.rbs b/sig/zitadel/client/models/action_service_public_key_search_filter.rbs new file mode 100644 index 00000000..e0dc2e9b --- /dev/null +++ b/sig/zitadel/client/models/action_service_public_key_search_filter.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServicePublicKeySearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader active_filter: bool? + attr_reader expiration_date_filter: ActionServiceTimestampFilter? + attr_reader key_ids_filter: ActionServiceInIDsFilter? + end +end diff --git a/sig/zitadel/client/models/action_service_remove_public_key_request.rbs b/sig/zitadel/client/models/action_service_remove_public_key_request.rbs new file mode 100644 index 00000000..23d21874 --- /dev/null +++ b/sig/zitadel/client/models/action_service_remove_public_key_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceRemovePublicKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_id: String? + attr_reader key_id: String? + end +end diff --git a/sig/zitadel/client/models/action_service_remove_public_key_response.rbs b/sig/zitadel/client/models/action_service_remove_public_key_response.rbs new file mode 100644 index 00000000..af535c14 --- /dev/null +++ b/sig/zitadel/client/models/action_service_remove_public_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceRemovePublicKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/action_service_request_execution.rbs b/sig/zitadel/client/models/action_service_request_execution.rbs new file mode 100644 index 00000000..3c7891d7 --- /dev/null +++ b/sig/zitadel/client/models/action_service_request_execution.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServiceRequestExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader all: bool? + attr_reader method: String? + attr_reader service: String? + end +end diff --git a/sig/zitadel/client/models/action_service_response_execution.rbs b/sig/zitadel/client/models/action_service_response_execution.rbs new file mode 100644 index 00000000..0343400c --- /dev/null +++ b/sig/zitadel/client/models/action_service_response_execution.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ActionServiceResponseExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader all: bool? + attr_reader method: String? + attr_reader service: String? + end +end diff --git a/sig/zitadel/client/models/action_service_rest_call.rbs b/sig/zitadel/client/models/action_service_rest_call.rbs new file mode 100644 index 00000000..4cfa56c6 --- /dev/null +++ b/sig/zitadel/client/models/action_service_rest_call.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceRESTCall < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader interrupt_on_error: bool? + end +end diff --git a/sig/zitadel/client/models/action_service_rest_webhook.rbs b/sig/zitadel/client/models/action_service_rest_webhook.rbs new file mode 100644 index 00000000..60f21661 --- /dev/null +++ b/sig/zitadel/client/models/action_service_rest_webhook.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceRESTWebhook < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader interrupt_on_error: bool? + end +end diff --git a/sig/zitadel/client/models/action_service_set_execution_request.rbs b/sig/zitadel/client/models/action_service_set_execution_request.rbs new file mode 100644 index 00000000..cc4636d3 --- /dev/null +++ b/sig/zitadel/client/models/action_service_set_execution_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceSetExecutionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader condition: ActionServiceCondition? + attr_reader targets: Array[String]? + end +end diff --git a/sig/zitadel/client/models/action_service_set_execution_response.rbs b/sig/zitadel/client/models/action_service_set_execution_response.rbs new file mode 100644 index 00000000..8e2e7108 --- /dev/null +++ b/sig/zitadel/client/models/action_service_set_execution_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceSetExecutionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader set_date: Time? + end +end diff --git a/sig/zitadel/client/models/action_service_target.rbs b/sig/zitadel/client/models/action_service_target.rbs new file mode 100644 index 00000000..ac4c64d2 --- /dev/null +++ b/sig/zitadel/client/models/action_service_target.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class ActionServiceTarget < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader name: String? + attr_reader timeout: ISO8601::Duration? + attr_reader endpoint: String? + attr_reader signing_key: String? + attr_reader payload_type: ActionServicePayloadType? + attr_reader rest_async: untyped? + attr_reader rest_call: ActionServiceRESTCall? + attr_reader rest_webhook: ActionServiceRESTWebhook? + end +end diff --git a/sig/zitadel/client/models/action_service_target_field_name.rbs b/sig/zitadel/client/models/action_service_target_field_name.rbs new file mode 100644 index 00000000..47b65004 --- /dev/null +++ b/sig/zitadel/client/models/action_service_target_field_name.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class ActionServiceTargetFieldName + TARGET_FIELD_NAME_UNSPECIFIED: String + TARGET_FIELD_NAME_ID: String + TARGET_FIELD_NAME_CREATED_DATE: String + TARGET_FIELD_NAME_CHANGED_DATE: String + TARGET_FIELD_NAME_NAME: String + TARGET_FIELD_NAME_TARGET_TYPE: String + TARGET_FIELD_NAME_URL: String + TARGET_FIELD_NAME_TIMEOUT: String + TARGET_FIELD_NAME_INTERRUPT_ON_ERROR: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/action_service_target_filter.rbs b/sig/zitadel/client/models/action_service_target_filter.rbs new file mode 100644 index 00000000..be9e3326 --- /dev/null +++ b/sig/zitadel/client/models/action_service_target_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ActionServiceTargetFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_id: String? + end +end diff --git a/sig/zitadel/client/models/action_service_target_name_filter.rbs b/sig/zitadel/client/models/action_service_target_name_filter.rbs new file mode 100644 index 00000000..649cc3ef --- /dev/null +++ b/sig/zitadel/client/models/action_service_target_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceTargetNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_name: String? + attr_reader method: ActionServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/action_service_target_search_filter.rbs b/sig/zitadel/client/models/action_service_target_search_filter.rbs new file mode 100644 index 00000000..f459e6e6 --- /dev/null +++ b/sig/zitadel/client/models/action_service_target_search_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceTargetSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader in_target_ids_filter: ActionServiceInTargetIDsFilter? + attr_reader target_name_filter: ActionServiceTargetNameFilter? + end +end diff --git a/sig/zitadel/client/models/action_service_text_filter_method.rbs b/sig/zitadel/client/models/action_service_text_filter_method.rbs new file mode 100644 index 00000000..00bb188a --- /dev/null +++ b/sig/zitadel/client/models/action_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class ActionServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/action_service_timestamp_filter.rbs b/sig/zitadel/client/models/action_service_timestamp_filter.rbs new file mode 100644 index 00000000..64a41801 --- /dev/null +++ b/sig/zitadel/client/models/action_service_timestamp_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceTimestampFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader timestamp: Time? + attr_reader method: ActionServiceTimestampFilterMethod? + end +end diff --git a/sig/zitadel/client/models/action_service_timestamp_filter_method.rbs b/sig/zitadel/client/models/action_service_timestamp_filter_method.rbs new file mode 100644 index 00000000..5c5fc3c5 --- /dev/null +++ b/sig/zitadel/client/models/action_service_timestamp_filter_method.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ActionServiceTimestampFilterMethod + TIMESTAMP_FILTER_METHOD_EQUALS: String + TIMESTAMP_FILTER_METHOD_AFTER: String + TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS: String + TIMESTAMP_FILTER_METHOD_BEFORE: String + TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/action_service_update_target_request.rbs b/sig/zitadel/client/models/action_service_update_target_request.rbs new file mode 100644 index 00000000..9d17ad9e --- /dev/null +++ b/sig/zitadel/client/models/action_service_update_target_request.rbs @@ -0,0 +1,17 @@ +module Zitadel::Client::Models + class ActionServiceUpdateTargetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + attr_reader timeout: ISO8601::Duration? + attr_reader endpoint: String? + attr_reader expiration_signing_key: ISO8601::Duration? + attr_reader payload_type: ActionServicePayloadType? + attr_reader rest_async: untyped? + attr_reader rest_call: ActionServiceRESTCall? + attr_reader rest_webhook: ActionServiceRESTWebhook? + end +end diff --git a/sig/zitadel/client/models/action_service_update_target_response.rbs b/sig/zitadel/client/models/action_service_update_target_response.rbs new file mode 100644 index 00000000..9061fb10 --- /dev/null +++ b/sig/zitadel/client/models/action_service_update_target_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ActionServiceUpdateTargetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + attr_reader signing_key: String? + end +end diff --git a/sig/zitadel/client/models/application_service_any.rbs b/sig/zitadel/client/models/application_service_any.rbs new file mode 100644 index 00000000..551bc5fc --- /dev/null +++ b/sig/zitadel/client/models/application_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ApplicationServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/application_service_api_auth_method_type.rbs b/sig/zitadel/client/models/application_service_api_auth_method_type.rbs new file mode 100644 index 00000000..eb588213 --- /dev/null +++ b/sig/zitadel/client/models/application_service_api_auth_method_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceAPIAuthMethodType + API_AUTH_METHOD_TYPE_BASIC: String + API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_api_configuration.rbs b/sig/zitadel/client/models/application_service_api_configuration.rbs new file mode 100644 index 00000000..f50c6b6a --- /dev/null +++ b/sig/zitadel/client/models/application_service_api_configuration.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceAPIConfiguration < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader auth_method_type: ApplicationServiceAPIAuthMethodType? + end +end diff --git a/sig/zitadel/client/models/application_service_application.rbs b/sig/zitadel/client/models/application_service_application.rbs new file mode 100644 index 00000000..d184e081 --- /dev/null +++ b/sig/zitadel/client/models/application_service_application.rbs @@ -0,0 +1,17 @@ +module Zitadel::Client::Models + class ApplicationServiceApplication < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader state: ApplicationServiceApplicationState? + attr_reader name: String? + attr_reader project_id: String? + attr_reader api_configuration: ApplicationServiceAPIConfiguration? + attr_reader oidc_configuration: ApplicationServiceOIDCConfiguration? + attr_reader saml_configuration: ApplicationServiceSAMLConfiguration? + end +end diff --git a/sig/zitadel/client/models/application_service_application_key.rbs b/sig/zitadel/client/models/application_service_application_key.rbs new file mode 100644 index 00000000..0d7d456c --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_key.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationKey < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_id: String? + attr_reader application_id: String? + attr_reader project_id: String? + attr_reader creation_date: Time? + attr_reader organization_id: String? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/application_service_application_key_application_id_filter.rbs b/sig/zitadel/client/models/application_service_application_key_application_id_filter.rbs new file mode 100644 index 00000000..99774fb1 --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_key_application_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationKeyApplicationIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_application_key_organization_id_filter.rbs b/sig/zitadel/client/models/application_service_application_key_organization_id_filter.rbs new file mode 100644 index 00000000..7d81d41f --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_key_organization_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationKeyOrganizationIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_application_key_project_id_filter.rbs b/sig/zitadel/client/models/application_service_application_key_project_id_filter.rbs new file mode 100644 index 00000000..3a1e2afc --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_key_project_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationKeyProjectIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_application_key_search_filter.rbs b/sig/zitadel/client/models/application_service_application_key_search_filter.rbs new file mode 100644 index 00000000..e721f3c5 --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_key_search_filter.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationKeySearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id_filter: ApplicationServiceApplicationKeyApplicationIDFilter? + attr_reader organization_id_filter: ApplicationServiceApplicationKeyOrganizationIDFilter? + attr_reader project_id_filter: ApplicationServiceApplicationKeyProjectIDFilter? + end +end diff --git a/sig/zitadel/client/models/application_service_application_keys_sorting.rbs b/sig/zitadel/client/models/application_service_application_keys_sorting.rbs new file mode 100644 index 00000000..deda4f8e --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_keys_sorting.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationKeysSorting + APPLICATION_KEYS_SORT_BY_ID: String + APPLICATION_KEYS_SORT_BY_PROJECT_ID: String + APPLICATION_KEYS_SORT_BY_APPLICATION_ID: String + APPLICATION_KEYS_SORT_BY_CREATION_DATE: String + APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID: String + APPLICATION_KEYS_SORT_BY_EXPIRATION: String + APPLICATION_KEYS_SORT_BY_TYPE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_application_name_filter.rbs b/sig/zitadel/client/models/application_service_application_name_filter.rbs new file mode 100644 index 00000000..fac6029d --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader method: ApplicationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/application_service_application_search_filter.rbs b/sig/zitadel/client/models/application_service_application_search_filter.rbs new file mode 100644 index 00000000..0ed4ef68 --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_search_filter.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id_filter: ApplicationServiceClientIDFilter? + attr_reader entity_id_filter: ApplicationServiceEntityIDFilter? + attr_reader name_filter: ApplicationServiceApplicationNameFilter? + attr_reader project_id_filter: ApplicationServiceProjectIDFilter? + attr_reader state_filter: ApplicationServiceApplicationState? + attr_reader type_filter: ApplicationServiceApplicationType? + end +end diff --git a/sig/zitadel/client/models/application_service_application_sorting.rbs b/sig/zitadel/client/models/application_service_application_sorting.rbs new file mode 100644 index 00000000..759ea78e --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_sorting.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationSorting + APPLICATION_SORT_BY_ID: String + APPLICATION_SORT_BY_NAME: String + APPLICATION_SORT_BY_STATE: String + APPLICATION_SORT_BY_CREATION_DATE: String + APPLICATION_SORT_BY_CHANGE_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_application_state.rbs b/sig/zitadel/client/models/application_service_application_state.rbs new file mode 100644 index 00000000..ae1b0126 --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_state.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationState + APPLICATION_STATE_UNSPECIFIED: String + APPLICATION_STATE_ACTIVE: String + APPLICATION_STATE_INACTIVE: String + APPLICATION_STATE_REMOVED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_application_type.rbs b/sig/zitadel/client/models/application_service_application_type.rbs new file mode 100644 index 00000000..cc2eaafd --- /dev/null +++ b/sig/zitadel/client/models/application_service_application_type.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceApplicationType + APPLICATION_TYPE_UNSPECIFIED: String + APPLICATION_TYPE_OIDC: String + APPLICATION_TYPE_API: String + APPLICATION_TYPE_SAML: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_client_id_filter.rbs b/sig/zitadel/client/models/application_service_client_id_filter.rbs new file mode 100644 index 00000000..43165778 --- /dev/null +++ b/sig/zitadel/client/models/application_service_client_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceClientIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_connect_error.rbs b/sig/zitadel/client/models/application_service_connect_error.rbs new file mode 100644 index 00000000..b34f8d79 --- /dev/null +++ b/sig/zitadel/client/models/application_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ApplicationServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[ApplicationServiceAny]? + end +end diff --git a/sig/zitadel/client/models/application_service_create_api_application_request.rbs b/sig/zitadel/client/models/application_service_create_api_application_request.rbs new file mode 100644 index 00000000..f5160e8a --- /dev/null +++ b/sig/zitadel/client/models/application_service_create_api_application_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceCreateAPIApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_method_type: ApplicationServiceAPIAuthMethodType? + end +end diff --git a/sig/zitadel/client/models/application_service_create_api_application_response.rbs b/sig/zitadel/client/models/application_service_create_api_application_response.rbs new file mode 100644 index 00000000..045a1b29 --- /dev/null +++ b/sig/zitadel/client/models/application_service_create_api_application_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceCreateAPIApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader client_secret: String? + end +end diff --git a/sig/zitadel/client/models/application_service_create_application_key_request.rbs b/sig/zitadel/client/models/application_service_create_application_key_request.rbs new file mode 100644 index 00000000..84f2960e --- /dev/null +++ b/sig/zitadel/client/models/application_service_create_application_key_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceCreateApplicationKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + attr_reader project_id: String? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/application_service_create_application_key_response.rbs b/sig/zitadel/client/models/application_service_create_application_key_response.rbs new file mode 100644 index 00000000..8920cb3c --- /dev/null +++ b/sig/zitadel/client/models/application_service_create_application_key_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceCreateApplicationKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_id: String? + attr_reader creation_date: Time? + attr_reader key_details: String? + end +end diff --git a/sig/zitadel/client/models/application_service_create_application_request.rbs b/sig/zitadel/client/models/application_service_create_application_request.rbs new file mode 100644 index 00000000..de7002cc --- /dev/null +++ b/sig/zitadel/client/models/application_service_create_application_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class ApplicationServiceCreateApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader application_id: String? + attr_reader name: String? + attr_reader api_configuration: ApplicationServiceCreateAPIApplicationRequest? + attr_reader oidc_configuration: ApplicationServiceCreateOIDCApplicationRequest? + attr_reader saml_configuration: ApplicationServiceCreateSAMLApplicationRequest? + end +end diff --git a/sig/zitadel/client/models/application_service_create_application_response.rbs b/sig/zitadel/client/models/application_service_create_application_response.rbs new file mode 100644 index 00000000..9a37553b --- /dev/null +++ b/sig/zitadel/client/models/application_service_create_application_response.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class ApplicationServiceCreateApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + attr_reader creation_date: Time? + attr_reader api_configuration: ApplicationServiceCreateAPIApplicationResponse? + attr_reader oidc_configuration: ApplicationServiceCreateOIDCApplicationResponse? + attr_reader saml_configuration: untyped? + end +end diff --git a/sig/zitadel/client/models/application_service_create_oidc_application_request.rbs b/sig/zitadel/client/models/application_service_create_oidc_application_request.rbs new file mode 100644 index 00000000..46ea5afb --- /dev/null +++ b/sig/zitadel/client/models/application_service_create_oidc_application_request.rbs @@ -0,0 +1,25 @@ +module Zitadel::Client::Models + class ApplicationServiceCreateOIDCApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader redirect_uris: Array[String]? + attr_reader response_types: Array[ApplicationServiceOIDCResponseType]? + attr_reader grant_types: Array[ApplicationServiceOIDCGrantType]? + attr_reader application_type: ApplicationServiceOIDCApplicationType? + attr_reader auth_method_type: ApplicationServiceOIDCAuthMethodType? + attr_reader post_logout_redirect_uris: Array[String]? + attr_reader version: ApplicationServiceOIDCVersion? + attr_reader development_mode: bool? + attr_reader access_token_type: ApplicationServiceOIDCTokenType? + attr_reader access_token_role_assertion: bool? + attr_reader id_token_role_assertion: bool? + attr_reader id_token_userinfo_assertion: bool? + attr_reader clock_skew: ISO8601::Duration? + attr_reader additional_origins: Array[String]? + attr_reader skip_native_app_success_page: bool? + attr_reader back_channel_logout_uri: String? + attr_reader login_version: ApplicationServiceLoginVersion? + end +end diff --git a/sig/zitadel/client/models/application_service_create_oidc_application_response.rbs b/sig/zitadel/client/models/application_service_create_oidc_application_response.rbs new file mode 100644 index 00000000..740b3ef6 --- /dev/null +++ b/sig/zitadel/client/models/application_service_create_oidc_application_response.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ApplicationServiceCreateOIDCApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader client_secret: String? + attr_reader non_compliant: bool? + attr_reader compliance_problems: Array[ApplicationServiceOIDCLocalizedMessage]? + end +end diff --git a/sig/zitadel/client/models/application_service_create_saml_application_request.rbs b/sig/zitadel/client/models/application_service_create_saml_application_request.rbs new file mode 100644 index 00000000..424d8aae --- /dev/null +++ b/sig/zitadel/client/models/application_service_create_saml_application_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceCreateSAMLApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_version: ApplicationServiceLoginVersion? + attr_reader metadata_url: String? + attr_reader metadata_xml: String? + end +end diff --git a/sig/zitadel/client/models/application_service_deactivate_application_request.rbs b/sig/zitadel/client/models/application_service_deactivate_application_request.rbs new file mode 100644 index 00000000..fcf780df --- /dev/null +++ b/sig/zitadel/client/models/application_service_deactivate_application_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceDeactivateApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_deactivate_application_response.rbs b/sig/zitadel/client/models/application_service_deactivate_application_response.rbs new file mode 100644 index 00000000..f7ba1fc2 --- /dev/null +++ b/sig/zitadel/client/models/application_service_deactivate_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceDeactivateApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deactivation_date: Time? + end +end diff --git a/sig/zitadel/client/models/application_service_delete_application_key_request.rbs b/sig/zitadel/client/models/application_service_delete_application_key_request.rbs new file mode 100644 index 00000000..f1b008b8 --- /dev/null +++ b/sig/zitadel/client/models/application_service_delete_application_key_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceDeleteApplicationKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_id: String? + attr_reader application_id: String? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_delete_application_key_response.rbs b/sig/zitadel/client/models/application_service_delete_application_key_response.rbs new file mode 100644 index 00000000..a7d474c2 --- /dev/null +++ b/sig/zitadel/client/models/application_service_delete_application_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceDeleteApplicationKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/application_service_delete_application_request.rbs b/sig/zitadel/client/models/application_service_delete_application_request.rbs new file mode 100644 index 00000000..9ca8dbb7 --- /dev/null +++ b/sig/zitadel/client/models/application_service_delete_application_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceDeleteApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_delete_application_response.rbs b/sig/zitadel/client/models/application_service_delete_application_response.rbs new file mode 100644 index 00000000..b45633fe --- /dev/null +++ b/sig/zitadel/client/models/application_service_delete_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceDeleteApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/application_service_entity_id_filter.rbs b/sig/zitadel/client/models/application_service_entity_id_filter.rbs new file mode 100644 index 00000000..80a26a2e --- /dev/null +++ b/sig/zitadel/client/models/application_service_entity_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceEntityIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader entity_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_generate_client_secret_request.rbs b/sig/zitadel/client/models/application_service_generate_client_secret_request.rbs new file mode 100644 index 00000000..92a0b7d3 --- /dev/null +++ b/sig/zitadel/client/models/application_service_generate_client_secret_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceGenerateClientSecretRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_generate_client_secret_response.rbs b/sig/zitadel/client/models/application_service_generate_client_secret_response.rbs new file mode 100644 index 00000000..66df76be --- /dev/null +++ b/sig/zitadel/client/models/application_service_generate_client_secret_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceGenerateClientSecretResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_secret: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/application_service_get_application_key_request.rbs b/sig/zitadel/client/models/application_service_get_application_key_request.rbs new file mode 100644 index 00000000..29526be2 --- /dev/null +++ b/sig/zitadel/client/models/application_service_get_application_key_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceGetApplicationKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_get_application_key_response.rbs b/sig/zitadel/client/models/application_service_get_application_key_response.rbs new file mode 100644 index 00000000..f78b55df --- /dev/null +++ b/sig/zitadel/client/models/application_service_get_application_key_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceGetApplicationKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_id: String? + attr_reader creation_date: Time? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/application_service_get_application_request.rbs b/sig/zitadel/client/models/application_service_get_application_request.rbs new file mode 100644 index 00000000..6c7f1feb --- /dev/null +++ b/sig/zitadel/client/models/application_service_get_application_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceGetApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_get_application_response.rbs b/sig/zitadel/client/models/application_service_get_application_response.rbs new file mode 100644 index 00000000..b6ea3249 --- /dev/null +++ b/sig/zitadel/client/models/application_service_get_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceGetApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application: ApplicationServiceApplication? + end +end diff --git a/sig/zitadel/client/models/application_service_list_application_keys_request.rbs b/sig/zitadel/client/models/application_service_list_application_keys_request.rbs new file mode 100644 index 00000000..b5226428 --- /dev/null +++ b/sig/zitadel/client/models/application_service_list_application_keys_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceListApplicationKeysRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ApplicationServicePaginationRequest? + attr_reader sorting_column: ApplicationServiceApplicationKeysSorting? + attr_reader filters: Array[ApplicationServiceApplicationKeySearchFilter]? + end +end diff --git a/sig/zitadel/client/models/application_service_list_application_keys_response.rbs b/sig/zitadel/client/models/application_service_list_application_keys_response.rbs new file mode 100644 index 00000000..565bf572 --- /dev/null +++ b/sig/zitadel/client/models/application_service_list_application_keys_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceListApplicationKeysResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader keys: Array[ApplicationServiceApplicationKey]? + attr_reader pagination: ApplicationServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/application_service_list_applications_request.rbs b/sig/zitadel/client/models/application_service_list_applications_request.rbs new file mode 100644 index 00000000..b36ee93d --- /dev/null +++ b/sig/zitadel/client/models/application_service_list_applications_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceListApplicationsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ApplicationServicePaginationRequest? + attr_reader sorting_column: ApplicationServiceApplicationSorting? + attr_reader filters: Array[ApplicationServiceApplicationSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/application_service_list_applications_response.rbs b/sig/zitadel/client/models/application_service_list_applications_response.rbs new file mode 100644 index 00000000..addd7f43 --- /dev/null +++ b/sig/zitadel/client/models/application_service_list_applications_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceListApplicationsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader applications: Array[ApplicationServiceApplication]? + attr_reader pagination: ApplicationServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/application_service_login_v2.rbs b/sig/zitadel/client/models/application_service_login_v2.rbs new file mode 100644 index 00000000..cf17c654 --- /dev/null +++ b/sig/zitadel/client/models/application_service_login_v2.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceLoginV2 < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader base_uri: String? + end +end diff --git a/sig/zitadel/client/models/application_service_login_version.rbs b/sig/zitadel/client/models/application_service_login_version.rbs new file mode 100644 index 00000000..6275e7ff --- /dev/null +++ b/sig/zitadel/client/models/application_service_login_version.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceLoginVersion < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_v1: untyped? + attr_reader login_v2: ApplicationServiceLoginV2? + end +end diff --git a/sig/zitadel/client/models/application_service_oidc_application_type.rbs b/sig/zitadel/client/models/application_service_oidc_application_type.rbs new file mode 100644 index 00000000..aea19b98 --- /dev/null +++ b/sig/zitadel/client/models/application_service_oidc_application_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceOIDCApplicationType + OIDC_APP_TYPE_WEB: String + OIDC_APP_TYPE_USER_AGENT: String + OIDC_APP_TYPE_NATIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_oidc_auth_method_type.rbs b/sig/zitadel/client/models/application_service_oidc_auth_method_type.rbs new file mode 100644 index 00000000..a9bffc4d --- /dev/null +++ b/sig/zitadel/client/models/application_service_oidc_auth_method_type.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceOIDCAuthMethodType + OIDC_AUTH_METHOD_TYPE_BASIC: String + OIDC_AUTH_METHOD_TYPE_POST: String + OIDC_AUTH_METHOD_TYPE_NONE: String + OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_oidc_configuration.rbs b/sig/zitadel/client/models/application_service_oidc_configuration.rbs new file mode 100644 index 00000000..80c05073 --- /dev/null +++ b/sig/zitadel/client/models/application_service_oidc_configuration.rbs @@ -0,0 +1,29 @@ +module Zitadel::Client::Models + class ApplicationServiceOIDCConfiguration < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader redirect_uris: Array[String]? + attr_reader response_types: Array[ApplicationServiceOIDCResponseType]? + attr_reader grant_types: Array[ApplicationServiceOIDCGrantType]? + attr_reader application_type: ApplicationServiceOIDCApplicationType? + attr_reader client_id: String? + attr_reader auth_method_type: ApplicationServiceOIDCAuthMethodType? + attr_reader post_logout_redirect_uris: Array[String]? + attr_reader version: ApplicationServiceOIDCVersion? + attr_reader non_compliant: bool? + attr_reader compliance_problems: Array[ApplicationServiceOIDCLocalizedMessage]? + attr_reader development_mode: bool? + attr_reader access_token_type: ApplicationServiceOIDCTokenType? + attr_reader access_token_role_assertion: bool? + attr_reader id_token_role_assertion: bool? + attr_reader id_token_userinfo_assertion: bool? + attr_reader clock_skew: ISO8601::Duration? + attr_reader additional_origins: Array[String]? + attr_reader allowed_origins: Array[String]? + attr_reader skip_native_app_success_page: bool? + attr_reader back_channel_logout_uri: String? + attr_reader login_version: ApplicationServiceLoginVersion? + end +end diff --git a/sig/zitadel/client/models/application_service_oidc_grant_type.rbs b/sig/zitadel/client/models/application_service_oidc_grant_type.rbs new file mode 100644 index 00000000..8243b924 --- /dev/null +++ b/sig/zitadel/client/models/application_service_oidc_grant_type.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ApplicationServiceOIDCGrantType + OIDC_GRANT_TYPE_AUTHORIZATION_CODE: String + OIDC_GRANT_TYPE_IMPLICIT: String + OIDC_GRANT_TYPE_REFRESH_TOKEN: String + OIDC_GRANT_TYPE_DEVICE_CODE: String + OIDC_GRANT_TYPE_TOKEN_EXCHANGE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_oidc_localized_message.rbs b/sig/zitadel/client/models/application_service_oidc_localized_message.rbs new file mode 100644 index 00000000..85c0a5e3 --- /dev/null +++ b/sig/zitadel/client/models/application_service_oidc_localized_message.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceOIDCLocalizedMessage < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader localized_message: String? + end +end diff --git a/sig/zitadel/client/models/application_service_oidc_response_type.rbs b/sig/zitadel/client/models/application_service_oidc_response_type.rbs new file mode 100644 index 00000000..629d1bc1 --- /dev/null +++ b/sig/zitadel/client/models/application_service_oidc_response_type.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceOIDCResponseType + OIDC_RESPONSE_TYPE_UNSPECIFIED: String + OIDC_RESPONSE_TYPE_CODE: String + OIDC_RESPONSE_TYPE_ID_TOKEN: String + OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_oidc_token_type.rbs b/sig/zitadel/client/models/application_service_oidc_token_type.rbs new file mode 100644 index 00000000..55a01112 --- /dev/null +++ b/sig/zitadel/client/models/application_service_oidc_token_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceOIDCTokenType + OIDC_TOKEN_TYPE_BEARER: String + OIDC_TOKEN_TYPE_JWT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_oidc_version.rbs b/sig/zitadel/client/models/application_service_oidc_version.rbs new file mode 100644 index 00000000..47047c76 --- /dev/null +++ b/sig/zitadel/client/models/application_service_oidc_version.rbs @@ -0,0 +1,8 @@ +module Zitadel::Client::Models + class ApplicationServiceOIDCVersion + OIDC_VERSION_1_0: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_pagination_request.rbs b/sig/zitadel/client/models/application_service_pagination_request.rbs new file mode 100644 index 00000000..2d523676 --- /dev/null +++ b/sig/zitadel/client/models/application_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/application_service_pagination_response.rbs b/sig/zitadel/client/models/application_service_pagination_response.rbs new file mode 100644 index 00000000..1d414687 --- /dev/null +++ b/sig/zitadel/client/models/application_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/application_service_project_id_filter.rbs b/sig/zitadel/client/models/application_service_project_id_filter.rbs new file mode 100644 index 00000000..f6547c39 --- /dev/null +++ b/sig/zitadel/client/models/application_service_project_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceProjectIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_reactivate_application_request.rbs b/sig/zitadel/client/models/application_service_reactivate_application_request.rbs new file mode 100644 index 00000000..73c1c2a2 --- /dev/null +++ b/sig/zitadel/client/models/application_service_reactivate_application_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ApplicationServiceReactivateApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/application_service_reactivate_application_response.rbs b/sig/zitadel/client/models/application_service_reactivate_application_response.rbs new file mode 100644 index 00000000..5f654075 --- /dev/null +++ b/sig/zitadel/client/models/application_service_reactivate_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceReactivateApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader reactivation_date: Time? + end +end diff --git a/sig/zitadel/client/models/application_service_saml_configuration.rbs b/sig/zitadel/client/models/application_service_saml_configuration.rbs new file mode 100644 index 00000000..cb18ead7 --- /dev/null +++ b/sig/zitadel/client/models/application_service_saml_configuration.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceSAMLConfiguration < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader metadata_xml: String? + attr_reader metadata_url: String? + attr_reader login_version: ApplicationServiceLoginVersion? + end +end diff --git a/sig/zitadel/client/models/application_service_text_filter_method.rbs b/sig/zitadel/client/models/application_service_text_filter_method.rbs new file mode 100644 index 00000000..e318502b --- /dev/null +++ b/sig/zitadel/client/models/application_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class ApplicationServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/application_service_update_api_application_configuration_request.rbs b/sig/zitadel/client/models/application_service_update_api_application_configuration_request.rbs new file mode 100644 index 00000000..89344b25 --- /dev/null +++ b/sig/zitadel/client/models/application_service_update_api_application_configuration_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceUpdateAPIApplicationConfigurationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_method_type: ApplicationServiceAPIAuthMethodType? + end +end diff --git a/sig/zitadel/client/models/application_service_update_application_request.rbs b/sig/zitadel/client/models/application_service_update_application_request.rbs new file mode 100644 index 00000000..d97b56b2 --- /dev/null +++ b/sig/zitadel/client/models/application_service_update_application_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class ApplicationServiceUpdateApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader application_id: String? + attr_reader project_id: String? + attr_reader name: String? + attr_reader api_configuration: ApplicationServiceUpdateAPIApplicationConfigurationRequest? + attr_reader oidc_configuration: ApplicationServiceUpdateOIDCApplicationConfigurationRequest? + attr_reader saml_configuration: ApplicationServiceUpdateSAMLApplicationConfigurationRequest? + end +end diff --git a/sig/zitadel/client/models/application_service_update_application_response.rbs b/sig/zitadel/client/models/application_service_update_application_response.rbs new file mode 100644 index 00000000..8da6180a --- /dev/null +++ b/sig/zitadel/client/models/application_service_update_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ApplicationServiceUpdateApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/application_service_update_oidc_application_configuration_request.rbs b/sig/zitadel/client/models/application_service_update_oidc_application_configuration_request.rbs new file mode 100644 index 00000000..cc385621 --- /dev/null +++ b/sig/zitadel/client/models/application_service_update_oidc_application_configuration_request.rbs @@ -0,0 +1,25 @@ +module Zitadel::Client::Models + class ApplicationServiceUpdateOIDCApplicationConfigurationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader redirect_uris: Array[String]? + attr_reader response_types: Array[ApplicationServiceOIDCResponseType]? + attr_reader grant_types: Array[ApplicationServiceOIDCGrantType]? + attr_reader application_type: ApplicationServiceOIDCApplicationType? + attr_reader auth_method_type: ApplicationServiceOIDCAuthMethodType? + attr_reader post_logout_redirect_uris: Array[String]? + attr_reader version: ApplicationServiceOIDCVersion? + attr_reader development_mode: bool? + attr_reader access_token_type: ApplicationServiceOIDCTokenType? + attr_reader access_token_role_assertion: bool? + attr_reader id_token_role_assertion: bool? + attr_reader id_token_userinfo_assertion: bool? + attr_reader clock_skew: ISO8601::Duration? + attr_reader additional_origins: Array[String]? + attr_reader skip_native_app_success_page: bool? + attr_reader back_channel_logout_uri: String? + attr_reader login_version: ApplicationServiceLoginVersion? + end +end diff --git a/sig/zitadel/client/models/application_service_update_saml_application_configuration_request.rbs b/sig/zitadel/client/models/application_service_update_saml_application_configuration_request.rbs new file mode 100644 index 00000000..35223757 --- /dev/null +++ b/sig/zitadel/client/models/application_service_update_saml_application_configuration_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ApplicationServiceUpdateSAMLApplicationConfigurationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_version: ApplicationServiceLoginVersion? + attr_reader metadata_url: String? + attr_reader metadata_xml: String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_activate_authorization_request.rbs b/sig/zitadel/client/models/authorization_service_activate_authorization_request.rbs new file mode 100644 index 00000000..1a45de69 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_activate_authorization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceActivateAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_activate_authorization_response.rbs b/sig/zitadel/client/models/authorization_service_activate_authorization_response.rbs new file mode 100644 index 00000000..ae564762 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_activate_authorization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceActivateAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/authorization_service_any.rbs b/sig/zitadel/client/models/authorization_service_any.rbs new file mode 100644 index 00000000..cacd15ec --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class AuthorizationServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/authorization_service_authorization.rbs b/sig/zitadel/client/models/authorization_service_authorization.rbs new file mode 100644 index 00000000..34b1ef07 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_authorization.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class AuthorizationServiceAuthorization < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader project: AuthorizationServiceProject? + attr_reader organization: AuthorizationServiceOrganization? + attr_reader user: AuthorizationServiceUser? + attr_reader state: AuthorizationServiceState? + attr_reader roles: Array[AuthorizationServiceRole]? + end +end diff --git a/sig/zitadel/client/models/authorization_service_authorization_field_name.rbs b/sig/zitadel/client/models/authorization_service_authorization_field_name.rbs new file mode 100644 index 00000000..448ee977 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_authorization_field_name.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class AuthorizationServiceAuthorizationFieldName + AUTHORIZATION_FIELD_NAME_UNSPECIFIED: String + AUTHORIZATION_FIELD_NAME_CREATED_DATE: String + AUTHORIZATION_FIELD_NAME_CHANGED_DATE: String + AUTHORIZATION_FIELD_NAME_ID: String + AUTHORIZATION_FIELD_NAME_USER_ID: String + AUTHORIZATION_FIELD_NAME_PROJECT_ID: String + AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID: String + AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_authorizations_search_filter.rbs b/sig/zitadel/client/models/authorization_service_authorizations_search_filter.rbs new file mode 100644 index 00000000..2b554497 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_authorizations_search_filter.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class AuthorizationServiceAuthorizationsSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader authorization_ids: AuthorizationServiceInIDsFilter? + attr_reader in_user_ids: AuthorizationServiceInIDsFilter? + attr_reader organization_id: AuthorizationServiceIDFilter? + attr_reader project_grant_id: AuthorizationServiceIDFilter? + attr_reader project_id: AuthorizationServiceIDFilter? + attr_reader project_name: AuthorizationServiceProjectNameQuery? + attr_reader role_key: AuthorizationServiceRoleKeyQuery? + attr_reader state: AuthorizationServiceStateQuery? + attr_reader user_display_name: AuthorizationServiceUserDisplayNameQuery? + attr_reader user_organization_id: AuthorizationServiceIDFilter? + attr_reader user_preferred_login_name: AuthorizationServiceUserPreferredLoginNameQuery? + end +end diff --git a/sig/zitadel/client/models/authorization_service_connect_error.rbs b/sig/zitadel/client/models/authorization_service_connect_error.rbs new file mode 100644 index 00000000..57c4efca --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class AuthorizationServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[AuthorizationServiceAny]? + end +end diff --git a/sig/zitadel/client/models/authorization_service_create_authorization_request.rbs b/sig/zitadel/client/models/authorization_service_create_authorization_request.rbs new file mode 100644 index 00000000..06868f12 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_create_authorization_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class AuthorizationServiceCreateAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader project_id: String? + attr_reader organization_id: String? + attr_reader role_keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/authorization_service_create_authorization_response.rbs b/sig/zitadel/client/models/authorization_service_create_authorization_response.rbs new file mode 100644 index 00000000..edbe5cf0 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_create_authorization_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServiceCreateAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/authorization_service_deactivate_authorization_request.rbs b/sig/zitadel/client/models/authorization_service_deactivate_authorization_request.rbs new file mode 100644 index 00000000..d6748381 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_deactivate_authorization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceDeactivateAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_deactivate_authorization_response.rbs b/sig/zitadel/client/models/authorization_service_deactivate_authorization_response.rbs new file mode 100644 index 00000000..475ac3c0 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_deactivate_authorization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceDeactivateAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/authorization_service_delete_authorization_request.rbs b/sig/zitadel/client/models/authorization_service_delete_authorization_request.rbs new file mode 100644 index 00000000..fb2fba5d --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_delete_authorization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceDeleteAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_delete_authorization_response.rbs b/sig/zitadel/client/models/authorization_service_delete_authorization_response.rbs new file mode 100644 index 00000000..cc0092a6 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_delete_authorization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceDeleteAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/authorization_service_id_filter.rbs b/sig/zitadel/client/models/authorization_service_id_filter.rbs new file mode 100644 index 00000000..9329b953 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_in_ids_filter.rbs b/sig/zitadel/client/models/authorization_service_in_ids_filter.rbs new file mode 100644 index 00000000..68d5131c --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_in_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceInIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/authorization_service_list_authorizations_request.rbs b/sig/zitadel/client/models/authorization_service_list_authorizations_request.rbs new file mode 100644 index 00000000..9e46a2ac --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_list_authorizations_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class AuthorizationServiceListAuthorizationsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: AuthorizationServicePaginationRequest? + attr_reader sorting_column: AuthorizationServiceAuthorizationFieldName? + attr_reader filters: Array[AuthorizationServiceAuthorizationsSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/authorization_service_list_authorizations_response.rbs b/sig/zitadel/client/models/authorization_service_list_authorizations_response.rbs new file mode 100644 index 00000000..2aa6833a --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_list_authorizations_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServiceListAuthorizationsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: AuthorizationServicePaginationResponse? + attr_reader authorizations: Array[AuthorizationServiceAuthorization]? + end +end diff --git a/sig/zitadel/client/models/authorization_service_organization.rbs b/sig/zitadel/client/models/authorization_service_organization.rbs new file mode 100644 index 00000000..b112dc0f --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_organization.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServiceOrganization < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_pagination_request.rbs b/sig/zitadel/client/models/authorization_service_pagination_request.rbs new file mode 100644 index 00000000..43bf695e --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class AuthorizationServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/authorization_service_pagination_response.rbs b/sig/zitadel/client/models/authorization_service_pagination_response.rbs new file mode 100644 index 00000000..ba77479f --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/authorization_service_project.rbs b/sig/zitadel/client/models/authorization_service_project.rbs new file mode 100644 index 00000000..9e7aad1e --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_project.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class AuthorizationServiceProject < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_project_name_query.rbs b/sig/zitadel/client/models/authorization_service_project_name_query.rbs new file mode 100644 index 00000000..17c2994a --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_project_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServiceProjectNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader method: AuthorizationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/authorization_service_role.rbs b/sig/zitadel/client/models/authorization_service_role.rbs new file mode 100644 index 00000000..3f8a71ea --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_role.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class AuthorizationServiceRole < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader display_name: String? + attr_reader group: String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_role_key_query.rbs b/sig/zitadel/client/models/authorization_service_role_key_query.rbs new file mode 100644 index 00000000..44d5572f --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_role_key_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServiceRoleKeyQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader method: AuthorizationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/authorization_service_state.rbs b/sig/zitadel/client/models/authorization_service_state.rbs new file mode 100644 index 00000000..7cd6aec8 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_state.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServiceState + STATE_UNSPECIFIED: String + STATE_ACTIVE: String + STATE_INACTIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_state_query.rbs b/sig/zitadel/client/models/authorization_service_state_query.rbs new file mode 100644 index 00000000..5e641c4e --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_state_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceStateQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader state: AuthorizationServiceState? + end +end diff --git a/sig/zitadel/client/models/authorization_service_text_filter_method.rbs b/sig/zitadel/client/models/authorization_service_text_filter_method.rbs new file mode 100644 index 00000000..fc56f90c --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class AuthorizationServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_update_authorization_request.rbs b/sig/zitadel/client/models/authorization_service_update_authorization_request.rbs new file mode 100644 index 00000000..ebb460c3 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_update_authorization_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServiceUpdateAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader role_keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/authorization_service_update_authorization_response.rbs b/sig/zitadel/client/models/authorization_service_update_authorization_response.rbs new file mode 100644 index 00000000..a8d8be57 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_update_authorization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class AuthorizationServiceUpdateAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/authorization_service_user.rbs b/sig/zitadel/client/models/authorization_service_user.rbs new file mode 100644 index 00000000..2e666b9a --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_user.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class AuthorizationServiceUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader preferred_login_name: String? + attr_reader display_name: String? + attr_reader avatar_url: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/authorization_service_user_display_name_query.rbs b/sig/zitadel/client/models/authorization_service_user_display_name_query.rbs new file mode 100644 index 00000000..e4d95ed3 --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_user_display_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServiceUserDisplayNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name: String? + attr_reader method: AuthorizationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/authorization_service_user_preferred_login_name_query.rbs b/sig/zitadel/client/models/authorization_service_user_preferred_login_name_query.rbs new file mode 100644 index 00000000..d95c1adb --- /dev/null +++ b/sig/zitadel/client/models/authorization_service_user_preferred_login_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class AuthorizationServiceUserPreferredLoginNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_name: String? + attr_reader method: AuthorizationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_any.rbs b/sig/zitadel/client/models/beta_action_service_any.rbs new file mode 100644 index 00000000..7b06b275 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaActionServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_condition.rbs b/sig/zitadel/client/models/beta_action_service_condition.rbs new file mode 100644 index 00000000..0f3772ee --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_condition.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaActionServiceCondition < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader event: BetaActionServiceEventExecution? + attr_reader function: BetaActionServiceFunctionExecution? + attr_reader request: BetaActionServiceRequestExecution? + attr_reader response: BetaActionServiceResponseExecution? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_connect_error.rbs b/sig/zitadel/client/models/beta_action_service_connect_error.rbs new file mode 100644 index 00000000..db701c3f --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaActionServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaActionServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_create_target_request.rbs b/sig/zitadel/client/models/beta_action_service_create_target_request.rbs new file mode 100644 index 00000000..3aca4aea --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_create_target_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaActionServiceCreateTargetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader timeout: ISO8601::Duration? + attr_reader endpoint: String? + attr_reader rest_async: untyped? + attr_reader rest_call: BetaActionServiceRESTCall? + attr_reader rest_webhook: BetaActionServiceRESTWebhook? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_create_target_response.rbs b/sig/zitadel/client/models/beta_action_service_create_target_response.rbs new file mode 100644 index 00000000..e99dccaf --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_create_target_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaActionServiceCreateTargetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader signing_key: String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_delete_target_request.rbs b/sig/zitadel/client/models/beta_action_service_delete_target_request.rbs new file mode 100644 index 00000000..402eb4ba --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_delete_target_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceDeleteTargetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_delete_target_response.rbs b/sig/zitadel/client/models/beta_action_service_delete_target_response.rbs new file mode 100644 index 00000000..08124c01 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_delete_target_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceDeleteTargetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_event_execution.rbs b/sig/zitadel/client/models/beta_action_service_event_execution.rbs new file mode 100644 index 00000000..919c6143 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_event_execution.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaActionServiceEventExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader all: bool? + attr_reader event: String? + attr_reader group: String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_execution.rbs b/sig/zitadel/client/models/beta_action_service_execution.rbs new file mode 100644 index 00000000..67cfddea --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_execution.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaActionServiceExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader condition: BetaActionServiceCondition? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader targets: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_execution_field_name.rbs b/sig/zitadel/client/models/beta_action_service_execution_field_name.rbs new file mode 100644 index 00000000..1128db8b --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_execution_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaActionServiceExecutionFieldName + EXECUTION_FIELD_NAME_UNSPECIFIED: String + EXECUTION_FIELD_NAME_ID: String + EXECUTION_FIELD_NAME_CREATED_DATE: String + EXECUTION_FIELD_NAME_CHANGED_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_execution_search_filter.rbs b/sig/zitadel/client/models/beta_action_service_execution_search_filter.rbs new file mode 100644 index 00000000..548e80d3 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_execution_search_filter.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaActionServiceExecutionSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader execution_type_filter: BetaActionServiceExecutionTypeFilter? + attr_reader in_conditions_filter: BetaActionServiceInConditionsFilter? + attr_reader target_filter: BetaActionServiceTargetFilter? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_execution_type.rbs b/sig/zitadel/client/models/beta_action_service_execution_type.rbs new file mode 100644 index 00000000..f083786f --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_execution_type.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaActionServiceExecutionType + EXECUTION_TYPE_UNSPECIFIED: String + EXECUTION_TYPE_REQUEST: String + EXECUTION_TYPE_RESPONSE: String + EXECUTION_TYPE_EVENT: String + EXECUTION_TYPE_FUNCTION: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_execution_type_filter.rbs b/sig/zitadel/client/models/beta_action_service_execution_type_filter.rbs new file mode 100644 index 00000000..a5c1f757 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_execution_type_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceExecutionTypeFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader execution_type: BetaActionServiceExecutionType? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_function_execution.rbs b/sig/zitadel/client/models/beta_action_service_function_execution.rbs new file mode 100644 index 00000000..98d43c7b --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_function_execution.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceFunctionExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_get_target_request.rbs b/sig/zitadel/client/models/beta_action_service_get_target_request.rbs new file mode 100644 index 00000000..01c4b5dc --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_get_target_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceGetTargetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_get_target_response.rbs b/sig/zitadel/client/models/beta_action_service_get_target_response.rbs new file mode 100644 index 00000000..211afe0f --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_get_target_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceGetTargetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target: BetaActionServiceTarget? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_in_conditions_filter.rbs b/sig/zitadel/client/models/beta_action_service_in_conditions_filter.rbs new file mode 100644 index 00000000..09087740 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_in_conditions_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceInConditionsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader conditions: Array[BetaActionServiceCondition]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_in_target_ids_filter.rbs b/sig/zitadel/client/models/beta_action_service_in_target_ids_filter.rbs new file mode 100644 index 00000000..b609ff66 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_in_target_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceInTargetIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_list_execution_functions_response.rbs b/sig/zitadel/client/models/beta_action_service_list_execution_functions_response.rbs new file mode 100644 index 00000000..ef6b7008 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_list_execution_functions_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceListExecutionFunctionsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader functions: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_list_execution_methods_response.rbs b/sig/zitadel/client/models/beta_action_service_list_execution_methods_response.rbs new file mode 100644 index 00000000..5e0060d1 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_list_execution_methods_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceListExecutionMethodsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader methods: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_list_execution_services_response.rbs b/sig/zitadel/client/models/beta_action_service_list_execution_services_response.rbs new file mode 100644 index 00000000..45c8d26d --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_list_execution_services_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceListExecutionServicesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader services: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_list_executions_request.rbs b/sig/zitadel/client/models/beta_action_service_list_executions_request.rbs new file mode 100644 index 00000000..c5f0ea04 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_list_executions_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaActionServiceListExecutionsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaActionServicePaginationRequest? + attr_reader sorting_column: BetaActionServiceExecutionFieldName? + attr_reader filters: Array[BetaActionServiceExecutionSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_list_executions_response.rbs b/sig/zitadel/client/models/beta_action_service_list_executions_response.rbs new file mode 100644 index 00000000..db24fa6f --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_list_executions_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaActionServiceListExecutionsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaActionServicePaginationResponse? + attr_reader executions: Array[BetaActionServiceExecution]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_list_targets_request.rbs b/sig/zitadel/client/models/beta_action_service_list_targets_request.rbs new file mode 100644 index 00000000..e65f75d4 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_list_targets_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaActionServiceListTargetsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaActionServicePaginationRequest? + attr_reader sorting_column: BetaActionServiceTargetFieldName? + attr_reader filters: Array[BetaActionServiceTargetSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_list_targets_response.rbs b/sig/zitadel/client/models/beta_action_service_list_targets_response.rbs new file mode 100644 index 00000000..bbd1fa1c --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_list_targets_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaActionServiceListTargetsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaActionServicePaginationResponse? + attr_reader targets: Array[BetaActionServiceTarget]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_pagination_request.rbs b/sig/zitadel/client/models/beta_action_service_pagination_request.rbs new file mode 100644 index 00000000..2a3d76f5 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaActionServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_pagination_response.rbs b/sig/zitadel/client/models/beta_action_service_pagination_response.rbs new file mode 100644 index 00000000..2d5d0405 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaActionServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_request_execution.rbs b/sig/zitadel/client/models/beta_action_service_request_execution.rbs new file mode 100644 index 00000000..5bd6ca00 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_request_execution.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaActionServiceRequestExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader all: bool? + attr_reader method: String? + attr_reader service: String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_response_execution.rbs b/sig/zitadel/client/models/beta_action_service_response_execution.rbs new file mode 100644 index 00000000..885651b5 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_response_execution.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaActionServiceResponseExecution < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader all: bool? + attr_reader method: String? + attr_reader service: String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_rest_call.rbs b/sig/zitadel/client/models/beta_action_service_rest_call.rbs new file mode 100644 index 00000000..37b107f6 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_rest_call.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceRESTCall < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader interrupt_on_error: bool? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_rest_webhook.rbs b/sig/zitadel/client/models/beta_action_service_rest_webhook.rbs new file mode 100644 index 00000000..8dd1c4ff --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_rest_webhook.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceRESTWebhook < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader interrupt_on_error: bool? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_set_execution_request.rbs b/sig/zitadel/client/models/beta_action_service_set_execution_request.rbs new file mode 100644 index 00000000..38aee898 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_set_execution_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaActionServiceSetExecutionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader condition: BetaActionServiceCondition? + attr_reader targets: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_set_execution_response.rbs b/sig/zitadel/client/models/beta_action_service_set_execution_response.rbs new file mode 100644 index 00000000..1c3aecaa --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_set_execution_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceSetExecutionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader set_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_target.rbs b/sig/zitadel/client/models/beta_action_service_target.rbs new file mode 100644 index 00000000..23f210f8 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_target.rbs @@ -0,0 +1,18 @@ +module Zitadel::Client::Models + class BetaActionServiceTarget < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader name: String? + attr_reader timeout: ISO8601::Duration? + attr_reader endpoint: String? + attr_reader signing_key: String? + attr_reader rest_async: untyped? + attr_reader rest_call: BetaActionServiceRESTCall? + attr_reader rest_webhook: BetaActionServiceRESTWebhook? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_target_field_name.rbs b/sig/zitadel/client/models/beta_action_service_target_field_name.rbs new file mode 100644 index 00000000..4a0b8538 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_target_field_name.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class BetaActionServiceTargetFieldName + TARGET_FIELD_NAME_UNSPECIFIED: String + TARGET_FIELD_NAME_ID: String + TARGET_FIELD_NAME_CREATED_DATE: String + TARGET_FIELD_NAME_CHANGED_DATE: String + TARGET_FIELD_NAME_NAME: String + TARGET_FIELD_NAME_TARGET_TYPE: String + TARGET_FIELD_NAME_URL: String + TARGET_FIELD_NAME_TIMEOUT: String + TARGET_FIELD_NAME_INTERRUPT_ON_ERROR: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_target_filter.rbs b/sig/zitadel/client/models/beta_action_service_target_filter.rbs new file mode 100644 index 00000000..82cc7c75 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_target_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaActionServiceTargetFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_target_name_filter.rbs b/sig/zitadel/client/models/beta_action_service_target_name_filter.rbs new file mode 100644 index 00000000..41a8992f --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_target_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaActionServiceTargetNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader target_name: String? + attr_reader method: BetaActionServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_target_search_filter.rbs b/sig/zitadel/client/models/beta_action_service_target_search_filter.rbs new file mode 100644 index 00000000..55790992 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_target_search_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaActionServiceTargetSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader in_target_ids_filter: BetaActionServiceInTargetIDsFilter? + attr_reader target_name_filter: BetaActionServiceTargetNameFilter? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_text_filter_method.rbs b/sig/zitadel/client/models/beta_action_service_text_filter_method.rbs new file mode 100644 index 00000000..6d45bc01 --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaActionServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_update_target_request.rbs b/sig/zitadel/client/models/beta_action_service_update_target_request.rbs new file mode 100644 index 00000000..b504b2aa --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_update_target_request.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class BetaActionServiceUpdateTargetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + attr_reader timeout: ISO8601::Duration? + attr_reader endpoint: String? + attr_reader expiration_signing_key: ISO8601::Duration? + attr_reader rest_async: untyped? + attr_reader rest_call: BetaActionServiceRESTCall? + attr_reader rest_webhook: BetaActionServiceRESTWebhook? + end +end diff --git a/sig/zitadel/client/models/beta_action_service_update_target_response.rbs b/sig/zitadel/client/models/beta_action_service_update_target_response.rbs new file mode 100644 index 00000000..7bd3281d --- /dev/null +++ b/sig/zitadel/client/models/beta_action_service_update_target_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaActionServiceUpdateTargetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + attr_reader signing_key: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_any.rbs b/sig/zitadel/client/models/beta_app_service_any.rbs new file mode 100644 index 00000000..da777e2a --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAppServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_api_auth_method_type.rbs b/sig/zitadel/client/models/beta_app_service_api_auth_method_type.rbs new file mode 100644 index 00000000..bb58bdba --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_api_auth_method_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceAPIAuthMethodType + API_AUTH_METHOD_TYPE_BASIC: String + API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_api_config.rbs b/sig/zitadel/client/models/beta_app_service_api_config.rbs new file mode 100644 index 00000000..4703c452 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_api_config.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceAPIConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader auth_method_type: BetaAppServiceAPIAuthMethodType? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_app_sorting.rbs b/sig/zitadel/client/models/beta_app_service_app_sorting.rbs new file mode 100644 index 00000000..0523d203 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_app_sorting.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAppServiceAppSorting + APP_SORT_BY_ID: String + APP_SORT_BY_NAME: String + APP_SORT_BY_STATE: String + APP_SORT_BY_CREATION_DATE: String + APP_SORT_BY_CHANGE_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_app_state.rbs b/sig/zitadel/client/models/beta_app_service_app_state.rbs new file mode 100644 index 00000000..6d6c3ae0 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_app_state.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServiceAppState + APP_STATE_UNSPECIFIED: String + APP_STATE_ACTIVE: String + APP_STATE_INACTIVE: String + APP_STATE_REMOVED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_application.rbs b/sig/zitadel/client/models/beta_app_service_application.rbs new file mode 100644 index 00000000..280be83b --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_application.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class BetaAppServiceApplication < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader state: BetaAppServiceAppState? + attr_reader name: String? + attr_reader api_config: BetaAppServiceAPIConfig? + attr_reader oidc_config: BetaAppServiceOIDCConfig? + attr_reader saml_config: BetaAppServiceSAMLConfig? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_application_key.rbs b/sig/zitadel/client/models/beta_app_service_application_key.rbs new file mode 100644 index 00000000..c79e9b43 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_application_key.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaAppServiceApplicationKey < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader application_id: String? + attr_reader project_id: String? + attr_reader creation_date: Time? + attr_reader organization_id: String? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_application_keys_sorting.rbs b/sig/zitadel/client/models/beta_app_service_application_keys_sorting.rbs new file mode 100644 index 00000000..9702a330 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_application_keys_sorting.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaAppServiceApplicationKeysSorting + APPLICATION_KEYS_SORT_BY_ID: String + APPLICATION_KEYS_SORT_BY_PROJECT_ID: String + APPLICATION_KEYS_SORT_BY_APPLICATION_ID: String + APPLICATION_KEYS_SORT_BY_CREATION_DATE: String + APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID: String + APPLICATION_KEYS_SORT_BY_EXPIRATION: String + APPLICATION_KEYS_SORT_BY_TYPE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_application_name_query.rbs b/sig/zitadel/client/models/beta_app_service_application_name_query.rbs new file mode 100644 index 00000000..516dd26b --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_application_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceApplicationNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader method: BetaAppServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_application_search_filter.rbs b/sig/zitadel/client/models/beta_app_service_application_search_filter.rbs new file mode 100644 index 00000000..2859c8ef --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_application_search_filter.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaAppServiceApplicationSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader api_app_only: bool? + attr_reader name_filter: BetaAppServiceApplicationNameQuery? + attr_reader oidc_app_only: bool? + attr_reader saml_app_only: bool? + attr_reader state_filter: BetaAppServiceAppState? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_connect_error.rbs b/sig/zitadel/client/models/beta_app_service_connect_error.rbs new file mode 100644 index 00000000..61e84980 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAppServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaAppServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_create_api_application_request.rbs b/sig/zitadel/client/models/beta_app_service_create_api_application_request.rbs new file mode 100644 index 00000000..d8c30e14 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_create_api_application_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceCreateAPIApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_method_type: BetaAppServiceAPIAuthMethodType? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_create_api_application_response.rbs b/sig/zitadel/client/models/beta_app_service_create_api_application_response.rbs new file mode 100644 index 00000000..129ee543 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_create_api_application_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceCreateAPIApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader client_secret: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_create_application_key_request.rbs b/sig/zitadel/client/models/beta_app_service_create_application_key_request.rbs new file mode 100644 index 00000000..5e426b0c --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_create_application_key_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServiceCreateApplicationKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader app_id: String? + attr_reader project_id: String? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_create_application_key_response.rbs b/sig/zitadel/client/models/beta_app_service_create_application_key_response.rbs new file mode 100644 index 00000000..cf081ef5 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_create_application_key_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServiceCreateApplicationKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader key_details: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_create_application_request.rbs b/sig/zitadel/client/models/beta_app_service_create_application_request.rbs new file mode 100644 index 00000000..60e10673 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_create_application_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaAppServiceCreateApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader id: String? + attr_reader name: String? + attr_reader api_request: BetaAppServiceCreateAPIApplicationRequest? + attr_reader oidc_request: BetaAppServiceCreateOIDCApplicationRequest? + attr_reader saml_request: BetaAppServiceCreateSAMLApplicationRequest? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_create_application_response.rbs b/sig/zitadel/client/models/beta_app_service_create_application_response.rbs new file mode 100644 index 00000000..39f61db1 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_create_application_response.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaAppServiceCreateApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader app_id: String? + attr_reader creation_date: Time? + attr_reader api_response: BetaAppServiceCreateAPIApplicationResponse? + attr_reader oidc_response: BetaAppServiceCreateOIDCApplicationResponse? + attr_reader saml_response: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_create_oidc_application_request.rbs b/sig/zitadel/client/models/beta_app_service_create_oidc_application_request.rbs new file mode 100644 index 00000000..09a6446a --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_create_oidc_application_request.rbs @@ -0,0 +1,25 @@ +module Zitadel::Client::Models + class BetaAppServiceCreateOIDCApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader redirect_uris: Array[String]? + attr_reader response_types: Array[BetaAppServiceOIDCResponseType]? + attr_reader grant_types: Array[BetaAppServiceOIDCGrantType]? + attr_reader app_type: BetaAppServiceOIDCAppType? + attr_reader auth_method_type: BetaAppServiceOIDCAuthMethodType? + attr_reader post_logout_redirect_uris: Array[String]? + attr_reader version: BetaAppServiceOIDCVersion? + attr_reader dev_mode: bool? + attr_reader access_token_type: BetaAppServiceOIDCTokenType? + attr_reader access_token_role_assertion: bool? + attr_reader id_token_role_assertion: bool? + attr_reader id_token_userinfo_assertion: bool? + attr_reader clock_skew: ISO8601::Duration? + attr_reader additional_origins: Array[String]? + attr_reader skip_native_app_success_page: bool? + attr_reader back_channel_logout_uri: String? + attr_reader login_version: BetaAppServiceLoginVersion? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_create_oidc_application_response.rbs b/sig/zitadel/client/models/beta_app_service_create_oidc_application_response.rbs new file mode 100644 index 00000000..b7f04cce --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_create_oidc_application_response.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAppServiceCreateOIDCApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader client_secret: String? + attr_reader none_compliant: bool? + attr_reader compliance_problems: Array[BetaAppServiceOIDCLocalizedMessage]? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_create_saml_application_request.rbs b/sig/zitadel/client/models/beta_app_service_create_saml_application_request.rbs new file mode 100644 index 00000000..ef4a12ab --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_create_saml_application_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServiceCreateSAMLApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_version: BetaAppServiceLoginVersion? + attr_reader metadata_url: String? + attr_reader metadata_xml: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_deactivate_application_request.rbs b/sig/zitadel/client/models/beta_app_service_deactivate_application_request.rbs new file mode 100644 index 00000000..0cdded09 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_deactivate_application_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceDeactivateApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_deactivate_application_response.rbs b/sig/zitadel/client/models/beta_app_service_deactivate_application_response.rbs new file mode 100644 index 00000000..b2946346 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_deactivate_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceDeactivateApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deactivation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_delete_application_key_request.rbs b/sig/zitadel/client/models/beta_app_service_delete_application_key_request.rbs new file mode 100644 index 00000000..2e45ea43 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_delete_application_key_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAppServiceDeleteApplicationKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader project_id: String? + attr_reader application_id: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_delete_application_key_response.rbs b/sig/zitadel/client/models/beta_app_service_delete_application_key_response.rbs new file mode 100644 index 00000000..97389489 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_delete_application_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceDeleteApplicationKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_delete_application_request.rbs b/sig/zitadel/client/models/beta_app_service_delete_application_request.rbs new file mode 100644 index 00000000..d6e0117b --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_delete_application_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceDeleteApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_delete_application_response.rbs b/sig/zitadel/client/models/beta_app_service_delete_application_response.rbs new file mode 100644 index 00000000..80a02e4c --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_delete_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceDeleteApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_get_application_key_request.rbs b/sig/zitadel/client/models/beta_app_service_get_application_key_request.rbs new file mode 100644 index 00000000..1d6b1f51 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_get_application_key_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAppServiceGetApplicationKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader project_id: String? + attr_reader application_id: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_get_application_key_response.rbs b/sig/zitadel/client/models/beta_app_service_get_application_key_response.rbs new file mode 100644 index 00000000..c166c6e1 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_get_application_key_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServiceGetApplicationKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_get_application_request.rbs b/sig/zitadel/client/models/beta_app_service_get_application_request.rbs new file mode 100644 index 00000000..bfca64d2 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_get_application_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceGetApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_get_application_response.rbs b/sig/zitadel/client/models/beta_app_service_get_application_response.rbs new file mode 100644 index 00000000..643f0927 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_get_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceGetApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader app: BetaAppServiceApplication? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_list_application_keys_request.rbs b/sig/zitadel/client/models/beta_app_service_list_application_keys_request.rbs new file mode 100644 index 00000000..ed36ee38 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_list_application_keys_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaAppServiceListApplicationKeysRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaAppServicePaginationRequest? + attr_reader sorting_column: BetaAppServiceApplicationKeysSorting? + attr_reader application_id: String? + attr_reader organization_id: String? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_list_application_keys_response.rbs b/sig/zitadel/client/models/beta_app_service_list_application_keys_response.rbs new file mode 100644 index 00000000..2238c8a1 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_list_application_keys_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceListApplicationKeysResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader keys: Array[BetaAppServiceApplicationKey]? + attr_reader pagination: BetaAppServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_list_applications_request.rbs b/sig/zitadel/client/models/beta_app_service_list_applications_request.rbs new file mode 100644 index 00000000..002d2a35 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_list_applications_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAppServiceListApplicationsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader pagination: BetaAppServicePaginationRequest? + attr_reader filters: Array[BetaAppServiceApplicationSearchFilter]? + attr_reader sorting_column: BetaAppServiceAppSorting? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_list_applications_response.rbs b/sig/zitadel/client/models/beta_app_service_list_applications_response.rbs new file mode 100644 index 00000000..4777e155 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_list_applications_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceListApplicationsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader applications: Array[BetaAppServiceApplication]? + attr_reader pagination: BetaAppServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_login_v2.rbs b/sig/zitadel/client/models/beta_app_service_login_v2.rbs new file mode 100644 index 00000000..0d79a41c --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_login_v2.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceLoginV2 < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader base_uri: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_login_version.rbs b/sig/zitadel/client/models/beta_app_service_login_version.rbs new file mode 100644 index 00000000..0786e6c4 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_login_version.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceLoginVersion < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_v1: untyped? + attr_reader login_v2: BetaAppServiceLoginV2? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_oidc_app_type.rbs b/sig/zitadel/client/models/beta_app_service_oidc_app_type.rbs new file mode 100644 index 00000000..02d50dd4 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_oidc_app_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceOIDCAppType + OIDC_APP_TYPE_WEB: String + OIDC_APP_TYPE_USER_AGENT: String + OIDC_APP_TYPE_NATIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_oidc_auth_method_type.rbs b/sig/zitadel/client/models/beta_app_service_oidc_auth_method_type.rbs new file mode 100644 index 00000000..6078288d --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_oidc_auth_method_type.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServiceOIDCAuthMethodType + OIDC_AUTH_METHOD_TYPE_BASIC: String + OIDC_AUTH_METHOD_TYPE_POST: String + OIDC_AUTH_METHOD_TYPE_NONE: String + OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_oidc_config.rbs b/sig/zitadel/client/models/beta_app_service_oidc_config.rbs new file mode 100644 index 00000000..ce4f9af0 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_oidc_config.rbs @@ -0,0 +1,29 @@ +module Zitadel::Client::Models + class BetaAppServiceOIDCConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader redirect_uris: Array[String]? + attr_reader response_types: Array[BetaAppServiceOIDCResponseType]? + attr_reader grant_types: Array[BetaAppServiceOIDCGrantType]? + attr_reader app_type: BetaAppServiceOIDCAppType? + attr_reader client_id: String? + attr_reader auth_method_type: BetaAppServiceOIDCAuthMethodType? + attr_reader post_logout_redirect_uris: Array[String]? + attr_reader version: BetaAppServiceOIDCVersion? + attr_reader none_compliant: bool? + attr_reader compliance_problems: Array[BetaAppServiceOIDCLocalizedMessage]? + attr_reader dev_mode: bool? + attr_reader access_token_type: BetaAppServiceOIDCTokenType? + attr_reader access_token_role_assertion: bool? + attr_reader id_token_role_assertion: bool? + attr_reader id_token_userinfo_assertion: bool? + attr_reader clock_skew: ISO8601::Duration? + attr_reader additional_origins: Array[String]? + attr_reader allowed_origins: Array[String]? + attr_reader skip_native_app_success_page: bool? + attr_reader back_channel_logout_uri: String? + attr_reader login_version: BetaAppServiceLoginVersion? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_oidc_grant_type.rbs b/sig/zitadel/client/models/beta_app_service_oidc_grant_type.rbs new file mode 100644 index 00000000..500a0a7b --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_oidc_grant_type.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAppServiceOIDCGrantType + OIDC_GRANT_TYPE_AUTHORIZATION_CODE: String + OIDC_GRANT_TYPE_IMPLICIT: String + OIDC_GRANT_TYPE_REFRESH_TOKEN: String + OIDC_GRANT_TYPE_DEVICE_CODE: String + OIDC_GRANT_TYPE_TOKEN_EXCHANGE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_oidc_localized_message.rbs b/sig/zitadel/client/models/beta_app_service_oidc_localized_message.rbs new file mode 100644 index 00000000..938d657b --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_oidc_localized_message.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceOIDCLocalizedMessage < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader localized_message: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_oidc_response_type.rbs b/sig/zitadel/client/models/beta_app_service_oidc_response_type.rbs new file mode 100644 index 00000000..880ec34a --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_oidc_response_type.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServiceOIDCResponseType + OIDC_RESPONSE_TYPE_UNSPECIFIED: String + OIDC_RESPONSE_TYPE_CODE: String + OIDC_RESPONSE_TYPE_ID_TOKEN: String + OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_oidc_token_type.rbs b/sig/zitadel/client/models/beta_app_service_oidc_token_type.rbs new file mode 100644 index 00000000..53007044 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_oidc_token_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceOIDCTokenType + OIDC_TOKEN_TYPE_BEARER: String + OIDC_TOKEN_TYPE_JWT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_oidc_version.rbs b/sig/zitadel/client/models/beta_app_service_oidc_version.rbs new file mode 100644 index 00000000..edff70e1 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_oidc_version.rbs @@ -0,0 +1,8 @@ +module Zitadel::Client::Models + class BetaAppServiceOIDCVersion + OIDC_VERSION_1_0: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_pagination_request.rbs b/sig/zitadel/client/models/beta_app_service_pagination_request.rbs new file mode 100644 index 00000000..b2b59116 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_pagination_response.rbs b/sig/zitadel/client/models/beta_app_service_pagination_response.rbs new file mode 100644 index 00000000..f96ed0a1 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_reactivate_application_request.rbs b/sig/zitadel/client/models/beta_app_service_reactivate_application_request.rbs new file mode 100644 index 00000000..688cd7b3 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_reactivate_application_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceReactivateApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_reactivate_application_response.rbs b/sig/zitadel/client/models/beta_app_service_reactivate_application_response.rbs new file mode 100644 index 00000000..b8c5c614 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_reactivate_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceReactivateApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader reactivation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_regenerate_client_secret_request.rbs b/sig/zitadel/client/models/beta_app_service_regenerate_client_secret_request.rbs new file mode 100644 index 00000000..92ca3e31 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_regenerate_client_secret_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAppServiceRegenerateClientSecretRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader application_id: String? + attr_reader is_api: bool? + attr_reader is_oidc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_regenerate_client_secret_response.rbs b/sig/zitadel/client/models/beta_app_service_regenerate_client_secret_response.rbs new file mode 100644 index 00000000..2ab98a6f --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_regenerate_client_secret_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAppServiceRegenerateClientSecretResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_secret: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_saml_config.rbs b/sig/zitadel/client/models/beta_app_service_saml_config.rbs new file mode 100644 index 00000000..8269f832 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_saml_config.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServiceSAMLConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_version: BetaAppServiceLoginVersion? + attr_reader metadata_url: String? + attr_reader metadata_xml: String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_text_filter_method.rbs b/sig/zitadel/client/models/beta_app_service_text_filter_method.rbs new file mode 100644 index 00000000..1ab95d79 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaAppServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_update_api_application_configuration_request.rbs b/sig/zitadel/client/models/beta_app_service_update_api_application_configuration_request.rbs new file mode 100644 index 00000000..d03f3743 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_update_api_application_configuration_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceUpdateAPIApplicationConfigurationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_method_type: BetaAppServiceAPIAuthMethodType? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_update_application_request.rbs b/sig/zitadel/client/models/beta_app_service_update_application_request.rbs new file mode 100644 index 00000000..f89b296a --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_update_application_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaAppServiceUpdateApplicationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader id: String? + attr_reader name: String? + attr_reader api_configuration_request: BetaAppServiceUpdateAPIApplicationConfigurationRequest? + attr_reader oidc_configuration_request: BetaAppServiceUpdateOIDCApplicationConfigurationRequest? + attr_reader saml_configuration_request: BetaAppServiceUpdateSAMLApplicationConfigurationRequest? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_update_application_response.rbs b/sig/zitadel/client/models/beta_app_service_update_application_response.rbs new file mode 100644 index 00000000..b49f5000 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_update_application_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAppServiceUpdateApplicationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_update_oidc_application_configuration_request.rbs b/sig/zitadel/client/models/beta_app_service_update_oidc_application_configuration_request.rbs new file mode 100644 index 00000000..23723aab --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_update_oidc_application_configuration_request.rbs @@ -0,0 +1,25 @@ +module Zitadel::Client::Models + class BetaAppServiceUpdateOIDCApplicationConfigurationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader redirect_uris: Array[String]? + attr_reader response_types: Array[BetaAppServiceOIDCResponseType]? + attr_reader grant_types: Array[BetaAppServiceOIDCGrantType]? + attr_reader app_type: BetaAppServiceOIDCAppType? + attr_reader auth_method_type: BetaAppServiceOIDCAuthMethodType? + attr_reader post_logout_redirect_uris: Array[String]? + attr_reader version: BetaAppServiceOIDCVersion? + attr_reader dev_mode: bool? + attr_reader access_token_type: BetaAppServiceOIDCTokenType? + attr_reader access_token_role_assertion: bool? + attr_reader id_token_role_assertion: bool? + attr_reader id_token_userinfo_assertion: bool? + attr_reader clock_skew: ISO8601::Duration? + attr_reader additional_origins: Array[String]? + attr_reader skip_native_app_success_page: bool? + attr_reader back_channel_logout_uri: String? + attr_reader login_version: BetaAppServiceLoginVersion? + end +end diff --git a/sig/zitadel/client/models/beta_app_service_update_saml_application_configuration_request.rbs b/sig/zitadel/client/models/beta_app_service_update_saml_application_configuration_request.rbs new file mode 100644 index 00000000..4850efb6 --- /dev/null +++ b/sig/zitadel/client/models/beta_app_service_update_saml_application_configuration_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAppServiceUpdateSAMLApplicationConfigurationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_version: BetaAppServiceLoginVersion? + attr_reader metadata_url: String? + attr_reader metadata_xml: String? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_activate_authorization_request.rbs b/sig/zitadel/client/models/beta_authorization_service_activate_authorization_request.rbs new file mode 100644 index 00000000..02f45832 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_activate_authorization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceActivateAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_activate_authorization_response.rbs b/sig/zitadel/client/models/beta_authorization_service_activate_authorization_response.rbs new file mode 100644 index 00000000..ff25d35d --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_activate_authorization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceActivateAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_any.rbs b/sig/zitadel/client/models/beta_authorization_service_any.rbs new file mode 100644 index 00000000..36cca40a --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_authorization.rbs b/sig/zitadel/client/models/beta_authorization_service_authorization.rbs new file mode 100644 index 00000000..e8c22098 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_authorization.rbs @@ -0,0 +1,20 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceAuthorization < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader project_id: String? + attr_reader project_name: String? + attr_reader project_organization_id: String? + attr_reader project_grant_id: String? + attr_reader granted_organization_id: String? + attr_reader organization_id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader state: BetaAuthorizationServiceState? + attr_reader user: BetaAuthorizationServiceUser? + attr_reader roles: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_authorization_field_name.rbs b/sig/zitadel/client/models/beta_authorization_service_authorization_field_name.rbs new file mode 100644 index 00000000..92aac794 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_authorization_field_name.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceAuthorizationFieldName + AUTHORIZATION_FIELD_NAME_UNSPECIFIED: String + AUTHORIZATION_FIELD_NAME_CREATED_DATE: String + AUTHORIZATION_FIELD_NAME_CHANGED_DATE: String + AUTHORIZATION_FIELD_NAME_ID: String + AUTHORIZATION_FIELD_NAME_USER_ID: String + AUTHORIZATION_FIELD_NAME_PROJECT_ID: String + AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID: String + AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_authorizations_search_filter.rbs b/sig/zitadel/client/models/beta_authorization_service_authorizations_search_filter.rbs new file mode 100644 index 00000000..f0534f78 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_authorizations_search_filter.rbs @@ -0,0 +1,20 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceAuthorizationsSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader authorization_ids: BetaAuthorizationServiceInIDsFilter? + attr_reader in_user_ids: BetaAuthorizationServiceInIDsFilter? + attr_reader organization_id: BetaAuthorizationServiceIDFilter? + attr_reader project_grant_id: BetaAuthorizationServiceIDFilter? + attr_reader project_id: BetaAuthorizationServiceIDFilter? + attr_reader project_name: BetaAuthorizationServiceProjectNameQuery? + attr_reader role_key: BetaAuthorizationServiceRoleKeyQuery? + attr_reader state: BetaAuthorizationServiceStateQuery? + attr_reader user_display_name: BetaAuthorizationServiceUserDisplayNameQuery? + attr_reader user_id: BetaAuthorizationServiceIDFilter? + attr_reader user_organization_id: BetaAuthorizationServiceIDFilter? + attr_reader user_preferred_login_name: BetaAuthorizationServiceUserPreferredLoginNameQuery? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_connect_error.rbs b/sig/zitadel/client/models/beta_authorization_service_connect_error.rbs new file mode 100644 index 00000000..96081c3c --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaAuthorizationServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_create_authorization_request.rbs b/sig/zitadel/client/models/beta_authorization_service_create_authorization_request.rbs new file mode 100644 index 00000000..18b5d69b --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_create_authorization_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceCreateAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader project_id: String? + attr_reader organization_id: String? + attr_reader role_keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_create_authorization_response.rbs b/sig/zitadel/client/models/beta_authorization_service_create_authorization_response.rbs new file mode 100644 index 00000000..f08d68d3 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_create_authorization_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceCreateAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_deactivate_authorization_request.rbs b/sig/zitadel/client/models/beta_authorization_service_deactivate_authorization_request.rbs new file mode 100644 index 00000000..18f8a0bf --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_deactivate_authorization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceDeactivateAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_deactivate_authorization_response.rbs b/sig/zitadel/client/models/beta_authorization_service_deactivate_authorization_response.rbs new file mode 100644 index 00000000..e1f5e379 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_deactivate_authorization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceDeactivateAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_delete_authorization_request.rbs b/sig/zitadel/client/models/beta_authorization_service_delete_authorization_request.rbs new file mode 100644 index 00000000..1c5c9c45 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_delete_authorization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceDeleteAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_delete_authorization_response.rbs b/sig/zitadel/client/models/beta_authorization_service_delete_authorization_response.rbs new file mode 100644 index 00000000..563dacd3 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_delete_authorization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceDeleteAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_id_filter.rbs b/sig/zitadel/client/models/beta_authorization_service_id_filter.rbs new file mode 100644 index 00000000..e1c42f66 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_in_ids_filter.rbs b/sig/zitadel/client/models/beta_authorization_service_in_ids_filter.rbs new file mode 100644 index 00000000..b907e512 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_in_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceInIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_list_authorizations_request.rbs b/sig/zitadel/client/models/beta_authorization_service_list_authorizations_request.rbs new file mode 100644 index 00000000..b2046e82 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_list_authorizations_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceListAuthorizationsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaAuthorizationServicePaginationRequest? + attr_reader sorting_column: BetaAuthorizationServiceAuthorizationFieldName? + attr_reader filters: Array[BetaAuthorizationServiceAuthorizationsSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_list_authorizations_response.rbs b/sig/zitadel/client/models/beta_authorization_service_list_authorizations_response.rbs new file mode 100644 index 00000000..51ace745 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_list_authorizations_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceListAuthorizationsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaAuthorizationServicePaginationResponse? + attr_reader authorizations: Array[BetaAuthorizationServiceAuthorization]? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_pagination_request.rbs b/sig/zitadel/client/models/beta_authorization_service_pagination_request.rbs new file mode 100644 index 00000000..38bcbbd8 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaAuthorizationServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_pagination_response.rbs b/sig/zitadel/client/models/beta_authorization_service_pagination_response.rbs new file mode 100644 index 00000000..b21141d4 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAuthorizationServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_project_name_query.rbs b/sig/zitadel/client/models/beta_authorization_service_project_name_query.rbs new file mode 100644 index 00000000..d89333cc --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_project_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceProjectNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader method: BetaAuthorizationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_role_key_query.rbs b/sig/zitadel/client/models/beta_authorization_service_role_key_query.rbs new file mode 100644 index 00000000..a0e04755 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_role_key_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceRoleKeyQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader method: BetaAuthorizationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_state.rbs b/sig/zitadel/client/models/beta_authorization_service_state.rbs new file mode 100644 index 00000000..4d0b66ba --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_state.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceState + STATE_UNSPECIFIED: String + STATE_ACTIVE: String + STATE_INACTIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_state_query.rbs b/sig/zitadel/client/models/beta_authorization_service_state_query.rbs new file mode 100644 index 00000000..84419abd --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_state_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceStateQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader state: BetaAuthorizationServiceState? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_text_filter_method.rbs b/sig/zitadel/client/models/beta_authorization_service_text_filter_method.rbs new file mode 100644 index 00000000..8d0dc282 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_update_authorization_request.rbs b/sig/zitadel/client/models/beta_authorization_service_update_authorization_request.rbs new file mode 100644 index 00000000..ba94a7cf --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_update_authorization_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceUpdateAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader role_keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_update_authorization_response.rbs b/sig/zitadel/client/models/beta_authorization_service_update_authorization_response.rbs new file mode 100644 index 00000000..bdf8cdcd --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_update_authorization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceUpdateAuthorizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_user.rbs b/sig/zitadel/client/models/beta_authorization_service_user.rbs new file mode 100644 index 00000000..c69110f1 --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_user.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader preferred_login_name: String? + attr_reader display_name: String? + attr_reader avatar_url: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_user_display_name_query.rbs b/sig/zitadel/client/models/beta_authorization_service_user_display_name_query.rbs new file mode 100644 index 00000000..b278291c --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_user_display_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceUserDisplayNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name: String? + attr_reader method: BetaAuthorizationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_authorization_service_user_preferred_login_name_query.rbs b/sig/zitadel/client/models/beta_authorization_service_user_preferred_login_name_query.rbs new file mode 100644 index 00000000..f901680c --- /dev/null +++ b/sig/zitadel/client/models/beta_authorization_service_user_preferred_login_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaAuthorizationServiceUserPreferredLoginNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_name: String? + attr_reader method: BetaAuthorizationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_any.rbs b/sig/zitadel/client/models/beta_feature_service_any.rbs new file mode 100644 index 00000000..44f1d9d9 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaFeatureServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_connect_error.rbs b/sig/zitadel/client/models/beta_feature_service_connect_error.rbs new file mode 100644 index 00000000..a3630562 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaFeatureServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaFeatureServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_details.rbs b/sig/zitadel/client/models/beta_feature_service_details.rbs new file mode 100644 index 00000000..54624767 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaFeatureServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_feature_flag.rbs b/sig/zitadel/client/models/beta_feature_service_feature_flag.rbs new file mode 100644 index 00000000..c9f6d98c --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_feature_flag.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaFeatureServiceFeatureFlag < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader enabled: bool? + attr_reader source: BetaFeatureServiceSource? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_get_instance_features_request.rbs b/sig/zitadel/client/models/beta_feature_service_get_instance_features_request.rbs new file mode 100644 index 00000000..d9281e6f --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_get_instance_features_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceGetInstanceFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader inheritance: bool? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_get_instance_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_get_instance_features_response.rbs new file mode 100644 index 00000000..5fe970b1 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_get_instance_features_response.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaFeatureServiceGetInstanceFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + attr_reader login_default_org: BetaFeatureServiceFeatureFlag? + attr_reader user_schema: BetaFeatureServiceFeatureFlag? + attr_reader oidc_token_exchange: BetaFeatureServiceFeatureFlag? + attr_reader improved_performance: BetaFeatureServiceImprovedPerformanceFeatureFlag? + attr_reader debug_oidc_parent_error: BetaFeatureServiceFeatureFlag? + attr_reader oidc_single_v1_session_termination: BetaFeatureServiceFeatureFlag? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_get_organization_features_request.rbs b/sig/zitadel/client/models/beta_feature_service_get_organization_features_request.rbs new file mode 100644 index 00000000..799558ea --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_get_organization_features_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaFeatureServiceGetOrganizationFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader inheritance: bool? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_get_organization_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_get_organization_features_response.rbs new file mode 100644 index 00000000..cbf7a7ef --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_get_organization_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceGetOrganizationFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_get_system_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_get_system_features_response.rbs new file mode 100644 index 00000000..044195ff --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_get_system_features_response.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaFeatureServiceGetSystemFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + attr_reader login_default_org: BetaFeatureServiceFeatureFlag? + attr_reader user_schema: BetaFeatureServiceFeatureFlag? + attr_reader oidc_token_exchange: BetaFeatureServiceFeatureFlag? + attr_reader improved_performance: BetaFeatureServiceImprovedPerformanceFeatureFlag? + attr_reader oidc_single_v1_session_termination: BetaFeatureServiceFeatureFlag? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_get_user_features_request.rbs b/sig/zitadel/client/models/beta_feature_service_get_user_features_request.rbs new file mode 100644 index 00000000..a734f3df --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_get_user_features_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaFeatureServiceGetUserFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader inheritance: bool? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_get_user_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_get_user_features_response.rbs new file mode 100644 index 00000000..48289524 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_get_user_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceGetUserFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_improved_performance.rbs b/sig/zitadel/client/models/beta_feature_service_improved_performance.rbs new file mode 100644 index 00000000..1c501dc8 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_improved_performance.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaFeatureServiceImprovedPerformance + IMPROVED_PERFORMANCE_UNSPECIFIED: String + IMPROVED_PERFORMANCE_PROJECT_GRANT: String + IMPROVED_PERFORMANCE_PROJECT: String + IMPROVED_PERFORMANCE_USER_GRANT: String + IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rbs b/sig/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rbs new file mode 100644 index 00000000..da5b1b73 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_improved_performance_feature_flag.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaFeatureServiceImprovedPerformanceFeatureFlag < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader execution_paths: Array[BetaFeatureServiceImprovedPerformance]? + attr_reader source: BetaFeatureServiceSource? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_reset_instance_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_reset_instance_features_response.rbs new file mode 100644 index 00000000..ed8cadd1 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_reset_instance_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceResetInstanceFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_reset_organization_features_request.rbs b/sig/zitadel/client/models/beta_feature_service_reset_organization_features_request.rbs new file mode 100644 index 00000000..2f9a37b2 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_reset_organization_features_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceResetOrganizationFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_reset_organization_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_reset_organization_features_response.rbs new file mode 100644 index 00000000..f96a4d24 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_reset_organization_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceResetOrganizationFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_reset_system_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_reset_system_features_response.rbs new file mode 100644 index 00000000..1c53db54 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_reset_system_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceResetSystemFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_reset_user_features_request.rbs b/sig/zitadel/client/models/beta_feature_service_reset_user_features_request.rbs new file mode 100644 index 00000000..89a2cf2c --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_reset_user_features_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceResetUserFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_reset_user_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_reset_user_features_response.rbs new file mode 100644 index 00000000..82523e35 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_reset_user_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceResetUserFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_set_instance_features_request.rbs b/sig/zitadel/client/models/beta_feature_service_set_instance_features_request.rbs new file mode 100644 index 00000000..cc1e1c9e --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_set_instance_features_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaFeatureServiceSetInstanceFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_default_org: bool? + attr_reader user_schema: bool? + attr_reader oidc_token_exchange: bool? + attr_reader improved_performance: Array[BetaFeatureServiceImprovedPerformance]? + attr_reader debug_oidc_parent_error: bool? + attr_reader oidc_single_v1_session_termination: bool? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_set_instance_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_set_instance_features_response.rbs new file mode 100644 index 00000000..98cce714 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_set_instance_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceSetInstanceFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_set_organization_features_request.rbs b/sig/zitadel/client/models/beta_feature_service_set_organization_features_request.rbs new file mode 100644 index 00000000..785d6a84 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_set_organization_features_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceSetOrganizationFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_set_organization_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_set_organization_features_response.rbs new file mode 100644 index 00000000..00091376 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_set_organization_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceSetOrganizationFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_set_system_features_request.rbs b/sig/zitadel/client/models/beta_feature_service_set_system_features_request.rbs new file mode 100644 index 00000000..0e097d28 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_set_system_features_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaFeatureServiceSetSystemFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_default_org: bool? + attr_reader user_schema: bool? + attr_reader oidc_token_exchange: bool? + attr_reader improved_performance: Array[BetaFeatureServiceImprovedPerformance]? + attr_reader oidc_single_v1_session_termination: bool? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_set_system_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_set_system_features_response.rbs new file mode 100644 index 00000000..94ae91da --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_set_system_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceSetSystemFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_set_user_feature_request.rbs b/sig/zitadel/client/models/beta_feature_service_set_user_feature_request.rbs new file mode 100644 index 00000000..95640f65 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_set_user_feature_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceSetUserFeatureRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_set_user_features_response.rbs b/sig/zitadel/client/models/beta_feature_service_set_user_features_response.rbs new file mode 100644 index 00000000..4c313ba7 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_set_user_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaFeatureServiceSetUserFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaFeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_feature_service_source.rbs b/sig/zitadel/client/models/beta_feature_service_source.rbs new file mode 100644 index 00000000..5150c799 --- /dev/null +++ b/sig/zitadel/client/models/beta_feature_service_source.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaFeatureServiceSource + SOURCE_UNSPECIFIED: String + SOURCE_SYSTEM: String + SOURCE_INSTANCE: String + SOURCE_ORGANIZATION: String + SOURCE_PROJECT: String + SOURCE_APP: String + SOURCE_USER: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_add_custom_domain_request.rbs b/sig/zitadel/client/models/beta_instance_service_add_custom_domain_request.rbs new file mode 100644 index 00000000..ae1b765c --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_add_custom_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceAddCustomDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_add_custom_domain_response.rbs b/sig/zitadel/client/models/beta_instance_service_add_custom_domain_response.rbs new file mode 100644 index 00000000..8c2ca274 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_add_custom_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceAddCustomDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_add_trusted_domain_request.rbs b/sig/zitadel/client/models/beta_instance_service_add_trusted_domain_request.rbs new file mode 100644 index 00000000..e15b8d19 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_add_trusted_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceAddTrustedDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_add_trusted_domain_response.rbs b/sig/zitadel/client/models/beta_instance_service_add_trusted_domain_response.rbs new file mode 100644 index 00000000..6fe7cee5 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_add_trusted_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceAddTrustedDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_any.rbs b/sig/zitadel/client/models/beta_instance_service_any.rbs new file mode 100644 index 00000000..58a36b24 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInstanceServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_connect_error.rbs b/sig/zitadel/client/models/beta_instance_service_connect_error.rbs new file mode 100644 index 00000000..642ba8c8 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInstanceServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaInstanceServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_delete_instance_request.rbs b/sig/zitadel/client/models/beta_instance_service_delete_instance_request.rbs new file mode 100644 index 00000000..6e51a72f --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_delete_instance_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceDeleteInstanceRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_delete_instance_response.rbs b/sig/zitadel/client/models/beta_instance_service_delete_instance_response.rbs new file mode 100644 index 00000000..7fe4a708 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_delete_instance_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceDeleteInstanceResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_domain.rbs b/sig/zitadel/client/models/beta_instance_service_domain.rbs new file mode 100644 index 00000000..4be5cf53 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_domain.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaInstanceServiceDomain < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader creation_date: Time? + attr_reader domain: String? + attr_reader primary: bool? + attr_reader generated: bool? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_domain_field_name.rbs b/sig/zitadel/client/models/beta_instance_service_domain_field_name.rbs new file mode 100644 index 00000000..8dfe50ed --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_domain_field_name.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInstanceServiceDomainFieldName + DOMAIN_FIELD_NAME_UNSPECIFIED: String + DOMAIN_FIELD_NAME_DOMAIN: String + DOMAIN_FIELD_NAME_PRIMARY: String + DOMAIN_FIELD_NAME_GENERATED: String + DOMAIN_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_domain_generated_query.rbs b/sig/zitadel/client/models/beta_instance_service_domain_generated_query.rbs new file mode 100644 index 00000000..0779439a --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_domain_generated_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceDomainGeneratedQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader generated: bool? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_domain_primary_query.rbs b/sig/zitadel/client/models/beta_instance_service_domain_primary_query.rbs new file mode 100644 index 00000000..275c18e8 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_domain_primary_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceDomainPrimaryQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader primary: bool? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_domain_query.rbs b/sig/zitadel/client/models/beta_instance_service_domain_query.rbs new file mode 100644 index 00000000..975b09f0 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_domain_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceDomainQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain: String? + attr_reader method: BetaInstanceServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_domain_search_query.rbs b/sig/zitadel/client/models/beta_instance_service_domain_search_query.rbs new file mode 100644 index 00000000..1335c0b4 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_domain_search_query.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInstanceServiceDomainSearchQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain_query: BetaInstanceServiceDomainQuery? + attr_reader generated_query: BetaInstanceServiceDomainGeneratedQuery? + attr_reader primary_query: BetaInstanceServiceDomainPrimaryQuery? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_domains_query.rbs b/sig/zitadel/client/models/beta_instance_service_domains_query.rbs new file mode 100644 index 00000000..a785d86e --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_domains_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceDomainsQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domains: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_field_name.rbs b/sig/zitadel/client/models/beta_instance_service_field_name.rbs new file mode 100644 index 00000000..d0ea9387 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInstanceServiceFieldName + FIELD_NAME_UNSPECIFIED: String + FIELD_NAME_ID: String + FIELD_NAME_NAME: String + FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_get_instance_request.rbs b/sig/zitadel/client/models/beta_instance_service_get_instance_request.rbs new file mode 100644 index 00000000..2bc97bfb --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_get_instance_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceGetInstanceRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_get_instance_response.rbs b/sig/zitadel/client/models/beta_instance_service_get_instance_response.rbs new file mode 100644 index 00000000..9d6c5e9b --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_get_instance_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceGetInstanceResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance: BetaInstanceServiceInstance? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_ids_query.rbs b/sig/zitadel/client/models/beta_instance_service_ids_query.rbs new file mode 100644 index 00000000..6b31467e --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_ids_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceIdsQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_instance.rbs b/sig/zitadel/client/models/beta_instance_service_instance.rbs new file mode 100644 index 00000000..359683a6 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_instance.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaInstanceServiceInstance < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader change_date: Time? + attr_reader creation_date: Time? + attr_reader state: BetaInstanceServiceState? + attr_reader name: String? + attr_reader version: String? + attr_reader domains: Array[BetaInstanceServiceDomain]? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_list_custom_domains_request.rbs b/sig/zitadel/client/models/beta_instance_service_list_custom_domains_request.rbs new file mode 100644 index 00000000..2c483375 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_list_custom_domains_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInstanceServiceListCustomDomainsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader pagination: BetaInstanceServicePaginationRequest? + attr_reader sorting_column: BetaInstanceServiceDomainFieldName? + attr_reader queries: Array[BetaInstanceServiceDomainSearchQuery]? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_list_custom_domains_response.rbs b/sig/zitadel/client/models/beta_instance_service_list_custom_domains_response.rbs new file mode 100644 index 00000000..0fe46c7c --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_list_custom_domains_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceListCustomDomainsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domains: Array[BetaInstanceServiceDomain]? + attr_reader pagination: BetaInstanceServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_list_instances_request.rbs b/sig/zitadel/client/models/beta_instance_service_list_instances_request.rbs new file mode 100644 index 00000000..5855a18c --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_list_instances_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInstanceServiceListInstancesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader queries: Array[BetaInstanceServiceQuery]? + attr_reader pagination: BetaInstanceServicePaginationRequest? + attr_reader sorting_column: BetaInstanceServiceFieldName? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_list_instances_response.rbs b/sig/zitadel/client/models/beta_instance_service_list_instances_response.rbs new file mode 100644 index 00000000..e3380305 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_list_instances_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceListInstancesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instances: Array[BetaInstanceServiceInstance]? + attr_reader pagination: BetaInstanceServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_list_trusted_domains_request.rbs b/sig/zitadel/client/models/beta_instance_service_list_trusted_domains_request.rbs new file mode 100644 index 00000000..077024e2 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_list_trusted_domains_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInstanceServiceListTrustedDomainsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader pagination: BetaInstanceServicePaginationRequest? + attr_reader sorting_column: BetaInstanceServiceTrustedDomainFieldName? + attr_reader queries: Array[BetaInstanceServiceTrustedDomainSearchQuery]? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_list_trusted_domains_response.rbs b/sig/zitadel/client/models/beta_instance_service_list_trusted_domains_response.rbs new file mode 100644 index 00000000..48c4dd8b --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_list_trusted_domains_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceListTrustedDomainsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader trusted_domain: Array[BetaInstanceServiceTrustedDomain]? + attr_reader pagination: BetaInstanceServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_pagination_request.rbs b/sig/zitadel/client/models/beta_instance_service_pagination_request.rbs new file mode 100644 index 00000000..3f8735f9 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInstanceServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_pagination_response.rbs b/sig/zitadel/client/models/beta_instance_service_pagination_response.rbs new file mode 100644 index 00000000..a62a61bf --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_query.rbs b/sig/zitadel/client/models/beta_instance_service_query.rbs new file mode 100644 index 00000000..9bb3eee9 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain_query: BetaInstanceServiceDomainsQuery? + attr_reader id_query: BetaInstanceServiceIdsQuery? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_remove_custom_domain_request.rbs b/sig/zitadel/client/models/beta_instance_service_remove_custom_domain_request.rbs new file mode 100644 index 00000000..f5770186 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_remove_custom_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceRemoveCustomDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_remove_custom_domain_response.rbs b/sig/zitadel/client/models/beta_instance_service_remove_custom_domain_response.rbs new file mode 100644 index 00000000..c5ef2d31 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_remove_custom_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceRemoveCustomDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_remove_trusted_domain_request.rbs b/sig/zitadel/client/models/beta_instance_service_remove_trusted_domain_request.rbs new file mode 100644 index 00000000..61894949 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_remove_trusted_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceRemoveTrustedDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_remove_trusted_domain_response.rbs b/sig/zitadel/client/models/beta_instance_service_remove_trusted_domain_response.rbs new file mode 100644 index 00000000..3141e679 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_remove_trusted_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceRemoveTrustedDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_state.rbs b/sig/zitadel/client/models/beta_instance_service_state.rbs new file mode 100644 index 00000000..b687c641 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_state.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInstanceServiceState + STATE_UNSPECIFIED: String + STATE_CREATING: String + STATE_RUNNING: String + STATE_STOPPING: String + STATE_STOPPED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_text_query_method.rbs b/sig/zitadel/client/models/beta_instance_service_text_query_method.rbs new file mode 100644 index 00000000..88209fd2 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_text_query_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaInstanceServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS: String + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE: String + TEXT_QUERY_METHOD_STARTS_WITH: String + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_QUERY_METHOD_CONTAINS: String + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_QUERY_METHOD_ENDS_WITH: String + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_trusted_domain.rbs b/sig/zitadel/client/models/beta_instance_service_trusted_domain.rbs new file mode 100644 index 00000000..d09ec019 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_trusted_domain.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInstanceServiceTrustedDomain < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader creation_date: Time? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_trusted_domain_field_name.rbs b/sig/zitadel/client/models/beta_instance_service_trusted_domain_field_name.rbs new file mode 100644 index 00000000..be7f5f89 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_trusted_domain_field_name.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceTrustedDomainFieldName + TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED: String + TRUSTED_DOMAIN_FIELD_NAME_DOMAIN: String + TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_trusted_domain_search_query.rbs b/sig/zitadel/client/models/beta_instance_service_trusted_domain_search_query.rbs new file mode 100644 index 00000000..698fce89 --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_trusted_domain_search_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceTrustedDomainSearchQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain_query: BetaInstanceServiceDomainQuery? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_update_instance_request.rbs b/sig/zitadel/client/models/beta_instance_service_update_instance_request.rbs new file mode 100644 index 00000000..011341ef --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_update_instance_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInstanceServiceUpdateInstanceRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader instance_name: String? + end +end diff --git a/sig/zitadel/client/models/beta_instance_service_update_instance_response.rbs b/sig/zitadel/client/models/beta_instance_service_update_instance_response.rbs new file mode 100644 index 00000000..93c1083d --- /dev/null +++ b/sig/zitadel/client/models/beta_instance_service_update_instance_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInstanceServiceUpdateInstanceResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_administrator.rbs b/sig/zitadel/client/models/beta_internal_permission_service_administrator.rbs new file mode 100644 index 00000000..3f4be5aa --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_administrator.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceAdministrator < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader user: BetaInternalPermissionServiceUser? + attr_reader roles: Array[String]? + attr_reader instance: bool? + attr_reader organization: BetaInternalPermissionServiceOrganization? + attr_reader project: BetaInternalPermissionServiceProject? + attr_reader project_grant: BetaInternalPermissionServiceProjectGrant? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_administrator_field_name.rbs b/sig/zitadel/client/models/beta_internal_permission_service_administrator_field_name.rbs new file mode 100644 index 00000000..c07bce16 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_administrator_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceAdministratorFieldName + ADMINISTRATOR_FIELD_NAME_UNSPECIFIED: String + ADMINISTRATOR_FIELD_NAME_USER_ID: String + ADMINISTRATOR_FIELD_NAME_CREATION_DATE: String + ADMINISTRATOR_FIELD_NAME_CHANGE_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_administrator_search_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_administrator_search_filter.rbs new file mode 100644 index 00000000..622f8afc --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_administrator_search_filter.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceAdministratorSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader _and: BetaInternalPermissionServiceAndFilter? + attr_reader change_date: BetaInternalPermissionServiceTimestampFilter? + attr_reader creation_date: BetaInternalPermissionServiceTimestampFilter? + attr_reader in_user_ids_filter: BetaInternalPermissionServiceInIDsFilter? + attr_reader _not: BetaInternalPermissionServiceNotFilter? + attr_reader _or: BetaInternalPermissionServiceOrFilter? + attr_reader resource: BetaInternalPermissionServiceResourceFilter? + attr_reader role: BetaInternalPermissionServiceRoleFilter? + attr_reader user_display_name: BetaInternalPermissionServiceUserDisplayNameFilter? + attr_reader user_organization_id: BetaInternalPermissionServiceIDFilter? + attr_reader user_preferred_login_name: BetaInternalPermissionServiceUserPreferredLoginNameFilter? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_and_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_and_filter.rbs new file mode 100644 index 00000000..2067a444 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_and_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceAndFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader queries: Array[BetaInternalPermissionServiceAdministratorSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_any.rbs b/sig/zitadel/client/models/beta_internal_permission_service_any.rbs new file mode 100644 index 00000000..7c14978d --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_connect_error.rbs b/sig/zitadel/client/models/beta_internal_permission_service_connect_error.rbs new file mode 100644 index 00000000..6a7930a6 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaInternalPermissionServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_create_administrator_request.rbs b/sig/zitadel/client/models/beta_internal_permission_service_create_administrator_request.rbs new file mode 100644 index 00000000..482686df --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_create_administrator_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceCreateAdministratorRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader resource: BetaInternalPermissionServiceResourceType? + attr_reader roles: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_create_administrator_response.rbs b/sig/zitadel/client/models/beta_internal_permission_service_create_administrator_response.rbs new file mode 100644 index 00000000..86ee6a9b --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_create_administrator_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceCreateAdministratorResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_delete_administrator_request.rbs b/sig/zitadel/client/models/beta_internal_permission_service_delete_administrator_request.rbs new file mode 100644 index 00000000..85f6c705 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_delete_administrator_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceDeleteAdministratorRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader resource: BetaInternalPermissionServiceResourceType? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_delete_administrator_response.rbs b/sig/zitadel/client/models/beta_internal_permission_service_delete_administrator_response.rbs new file mode 100644 index 00000000..0da2d725 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_delete_administrator_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceDeleteAdministratorResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_id_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_id_filter.rbs new file mode 100644 index 00000000..0c20f904 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_in_ids_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_in_ids_filter.rbs new file mode 100644 index 00000000..eef7ea6d --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_in_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceInIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_list_administrators_request.rbs b/sig/zitadel/client/models/beta_internal_permission_service_list_administrators_request.rbs new file mode 100644 index 00000000..d04cff1f --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_list_administrators_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceListAdministratorsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaInternalPermissionServicePaginationRequest? + attr_reader sorting_column: BetaInternalPermissionServiceAdministratorFieldName? + attr_reader filters: Array[BetaInternalPermissionServiceAdministratorSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_list_administrators_response.rbs b/sig/zitadel/client/models/beta_internal_permission_service_list_administrators_response.rbs new file mode 100644 index 00000000..1338a16f --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_list_administrators_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceListAdministratorsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaInternalPermissionServicePaginationResponse? + attr_reader administrators: Array[BetaInternalPermissionServiceAdministrator]? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_not_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_not_filter.rbs new file mode 100644 index 00000000..3e741bd5 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_not_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceNotFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader query: BetaInternalPermissionServiceAdministratorSearchFilter? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_or_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_or_filter.rbs new file mode 100644 index 00000000..8683badf --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_or_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceOrFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader queries: Array[BetaInternalPermissionServiceAdministratorSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_organization.rbs b/sig/zitadel/client/models/beta_internal_permission_service_organization.rbs new file mode 100644 index 00000000..a2d1bd5c --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_organization.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceOrganization < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_pagination_request.rbs b/sig/zitadel/client/models/beta_internal_permission_service_pagination_request.rbs new file mode 100644 index 00000000..9c721f40 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_pagination_response.rbs b/sig/zitadel/client/models/beta_internal_permission_service_pagination_response.rbs new file mode 100644 index 00000000..939a355a --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_project.rbs b/sig/zitadel/client/models/beta_internal_permission_service_project.rbs new file mode 100644 index 00000000..4bc749c9 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_project.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceProject < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_project_grant.rbs b/sig/zitadel/client/models/beta_internal_permission_service_project_grant.rbs new file mode 100644 index 00000000..81f903da --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_project_grant.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceProjectGrant < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_resource_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_resource_filter.rbs new file mode 100644 index 00000000..96dd5eeb --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_resource_filter.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceResourceFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance: bool? + attr_reader organization_id: String? + attr_reader project_grant_id: String? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_resource_type.rbs b/sig/zitadel/client/models/beta_internal_permission_service_resource_type.rbs new file mode 100644 index 00000000..d33fa07b --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_resource_type.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceResourceType < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance: bool? + attr_reader organization_id: String? + attr_reader project_grant: BetaInternalPermissionServiceProjectGrant? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_role_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_role_filter.rbs new file mode 100644 index 00000000..93551443 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_role_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceRoleFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader role_key: String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_text_filter_method.rbs b/sig/zitadel/client/models/beta_internal_permission_service_text_filter_method.rbs new file mode 100644 index 00000000..2e035e4f --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_timestamp_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_timestamp_filter.rbs new file mode 100644 index 00000000..a1345b9d --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_timestamp_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceTimestampFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader timestamp: Time? + attr_reader method: BetaInternalPermissionServiceTimestampFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_timestamp_filter_method.rbs b/sig/zitadel/client/models/beta_internal_permission_service_timestamp_filter_method.rbs new file mode 100644 index 00000000..3d760cbf --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_timestamp_filter_method.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceTimestampFilterMethod + TIMESTAMP_FILTER_METHOD_EQUALS: String + TIMESTAMP_FILTER_METHOD_GREATER: String + TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS: String + TIMESTAMP_FILTER_METHOD_LESS: String + TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_update_administrator_request.rbs b/sig/zitadel/client/models/beta_internal_permission_service_update_administrator_request.rbs new file mode 100644 index 00000000..5f8ee76d --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_update_administrator_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceUpdateAdministratorRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader resource: BetaInternalPermissionServiceResourceType? + attr_reader roles: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_update_administrator_response.rbs b/sig/zitadel/client/models/beta_internal_permission_service_update_administrator_response.rbs new file mode 100644 index 00000000..9fa62729 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_update_administrator_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceUpdateAdministratorResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_user.rbs b/sig/zitadel/client/models/beta_internal_permission_service_user.rbs new file mode 100644 index 00000000..62ee723d --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_user.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader preferred_login_name: String? + attr_reader display_name: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_user_display_name_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_user_display_name_filter.rbs new file mode 100644 index 00000000..f062e6d7 --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_user_display_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceUserDisplayNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name: String? + attr_reader method: BetaInternalPermissionServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_internal_permission_service_user_preferred_login_name_filter.rbs b/sig/zitadel/client/models/beta_internal_permission_service_user_preferred_login_name_filter.rbs new file mode 100644 index 00000000..a904d20a --- /dev/null +++ b/sig/zitadel/client/models/beta_internal_permission_service_user_preferred_login_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaInternalPermissionServiceUserPreferredLoginNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader preferred_login_name: String? + attr_reader method: BetaInternalPermissionServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_any.rbs b/sig/zitadel/client/models/beta_oidc_service_any.rbs new file mode 100644 index 00000000..52792bb3 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaOIDCServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_auth_request.rbs b/sig/zitadel/client/models/beta_oidc_service_auth_request.rbs new file mode 100644 index 00000000..5f87f1ff --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_auth_request.rbs @@ -0,0 +1,18 @@ +module Zitadel::Client::Models + class BetaOIDCServiceAuthRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader client_id: String? + attr_reader scope: Array[String]? + attr_reader redirect_uri: String? + attr_reader prompt: Array[BetaOIDCServicePrompt]? + attr_reader ui_locales: Array[String]? + attr_reader login_hint: String? + attr_reader max_age: ISO8601::Duration? + attr_reader hint_user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_authorization_error.rbs b/sig/zitadel/client/models/beta_oidc_service_authorization_error.rbs new file mode 100644 index 00000000..3d35a183 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_authorization_error.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOIDCServiceAuthorizationError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader error: BetaOIDCServiceErrorReason? + attr_reader error_description: String? + attr_reader error_uri: String? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_connect_error.rbs b/sig/zitadel/client/models/beta_oidc_service_connect_error.rbs new file mode 100644 index 00000000..b42da545 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaOIDCServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaOIDCServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_create_callback_request.rbs b/sig/zitadel/client/models/beta_oidc_service_create_callback_request.rbs new file mode 100644 index 00000000..8408e02e --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_create_callback_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOIDCServiceCreateCallbackRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_request_id: String? + attr_reader error: BetaOIDCServiceAuthorizationError? + attr_reader session: BetaOIDCServiceSession? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_create_callback_response.rbs b/sig/zitadel/client/models/beta_oidc_service_create_callback_response.rbs new file mode 100644 index 00000000..5c613207 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_create_callback_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOIDCServiceCreateCallbackResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaOIDCServiceDetails? + attr_reader callback_url: String? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_details.rbs b/sig/zitadel/client/models/beta_oidc_service_details.rbs new file mode 100644 index 00000000..5b21df68 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaOIDCServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_error_reason.rbs b/sig/zitadel/client/models/beta_oidc_service_error_reason.rbs new file mode 100644 index 00000000..0dd909a9 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_error_reason.rbs @@ -0,0 +1,24 @@ +module Zitadel::Client::Models + class BetaOIDCServiceErrorReason + ERROR_REASON_UNSPECIFIED: String + ERROR_REASON_INVALID_REQUEST: String + ERROR_REASON_UNAUTHORIZED_CLIENT: String + ERROR_REASON_ACCESS_DENIED: String + ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE: String + ERROR_REASON_INVALID_SCOPE: String + ERROR_REASON_SERVER_ERROR: String + ERROR_REASON_TEMPORARY_UNAVAILABLE: String + ERROR_REASON_INTERACTION_REQUIRED: String + ERROR_REASON_LOGIN_REQUIRED: String + ERROR_REASON_ACCOUNT_SELECTION_REQUIRED: String + ERROR_REASON_CONSENT_REQUIRED: String + ERROR_REASON_INVALID_REQUEST_URI: String + ERROR_REASON_INVALID_REQUEST_OBJECT: String + ERROR_REASON_REQUEST_NOT_SUPPORTED: String + ERROR_REASON_REQUEST_URI_NOT_SUPPORTED: String + ERROR_REASON_REGISTRATION_NOT_SUPPORTED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_get_auth_request_request.rbs b/sig/zitadel/client/models/beta_oidc_service_get_auth_request_request.rbs new file mode 100644 index 00000000..270de569 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_get_auth_request_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOIDCServiceGetAuthRequestRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_request_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_get_auth_request_response.rbs b/sig/zitadel/client/models/beta_oidc_service_get_auth_request_response.rbs new file mode 100644 index 00000000..77a62ee4 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_get_auth_request_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOIDCServiceGetAuthRequestResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_request: BetaOIDCServiceAuthRequest? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_prompt.rbs b/sig/zitadel/client/models/beta_oidc_service_prompt.rbs new file mode 100644 index 00000000..250489e8 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_prompt.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaOIDCServicePrompt + PROMPT_UNSPECIFIED: String + PROMPT_NONE: String + PROMPT_LOGIN: String + PROMPT_CONSENT: String + PROMPT_SELECT_ACCOUNT: String + PROMPT_CREATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_oidc_service_session.rbs b/sig/zitadel/client/models/beta_oidc_service_session.rbs new file mode 100644 index 00000000..fcda7719 --- /dev/null +++ b/sig/zitadel/client/models/beta_oidc_service_session.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOIDCServiceSession < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session_id: String? + attr_reader session_token: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_activate_organization_request.rbs b/sig/zitadel/client/models/beta_organization_service_activate_organization_request.rbs new file mode 100644 index 00000000..22a4b5c3 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_activate_organization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceActivateOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_activate_organization_response.rbs b/sig/zitadel/client/models/beta_organization_service_activate_organization_response.rbs new file mode 100644 index 00000000..3fd6374e --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_activate_organization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceActivateOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_add_human_user_request.rbs b/sig/zitadel/client/models/beta_organization_service_add_human_user_request.rbs new file mode 100644 index 00000000..e484443c --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_add_human_user_request.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceAddHumanUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader username: String? + attr_reader organization: BetaOrganizationServiceOrganization? + attr_reader profile: BetaOrganizationServiceSetHumanProfile? + attr_reader email: BetaOrganizationServiceSetHumanEmail? + attr_reader phone: BetaOrganizationServiceSetHumanPhone? + attr_reader metadata: Array[BetaOrganizationServiceSetMetadataEntry]? + attr_reader idp_links: Array[BetaOrganizationServiceIDPLink]? + attr_reader totp_secret: String? + attr_reader hashed_password: BetaOrganizationServiceHashedPassword? + attr_reader password: BetaOrganizationServicePassword? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_add_organization_domain_request.rbs b/sig/zitadel/client/models/beta_organization_service_add_organization_domain_request.rbs new file mode 100644 index 00000000..9754fd97 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_add_organization_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceAddOrganizationDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_add_organization_domain_response.rbs b/sig/zitadel/client/models/beta_organization_service_add_organization_domain_response.rbs new file mode 100644 index 00000000..0b849e9e --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_add_organization_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceAddOrganizationDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_admin.rbs b/sig/zitadel/client/models/beta_organization_service_admin.rbs new file mode 100644 index 00000000..eedb4595 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_admin.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceAdmin < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader roles: Array[String]? + attr_reader human: BetaOrganizationServiceAddHumanUserRequest? + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_any.rbs b/sig/zitadel/client/models/beta_organization_service_any.rbs new file mode 100644 index 00000000..20a7df4f --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_assigned_admin.rbs b/sig/zitadel/client/models/beta_organization_service_assigned_admin.rbs new file mode 100644 index 00000000..1a146057 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_assigned_admin.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceAssignedAdmin < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_connect_error.rbs b/sig/zitadel/client/models/beta_organization_service_connect_error.rbs new file mode 100644 index 00000000..1f4a4d1d --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaOrganizationServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_create_organization_request.rbs b/sig/zitadel/client/models/beta_organization_service_create_organization_request.rbs new file mode 100644 index 00000000..d1134c39 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_create_organization_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceCreateOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader id: String? + attr_reader admins: Array[BetaOrganizationServiceAdmin]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_create_organization_response.rbs b/sig/zitadel/client/models/beta_organization_service_create_organization_response.rbs new file mode 100644 index 00000000..cb295af2 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_create_organization_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceCreateOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader id: String? + attr_reader organization_admins: Array[BetaOrganizationServiceOrganizationAdmin]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_created_admin.rbs b/sig/zitadel/client/models/beta_organization_service_created_admin.rbs new file mode 100644 index 00000000..bed1a5b9 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_created_admin.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceCreatedAdmin < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader email_code: String? + attr_reader phone_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_deactivate_organization_request.rbs b/sig/zitadel/client/models/beta_organization_service_deactivate_organization_request.rbs new file mode 100644 index 00000000..09ac0dba --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_deactivate_organization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDeactivateOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_deactivate_organization_response.rbs b/sig/zitadel/client/models/beta_organization_service_deactivate_organization_response.rbs new file mode 100644 index 00000000..711b9f30 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_deactivate_organization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDeactivateOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_delete_organization_domain_request.rbs b/sig/zitadel/client/models/beta_organization_service_delete_organization_domain_request.rbs new file mode 100644 index 00000000..b1cda5b9 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_delete_organization_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDeleteOrganizationDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_delete_organization_domain_response.rbs b/sig/zitadel/client/models/beta_organization_service_delete_organization_domain_response.rbs new file mode 100644 index 00000000..d586fee9 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_delete_organization_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDeleteOrganizationDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_delete_organization_metadata_request.rbs b/sig/zitadel/client/models/beta_organization_service_delete_organization_metadata_request.rbs new file mode 100644 index 00000000..e8dceae6 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_delete_organization_metadata_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDeleteOrganizationMetadataRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_delete_organization_metadata_response.rbs b/sig/zitadel/client/models/beta_organization_service_delete_organization_metadata_response.rbs new file mode 100644 index 00000000..adc1ce3e --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_delete_organization_metadata_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDeleteOrganizationMetadataResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_delete_organization_request.rbs b/sig/zitadel/client/models/beta_organization_service_delete_organization_request.rbs new file mode 100644 index 00000000..4423df5d --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_delete_organization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDeleteOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_delete_organization_response.rbs b/sig/zitadel/client/models/beta_organization_service_delete_organization_response.rbs new file mode 100644 index 00000000..a132b960 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_delete_organization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDeleteOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_domain.rbs b/sig/zitadel/client/models/beta_organization_service_domain.rbs new file mode 100644 index 00000000..3ac8eb24 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_domain.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDomain < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain_name: String? + attr_reader is_verified: bool? + attr_reader is_primary: bool? + attr_reader validation_type: BetaOrganizationServiceDomainValidationType? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_domain_name_filter.rbs b/sig/zitadel/client/models/beta_organization_service_domain_name_filter.rbs new file mode 100644 index 00000000..b2207cba --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_domain_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDomainNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader method: BetaOrganizationServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_domain_search_filter.rbs b/sig/zitadel/client/models/beta_organization_service_domain_search_filter.rbs new file mode 100644 index 00000000..292bda57 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_domain_search_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDomainSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain_name_filter: BetaOrganizationServiceDomainNameFilter? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_domain_validation_type.rbs b/sig/zitadel/client/models/beta_organization_service_domain_validation_type.rbs new file mode 100644 index 00000000..6e29c3ec --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_domain_validation_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceDomainValidationType + DOMAIN_VALIDATION_TYPE_UNSPECIFIED: String + DOMAIN_VALIDATION_TYPE_HTTP: String + DOMAIN_VALIDATION_TYPE_DNS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_gender.rbs b/sig/zitadel/client/models/beta_organization_service_gender.rbs new file mode 100644 index 00000000..35ddde86 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_gender.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceGender + GENDER_UNSPECIFIED: String + GENDER_FEMALE: String + GENDER_MALE: String + GENDER_DIVERSE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_request.rbs b/sig/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_request.rbs new file mode 100644 index 00000000..89899fe3 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceGenerateOrganizationDomainValidationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain: String? + attr_reader type: BetaOrganizationServiceDomainValidationType? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_response.rbs b/sig/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_response.rbs new file mode 100644 index 00000000..2e65e37f --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_generate_organization_domain_validation_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceGenerateOrganizationDomainValidationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader token: String? + attr_reader url: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_hashed_password.rbs b/sig/zitadel/client/models/beta_organization_service_hashed_password.rbs new file mode 100644 index 00000000..98433cf7 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_hashed_password.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceHashedPassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader hash: String? + attr_reader change_required: bool? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_idp_link.rbs b/sig/zitadel/client/models/beta_organization_service_idp_link.rbs new file mode 100644 index 00000000..cb6cab97 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_idp_link.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceIDPLink < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_id: String? + attr_reader user_id: String? + attr_reader user_name: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_list_organization_domains_request.rbs b/sig/zitadel/client/models/beta_organization_service_list_organization_domains_request.rbs new file mode 100644 index 00000000..c78acc19 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_list_organization_domains_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceListOrganizationDomainsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader pagination: BetaOrganizationServicePaginationRequest? + attr_reader filters: Array[BetaOrganizationServiceDomainSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_list_organization_domains_response.rbs b/sig/zitadel/client/models/beta_organization_service_list_organization_domains_response.rbs new file mode 100644 index 00000000..b6261476 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_list_organization_domains_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceListOrganizationDomainsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaOrganizationServicePaginationResponse? + attr_reader domains: Array[BetaOrganizationServiceDomain]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_list_organization_metadata_request.rbs b/sig/zitadel/client/models/beta_organization_service_list_organization_metadata_request.rbs new file mode 100644 index 00000000..c0b9ede7 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_list_organization_metadata_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceListOrganizationMetadataRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader pagination: BetaOrganizationServicePaginationRequest? + attr_reader filter: Array[BetaOrganizationServiceMetadataQuery]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_list_organization_metadata_response.rbs b/sig/zitadel/client/models/beta_organization_service_list_organization_metadata_response.rbs new file mode 100644 index 00000000..0edc2bed --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_list_organization_metadata_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceListOrganizationMetadataResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaOrganizationServicePaginationResponse? + attr_reader metadata: Array[BetaOrganizationServiceMetadata]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_list_organizations_request.rbs b/sig/zitadel/client/models/beta_organization_service_list_organizations_request.rbs new file mode 100644 index 00000000..0eb05786 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_list_organizations_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceListOrganizationsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaOrganizationServicePaginationRequest? + attr_reader sorting_column: BetaOrganizationServiceOrgFieldName? + attr_reader filter: Array[BetaOrganizationServiceOrganizationSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_list_organizations_response.rbs b/sig/zitadel/client/models/beta_organization_service_list_organizations_response.rbs new file mode 100644 index 00000000..92f81271 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_list_organizations_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceListOrganizationsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaOrganizationServicePaginationResponse? + attr_reader organizations: Array[BetaOrganizationServiceOrganization]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_metadata.rbs b/sig/zitadel/client/models/beta_organization_service_metadata.rbs new file mode 100644 index 00000000..faa4dc27 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_metadata.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceMetadata < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader value: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_metadata_key_query.rbs b/sig/zitadel/client/models/beta_organization_service_metadata_key_query.rbs new file mode 100644 index 00000000..1fd10d60 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_metadata_key_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceMetadataKeyQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader method: BetaOrganizationServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_metadata_query.rbs b/sig/zitadel/client/models/beta_organization_service_metadata_query.rbs new file mode 100644 index 00000000..0fc5ec98 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_metadata_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceMetadataQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_query: BetaOrganizationServiceMetadataKeyQuery? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_org_domain_filter.rbs b/sig/zitadel/client/models/beta_organization_service_org_domain_filter.rbs new file mode 100644 index 00000000..ffa7ff21 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_org_domain_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceOrgDomainFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain: String? + attr_reader method: BetaOrganizationServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_org_field_name.rbs b/sig/zitadel/client/models/beta_organization_service_org_field_name.rbs new file mode 100644 index 00000000..c85d450c --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_org_field_name.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceOrgFieldName + ORG_FIELD_NAME_UNSPECIFIED: String + ORG_FIELD_NAME_NAME: String + ORG_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_org_id_filter.rbs b/sig/zitadel/client/models/beta_organization_service_org_id_filter.rbs new file mode 100644 index 00000000..270e34f2 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_org_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceOrgIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_org_name_filter.rbs b/sig/zitadel/client/models/beta_organization_service_org_name_filter.rbs new file mode 100644 index 00000000..918cca58 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_org_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceOrgNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader method: BetaOrganizationServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_org_state.rbs b/sig/zitadel/client/models/beta_organization_service_org_state.rbs new file mode 100644 index 00000000..ddfbe279 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_org_state.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceOrgState + ORG_STATE_UNSPECIFIED: String + ORG_STATE_ACTIVE: String + ORG_STATE_INACTIVE: String + ORG_STATE_REMOVED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_org_state_filter.rbs b/sig/zitadel/client/models/beta_organization_service_org_state_filter.rbs new file mode 100644 index 00000000..bef4dd30 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_org_state_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceOrgStateFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader state: BetaOrganizationServiceOrgState? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_organization.rbs b/sig/zitadel/client/models/beta_organization_service_organization.rbs new file mode 100644 index 00000000..80beda87 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_organization.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceOrganization < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader changed_date: Time? + attr_reader state: BetaOrganizationServiceOrgState? + attr_reader name: String? + attr_reader primary_domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_organization_admin.rbs b/sig/zitadel/client/models/beta_organization_service_organization_admin.rbs new file mode 100644 index 00000000..a8305289 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_organization_admin.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceOrganizationAdmin < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader assigned_admin: BetaOrganizationServiceAssignedAdmin? + attr_reader created_admin: BetaOrganizationServiceCreatedAdmin? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_organization_search_filter.rbs b/sig/zitadel/client/models/beta_organization_service_organization_search_filter.rbs new file mode 100644 index 00000000..287e8167 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_organization_search_filter.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceOrganizationSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain_filter: BetaOrganizationServiceOrgDomainFilter? + attr_reader id_filter: BetaOrganizationServiceOrgIDFilter? + attr_reader name_filter: BetaOrganizationServiceOrgNameFilter? + attr_reader state_filter: BetaOrganizationServiceOrgStateFilter? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_pagination_request.rbs b/sig/zitadel/client/models/beta_organization_service_pagination_request.rbs new file mode 100644 index 00000000..e8ee59d7 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaOrganizationServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_pagination_response.rbs b/sig/zitadel/client/models/beta_organization_service_pagination_response.rbs new file mode 100644 index 00000000..b98bef38 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_password.rbs b/sig/zitadel/client/models/beta_organization_service_password.rbs new file mode 100644 index 00000000..673b09d2 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_password.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServicePassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader password: String? + attr_reader change_required: bool? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_send_email_verification_code.rbs b/sig/zitadel/client/models/beta_organization_service_send_email_verification_code.rbs new file mode 100644 index 00000000..9a17d7d6 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_send_email_verification_code.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceSendEmailVerificationCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_set_human_email.rbs b/sig/zitadel/client/models/beta_organization_service_set_human_email.rbs new file mode 100644 index 00000000..a0a81ed7 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_set_human_email.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceSetHumanEmail < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader email: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: BetaOrganizationServiceSendEmailVerificationCode? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_set_human_phone.rbs b/sig/zitadel/client/models/beta_organization_service_set_human_phone.rbs new file mode 100644 index 00000000..a8842cbd --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_set_human_phone.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceSetHumanPhone < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader phone: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_set_human_profile.rbs b/sig/zitadel/client/models/beta_organization_service_set_human_profile.rbs new file mode 100644 index 00000000..c593ad7b --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_set_human_profile.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceSetHumanProfile < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader given_name: String? + attr_reader family_name: String? + attr_reader nick_name: String? + attr_reader display_name: String? + attr_reader preferred_language: String? + attr_reader gender: BetaOrganizationServiceGender? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_set_metadata_entry.rbs b/sig/zitadel/client/models/beta_organization_service_set_metadata_entry.rbs new file mode 100644 index 00000000..e70200f7 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_set_metadata_entry.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceSetMetadataEntry < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader value: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_set_organization_metadata_request.rbs b/sig/zitadel/client/models/beta_organization_service_set_organization_metadata_request.rbs new file mode 100644 index 00000000..ffbb579a --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_set_organization_metadata_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceSetOrganizationMetadataRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader metadata: Array[BetaOrganizationServiceMetadata]? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_set_organization_metadata_response.rbs b/sig/zitadel/client/models/beta_organization_service_set_organization_metadata_response.rbs new file mode 100644 index 00000000..13da894e --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_set_organization_metadata_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceSetOrganizationMetadataResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader set_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_text_query_method.rbs b/sig/zitadel/client/models/beta_organization_service_text_query_method.rbs new file mode 100644 index 00000000..4c11b61e --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_text_query_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS: String + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE: String + TEXT_QUERY_METHOD_STARTS_WITH: String + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_QUERY_METHOD_CONTAINS: String + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_QUERY_METHOD_ENDS_WITH: String + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_update_organization_request.rbs b/sig/zitadel/client/models/beta_organization_service_update_organization_request.rbs new file mode 100644 index 00000000..15d3bea7 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_update_organization_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceUpdateOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_update_organization_response.rbs b/sig/zitadel/client/models/beta_organization_service_update_organization_response.rbs new file mode 100644 index 00000000..09d6fd05 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_update_organization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceUpdateOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_verify_organization_domain_request.rbs b/sig/zitadel/client/models/beta_organization_service_verify_organization_domain_request.rbs new file mode 100644 index 00000000..26d4d562 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_verify_organization_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceVerifyOrganizationDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_organization_service_verify_organization_domain_response.rbs b/sig/zitadel/client/models/beta_organization_service_verify_organization_domain_response.rbs new file mode 100644 index 00000000..39e1fbf5 --- /dev/null +++ b/sig/zitadel/client/models/beta_organization_service_verify_organization_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaOrganizationServiceVerifyOrganizationDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_activate_project_grant_request.rbs b/sig/zitadel/client/models/beta_project_service_activate_project_grant_request.rbs new file mode 100644 index 00000000..0b7e4c29 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_activate_project_grant_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceActivateProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_activate_project_grant_response.rbs b/sig/zitadel/client/models/beta_project_service_activate_project_grant_response.rbs new file mode 100644 index 00000000..e101194f --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_activate_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceActivateProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_activate_project_request.rbs b/sig/zitadel/client/models/beta_project_service_activate_project_request.rbs new file mode 100644 index 00000000..bf7f9460 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_activate_project_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceActivateProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_activate_project_response.rbs b/sig/zitadel/client/models/beta_project_service_activate_project_response.rbs new file mode 100644 index 00000000..e6543d6b --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_activate_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceActivateProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_add_project_role_request.rbs b/sig/zitadel/client/models/beta_project_service_add_project_role_request.rbs new file mode 100644 index 00000000..07a1e661 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_add_project_role_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaProjectServiceAddProjectRoleRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader role_key: String? + attr_reader display_name: String? + attr_reader group: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_add_project_role_response.rbs b/sig/zitadel/client/models/beta_project_service_add_project_role_response.rbs new file mode 100644 index 00000000..fbc5f412 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_add_project_role_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceAddProjectRoleResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_admin.rbs b/sig/zitadel/client/models/beta_project_service_admin.rbs new file mode 100644 index 00000000..11ba2ffe --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_admin.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceAdmin < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader roles: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_any.rbs b/sig/zitadel/client/models/beta_project_service_any.rbs new file mode 100644 index 00000000..1de3659f --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaProjectServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_connect_error.rbs b/sig/zitadel/client/models/beta_project_service_connect_error.rbs new file mode 100644 index 00000000..8cdd161a --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaProjectServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaProjectServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_create_project_grant_request.rbs b/sig/zitadel/client/models/beta_project_service_create_project_grant_request.rbs new file mode 100644 index 00000000..46c7aa45 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_create_project_grant_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaProjectServiceCreateProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + attr_reader role_keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_create_project_grant_response.rbs b/sig/zitadel/client/models/beta_project_service_create_project_grant_response.rbs new file mode 100644 index 00000000..f57e24f3 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_create_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceCreateProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_create_project_request.rbs b/sig/zitadel/client/models/beta_project_service_create_project_request.rbs new file mode 100644 index 00000000..ef43b283 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_create_project_request.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class BetaProjectServiceCreateProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader id: String? + attr_reader name: String? + attr_reader project_role_assertion: bool? + attr_reader authorization_required: bool? + attr_reader project_access_required: bool? + attr_reader private_labeling_setting: BetaProjectServicePrivateLabelingSetting? + attr_reader admins: Array[BetaProjectServiceAdmin]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_create_project_response.rbs b/sig/zitadel/client/models/beta_project_service_create_project_response.rbs new file mode 100644 index 00000000..91ff9b6e --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_create_project_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceCreateProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_deactivate_project_grant_request.rbs b/sig/zitadel/client/models/beta_project_service_deactivate_project_grant_request.rbs new file mode 100644 index 00000000..1292f014 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_deactivate_project_grant_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceDeactivateProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_deactivate_project_grant_response.rbs b/sig/zitadel/client/models/beta_project_service_deactivate_project_grant_response.rbs new file mode 100644 index 00000000..fcb1d185 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_deactivate_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceDeactivateProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_deactivate_project_request.rbs b/sig/zitadel/client/models/beta_project_service_deactivate_project_request.rbs new file mode 100644 index 00000000..3577bf53 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_deactivate_project_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceDeactivateProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_deactivate_project_response.rbs b/sig/zitadel/client/models/beta_project_service_deactivate_project_response.rbs new file mode 100644 index 00000000..733ebb08 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_deactivate_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceDeactivateProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_delete_project_grant_request.rbs b/sig/zitadel/client/models/beta_project_service_delete_project_grant_request.rbs new file mode 100644 index 00000000..d0f10563 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_delete_project_grant_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceDeleteProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_delete_project_grant_response.rbs b/sig/zitadel/client/models/beta_project_service_delete_project_grant_response.rbs new file mode 100644 index 00000000..a36b1ba7 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_delete_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceDeleteProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_delete_project_request.rbs b/sig/zitadel/client/models/beta_project_service_delete_project_request.rbs new file mode 100644 index 00000000..6eda3dbe --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_delete_project_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceDeleteProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_delete_project_response.rbs b/sig/zitadel/client/models/beta_project_service_delete_project_response.rbs new file mode 100644 index 00000000..f76b1db0 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_delete_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceDeleteProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_get_project_request.rbs b/sig/zitadel/client/models/beta_project_service_get_project_request.rbs new file mode 100644 index 00000000..072d1735 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_get_project_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceGetProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_get_project_response.rbs b/sig/zitadel/client/models/beta_project_service_get_project_response.rbs new file mode 100644 index 00000000..d7b95ce3 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_get_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceGetProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project: BetaProjectServiceProject? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_granted_project_state.rbs b/sig/zitadel/client/models/beta_project_service_granted_project_state.rbs new file mode 100644 index 00000000..ada59611 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_granted_project_state.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceGrantedProjectState + GRANTED_PROJECT_STATE_UNSPECIFIED: String + GRANTED_PROJECT_STATE_ACTIVE: String + GRANTED_PROJECT_STATE_INACTIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_id_filter.rbs b/sig/zitadel/client/models/beta_project_service_id_filter.rbs new file mode 100644 index 00000000..e0a6a044 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_in_ids_filter.rbs b/sig/zitadel/client/models/beta_project_service_in_ids_filter.rbs new file mode 100644 index 00000000..d17db3bb --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_in_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceInIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_list_project_grants_request.rbs b/sig/zitadel/client/models/beta_project_service_list_project_grants_request.rbs new file mode 100644 index 00000000..c520ab54 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_list_project_grants_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaProjectServiceListProjectGrantsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaProjectServicePaginationRequest? + attr_reader sorting_column: BetaProjectServiceProjectGrantFieldName? + attr_reader filters: Array[BetaProjectServiceProjectGrantSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_list_project_grants_response.rbs b/sig/zitadel/client/models/beta_project_service_list_project_grants_response.rbs new file mode 100644 index 00000000..277216e8 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_list_project_grants_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceListProjectGrantsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaProjectServicePaginationResponse? + attr_reader project_grants: Array[BetaProjectServiceProjectGrant]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_list_project_roles_request.rbs b/sig/zitadel/client/models/beta_project_service_list_project_roles_request.rbs new file mode 100644 index 00000000..79d8b1fd --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_list_project_roles_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaProjectServiceListProjectRolesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader pagination: BetaProjectServicePaginationRequest? + attr_reader sorting_column: BetaProjectServiceProjectRoleFieldName? + attr_reader filters: Array[BetaProjectServiceProjectRoleSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_list_project_roles_response.rbs b/sig/zitadel/client/models/beta_project_service_list_project_roles_response.rbs new file mode 100644 index 00000000..63a1b89b --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_list_project_roles_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceListProjectRolesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaProjectServicePaginationResponse? + attr_reader project_roles: Array[BetaProjectServiceProjectRole]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_list_projects_request.rbs b/sig/zitadel/client/models/beta_project_service_list_projects_request.rbs new file mode 100644 index 00000000..765ee071 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_list_projects_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaProjectServiceListProjectsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaProjectServicePaginationRequest? + attr_reader sorting_column: BetaProjectServiceProjectFieldName? + attr_reader filters: Array[BetaProjectServiceProjectSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_list_projects_response.rbs b/sig/zitadel/client/models/beta_project_service_list_projects_response.rbs new file mode 100644 index 00000000..7beb2abb --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_list_projects_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceListProjectsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: BetaProjectServicePaginationResponse? + attr_reader projects: Array[BetaProjectServiceProject]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_pagination_request.rbs b/sig/zitadel/client/models/beta_project_service_pagination_request.rbs new file mode 100644 index 00000000..f32b87ba --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaProjectServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_pagination_response.rbs b/sig/zitadel/client/models/beta_project_service_pagination_response.rbs new file mode 100644 index 00000000..8de580d7 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_private_labeling_setting.rbs b/sig/zitadel/client/models/beta_project_service_private_labeling_setting.rbs new file mode 100644 index 00000000..b2ce252f --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_private_labeling_setting.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServicePrivateLabelingSetting + PRIVATE_LABELING_SETTING_UNSPECIFIED: String + PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY: String + PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project.rbs b/sig/zitadel/client/models/beta_project_service_project.rbs new file mode 100644 index 00000000..f74b02e7 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project.rbs @@ -0,0 +1,21 @@ +module Zitadel::Client::Models + class BetaProjectServiceProject < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader organization_id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader name: String? + attr_reader state: BetaProjectServiceProjectState? + attr_reader project_role_assertion: bool? + attr_reader authorization_required: bool? + attr_reader project_access_required: bool? + attr_reader private_labeling_setting: BetaProjectServicePrivateLabelingSetting? + attr_reader granted_organization_id: String? + attr_reader granted_organization_name: String? + attr_reader granted_state: BetaProjectServiceGrantedProjectState? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_field_name.rbs b/sig/zitadel/client/models/beta_project_service_project_field_name.rbs new file mode 100644 index 00000000..fc224488 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_field_name.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectFieldName + PROJECT_FIELD_NAME_UNSPECIFIED: String + PROJECT_FIELD_NAME_ID: String + PROJECT_FIELD_NAME_CREATION_DATE: String + PROJECT_FIELD_NAME_CHANGE_DATE: String + PROJECT_FIELD_NAME_NAME: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_grant.rbs b/sig/zitadel/client/models/beta_project_service_project_grant.rbs new file mode 100644 index 00000000..dfef3a2b --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_grant.rbs @@ -0,0 +1,17 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectGrant < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader granted_organization_id: String? + attr_reader granted_organization_name: String? + attr_reader granted_role_keys: Array[String]? + attr_reader project_id: String? + attr_reader project_name: String? + attr_reader state: BetaProjectServiceProjectGrantState? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_grant_field_name.rbs b/sig/zitadel/client/models/beta_project_service_project_grant_field_name.rbs new file mode 100644 index 00000000..dd31a631 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_grant_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectGrantFieldName + PROJECT_GRANT_FIELD_NAME_UNSPECIFIED: String + PROJECT_GRANT_FIELD_NAME_PROJECT_ID: String + PROJECT_GRANT_FIELD_NAME_CREATION_DATE: String + PROJECT_GRANT_FIELD_NAME_CHANGE_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_grant_search_filter.rbs b/sig/zitadel/client/models/beta_project_service_project_grant_search_filter.rbs new file mode 100644 index 00000000..69c44243 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_grant_search_filter.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectGrantSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader in_project_ids_filter: BetaProjectServiceInIDsFilter? + attr_reader project_grant_resource_owner_filter: BetaProjectServiceIDFilter? + attr_reader project_name_filter: BetaProjectServiceProjectNameFilter? + attr_reader project_resource_owner_filter: BetaProjectServiceIDFilter? + attr_reader role_key_filter: BetaProjectServiceProjectRoleKeyFilter? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_grant_state.rbs b/sig/zitadel/client/models/beta_project_service_project_grant_state.rbs new file mode 100644 index 00000000..ccb8d5e2 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_grant_state.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectGrantState + PROJECT_GRANT_STATE_UNSPECIFIED: String + PROJECT_GRANT_STATE_ACTIVE: String + PROJECT_GRANT_STATE_INACTIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_name_filter.rbs b/sig/zitadel/client/models/beta_project_service_project_name_filter.rbs new file mode 100644 index 00000000..af4d1e22 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_name: String? + attr_reader method: BetaProjectServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_role.rbs b/sig/zitadel/client/models/beta_project_service_project_role.rbs new file mode 100644 index 00000000..7ccc08d0 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_role.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectRole < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader key: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader display_name: String? + attr_reader group: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_role_display_name_filter.rbs b/sig/zitadel/client/models/beta_project_service_project_role_display_name_filter.rbs new file mode 100644 index 00000000..cb5eb30e --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_role_display_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectRoleDisplayNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name: String? + attr_reader method: BetaProjectServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_role_field_name.rbs b/sig/zitadel/client/models/beta_project_service_project_role_field_name.rbs new file mode 100644 index 00000000..2fbeda6d --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_role_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectRoleFieldName + PROJECT_ROLE_FIELD_NAME_UNSPECIFIED: String + PROJECT_ROLE_FIELD_NAME_KEY: String + PROJECT_ROLE_FIELD_NAME_CREATION_DATE: String + PROJECT_ROLE_FIELD_NAME_CHANGE_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_role_key_filter.rbs b/sig/zitadel/client/models/beta_project_service_project_role_key_filter.rbs new file mode 100644 index 00000000..a14f1a39 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_role_key_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectRoleKeyFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader method: BetaProjectServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_role_search_filter.rbs b/sig/zitadel/client/models/beta_project_service_project_role_search_filter.rbs new file mode 100644 index 00000000..e41a6fb2 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_role_search_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectRoleSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name_filter: BetaProjectServiceProjectRoleDisplayNameFilter? + attr_reader role_key_filter: BetaProjectServiceProjectRoleKeyFilter? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_search_filter.rbs b/sig/zitadel/client/models/beta_project_service_project_search_filter.rbs new file mode 100644 index 00000000..13968587 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_search_filter.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader in_project_ids_filter: BetaProjectServiceInIDsFilter? + attr_reader project_grant_resource_owner_filter: BetaProjectServiceIDFilter? + attr_reader project_name_filter: BetaProjectServiceProjectNameFilter? + attr_reader project_organization_id_filter: BetaProjectServiceIDFilter? + attr_reader project_resource_owner_filter: BetaProjectServiceIDFilter? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_project_state.rbs b/sig/zitadel/client/models/beta_project_service_project_state.rbs new file mode 100644 index 00000000..c67d9c8c --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_project_state.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceProjectState + PROJECT_STATE_UNSPECIFIED: String + PROJECT_STATE_ACTIVE: String + PROJECT_STATE_INACTIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_remove_project_role_request.rbs b/sig/zitadel/client/models/beta_project_service_remove_project_role_request.rbs new file mode 100644 index 00000000..d79aba8d --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_remove_project_role_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaProjectServiceRemoveProjectRoleRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader role_key: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_remove_project_role_response.rbs b/sig/zitadel/client/models/beta_project_service_remove_project_role_response.rbs new file mode 100644 index 00000000..b6d0bf50 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_remove_project_role_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceRemoveProjectRoleResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader removal_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_text_filter_method.rbs b/sig/zitadel/client/models/beta_project_service_text_filter_method.rbs new file mode 100644 index 00000000..a8f1b1c5 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaProjectServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_update_project_grant_request.rbs b/sig/zitadel/client/models/beta_project_service_update_project_grant_request.rbs new file mode 100644 index 00000000..d8df709d --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_update_project_grant_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaProjectServiceUpdateProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + attr_reader role_keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_update_project_grant_response.rbs b/sig/zitadel/client/models/beta_project_service_update_project_grant_response.rbs new file mode 100644 index 00000000..dd76f279 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_update_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceUpdateProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_update_project_request.rbs b/sig/zitadel/client/models/beta_project_service_update_project_request.rbs new file mode 100644 index 00000000..06eeb7f2 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_update_project_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaProjectServiceUpdateProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + attr_reader project_role_assertion: bool? + attr_reader project_role_check: bool? + attr_reader has_project_check: bool? + attr_reader private_labeling_setting: BetaProjectServicePrivateLabelingSetting? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_update_project_response.rbs b/sig/zitadel/client/models/beta_project_service_update_project_response.rbs new file mode 100644 index 00000000..67159287 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_update_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceUpdateProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_update_project_role_request.rbs b/sig/zitadel/client/models/beta_project_service_update_project_role_request.rbs new file mode 100644 index 00000000..a274c708 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_update_project_role_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaProjectServiceUpdateProjectRoleRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader role_key: String? + attr_reader display_name: String? + attr_reader group: String? + end +end diff --git a/sig/zitadel/client/models/beta_project_service_update_project_role_response.rbs b/sig/zitadel/client/models/beta_project_service_update_project_role_response.rbs new file mode 100644 index 00000000..86acb901 --- /dev/null +++ b/sig/zitadel/client/models/beta_project_service_update_project_role_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaProjectServiceUpdateProjectRoleResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_any.rbs b/sig/zitadel/client/models/beta_session_service_any.rbs new file mode 100644 index 00000000..724b844f --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSessionServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_challenges.rbs b/sig/zitadel/client/models/beta_session_service_challenges.rbs new file mode 100644 index 00000000..6264bcea --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_challenges.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSessionServiceChallenges < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader web_auth_n: BetaSessionServiceWebAuthN? + attr_reader otp_sms: String? + attr_reader otp_email: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_check_idp_intent.rbs b/sig/zitadel/client/models/beta_session_service_check_idp_intent.rbs new file mode 100644 index 00000000..aff3798a --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_check_idp_intent.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSessionServiceCheckIDPIntent < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_intent_id: String? + attr_reader idp_intent_token: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_check_otp.rbs b/sig/zitadel/client/models/beta_session_service_check_otp.rbs new file mode 100644 index 00000000..7b305b1a --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_check_otp.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceCheckOTP < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader code: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_check_password.rbs b/sig/zitadel/client/models/beta_session_service_check_password.rbs new file mode 100644 index 00000000..2fd26770 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_check_password.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceCheckPassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader password: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_check_totp.rbs b/sig/zitadel/client/models/beta_session_service_check_totp.rbs new file mode 100644 index 00000000..80919c10 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_check_totp.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceCheckTOTP < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader code: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_check_user.rbs b/sig/zitadel/client/models/beta_session_service_check_user.rbs new file mode 100644 index 00000000..cec1f166 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_check_user.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSessionServiceCheckUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_name: String? + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_check_web_auth_n.rbs b/sig/zitadel/client/models/beta_session_service_check_web_auth_n.rbs new file mode 100644 index 00000000..ef5e313e --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_check_web_auth_n.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceCheckWebAuthN < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader credential_assertion_data: Hash[String, untyped]? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_checks.rbs b/sig/zitadel/client/models/beta_session_service_checks.rbs new file mode 100644 index 00000000..a4990419 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_checks.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaSessionServiceChecks < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user: BetaSessionServiceCheckUser? + attr_reader password: BetaSessionServiceCheckPassword? + attr_reader web_auth_n: BetaSessionServiceCheckWebAuthN? + attr_reader idp_intent: BetaSessionServiceCheckIDPIntent? + attr_reader totp: BetaSessionServiceCheckTOTP? + attr_reader otp_sms: BetaSessionServiceCheckOTP? + attr_reader otp_email: BetaSessionServiceCheckOTP? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_connect_error.rbs b/sig/zitadel/client/models/beta_session_service_connect_error.rbs new file mode 100644 index 00000000..3e4c356a --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSessionServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaSessionServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_create_session_request.rbs b/sig/zitadel/client/models/beta_session_service_create_session_request.rbs new file mode 100644 index 00000000..5b0d08aa --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_create_session_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaSessionServiceCreateSessionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader checks: BetaSessionServiceChecks? + attr_reader metadata: Hash[String, String]? + attr_reader challenges: BetaSessionServiceRequestChallenges? + attr_reader user_agent: BetaSessionServiceUserAgent? + attr_reader lifetime: ISO8601::Duration? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_create_session_response.rbs b/sig/zitadel/client/models/beta_session_service_create_session_response.rbs new file mode 100644 index 00000000..b7441530 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_create_session_response.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSessionServiceCreateSessionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSessionServiceDetails? + attr_reader session_id: String? + attr_reader session_token: String? + attr_reader challenges: BetaSessionServiceChallenges? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_creation_date_query.rbs b/sig/zitadel/client/models/beta_session_service_creation_date_query.rbs new file mode 100644 index 00000000..ad4feb15 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_creation_date_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSessionServiceCreationDateQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader method: BetaSessionServiceTimestampQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_delete_session_request.rbs b/sig/zitadel/client/models/beta_session_service_delete_session_request.rbs new file mode 100644 index 00000000..b5837d45 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_delete_session_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSessionServiceDeleteSessionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session_id: String? + attr_reader session_token: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_delete_session_response.rbs b/sig/zitadel/client/models/beta_session_service_delete_session_response.rbs new file mode 100644 index 00000000..a11c3e2c --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_delete_session_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceDeleteSessionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSessionServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_details.rbs b/sig/zitadel/client/models/beta_session_service_details.rbs new file mode 100644 index 00000000..8c434884 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSessionServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_factors.rbs b/sig/zitadel/client/models/beta_session_service_factors.rbs new file mode 100644 index 00000000..9cf00f2b --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_factors.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaSessionServiceFactors < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user: BetaSessionServiceUserFactor? + attr_reader password: BetaSessionServicePasswordFactor? + attr_reader web_auth_n: BetaSessionServiceWebAuthNFactor? + attr_reader intent: BetaSessionServiceIntentFactor? + attr_reader totp: BetaSessionServiceTOTPFactor? + attr_reader otp_sms: BetaSessionServiceOTPFactor? + attr_reader otp_email: BetaSessionServiceOTPFactor? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_get_session_request.rbs b/sig/zitadel/client/models/beta_session_service_get_session_request.rbs new file mode 100644 index 00000000..7ae09915 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_get_session_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSessionServiceGetSessionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session_id: String? + attr_reader session_token: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_get_session_response.rbs b/sig/zitadel/client/models/beta_session_service_get_session_response.rbs new file mode 100644 index 00000000..8becb355 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_get_session_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceGetSessionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session: BetaSessionServiceSession? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_header_values.rbs b/sig/zitadel/client/models/beta_session_service_header_values.rbs new file mode 100644 index 00000000..a3f50796 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_header_values.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceHeaderValues < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader values: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_ids_query.rbs b/sig/zitadel/client/models/beta_session_service_ids_query.rbs new file mode 100644 index 00000000..fb9c60d8 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_ids_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceIDsQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_intent_factor.rbs b/sig/zitadel/client/models/beta_session_service_intent_factor.rbs new file mode 100644 index 00000000..11d626f9 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_intent_factor.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceIntentFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_list_details.rbs b/sig/zitadel/client/models/beta_session_service_list_details.rbs new file mode 100644 index 00000000..6bb566f9 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_list_details.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSessionServiceListDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader processed_sequence: untyped? + attr_reader timestamp: Time? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_list_query.rbs b/sig/zitadel/client/models/beta_session_service_list_query.rbs new file mode 100644 index 00000000..fded914d --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_list_query.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSessionServiceListQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_list_sessions_request.rbs b/sig/zitadel/client/models/beta_session_service_list_sessions_request.rbs new file mode 100644 index 00000000..cc9b65ef --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_list_sessions_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSessionServiceListSessionsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader query: BetaSessionServiceListQuery? + attr_reader queries: Array[BetaSessionServiceSearchQuery]? + attr_reader sorting_column: BetaSessionServiceSessionFieldName? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_list_sessions_response.rbs b/sig/zitadel/client/models/beta_session_service_list_sessions_response.rbs new file mode 100644 index 00000000..740bf740 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_list_sessions_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSessionServiceListSessionsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSessionServiceListDetails? + attr_reader sessions: Array[BetaSessionServiceSession]? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_otp_email.rbs b/sig/zitadel/client/models/beta_session_service_otp_email.rbs new file mode 100644 index 00000000..c22e1c83 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_otp_email.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSessionServiceOTPEmail < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader return_code: untyped? + attr_reader send_code: BetaSessionServiceSendCode? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_otp_factor.rbs b/sig/zitadel/client/models/beta_session_service_otp_factor.rbs new file mode 100644 index 00000000..da141b0f --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_otp_factor.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceOTPFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_otpsms.rbs b/sig/zitadel/client/models/beta_session_service_otpsms.rbs new file mode 100644 index 00000000..e8823f70 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_otpsms.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceOTPSMS < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader return_code: bool? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_password_factor.rbs b/sig/zitadel/client/models/beta_session_service_password_factor.rbs new file mode 100644 index 00000000..05949421 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_password_factor.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServicePasswordFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_request_challenges.rbs b/sig/zitadel/client/models/beta_session_service_request_challenges.rbs new file mode 100644 index 00000000..fb8513f3 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_request_challenges.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSessionServiceRequestChallenges < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader web_auth_n: BetaSessionServiceWebAuthN? + attr_reader otp_sms: BetaSessionServiceOTPSMS? + attr_reader otp_email: BetaSessionServiceOTPEmail? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_search_query.rbs b/sig/zitadel/client/models/beta_session_service_search_query.rbs new file mode 100644 index 00000000..2ef7be0d --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_search_query.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSessionServiceSearchQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date_query: BetaSessionServiceCreationDateQuery? + attr_reader ids_query: BetaSessionServiceIDsQuery? + attr_reader user_id_query: BetaSessionServiceUserIDQuery? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_send_code.rbs b/sig/zitadel/client/models/beta_session_service_send_code.rbs new file mode 100644 index 00000000..c68087b9 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_send_code.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceSendCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_session.rbs b/sig/zitadel/client/models/beta_session_service_session.rbs new file mode 100644 index 00000000..03a0074f --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_session.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class BetaSessionServiceSession < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader sequence: untyped? + attr_reader factors: BetaSessionServiceFactors? + attr_reader metadata: Hash[String, String]? + attr_reader user_agent: BetaSessionServiceUserAgent? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_session_field_name.rbs b/sig/zitadel/client/models/beta_session_service_session_field_name.rbs new file mode 100644 index 00000000..b21f20fe --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_session_field_name.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceSessionFieldName + SESSION_FIELD_NAME_UNSPECIFIED: String + SESSION_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_set_session_request.rbs b/sig/zitadel/client/models/beta_session_service_set_session_request.rbs new file mode 100644 index 00000000..2634bacf --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_set_session_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaSessionServiceSetSessionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session_id: String? + attr_reader session_token: String? + attr_reader checks: BetaSessionServiceChecks? + attr_reader metadata: Hash[String, String]? + attr_reader challenges: BetaSessionServiceRequestChallenges? + attr_reader lifetime: ISO8601::Duration? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_set_session_response.rbs b/sig/zitadel/client/models/beta_session_service_set_session_response.rbs new file mode 100644 index 00000000..4e10c7cf --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_set_session_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSessionServiceSetSessionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSessionServiceDetails? + attr_reader session_token: String? + attr_reader challenges: BetaSessionServiceChallenges? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_timestamp_query_method.rbs b/sig/zitadel/client/models/beta_session_service_timestamp_query_method.rbs new file mode 100644 index 00000000..483c97f6 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_timestamp_query_method.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSessionServiceTimestampQueryMethod + TIMESTAMP_QUERY_METHOD_EQUALS: String + TIMESTAMP_QUERY_METHOD_GREATER: String + TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS: String + TIMESTAMP_QUERY_METHOD_LESS: String + TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_totp_factor.rbs b/sig/zitadel/client/models/beta_session_service_totp_factor.rbs new file mode 100644 index 00000000..198855f2 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_totp_factor.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceTOTPFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_user_agent.rbs b/sig/zitadel/client/models/beta_session_service_user_agent.rbs new file mode 100644 index 00000000..2241ff05 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_user_agent.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSessionServiceUserAgent < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader fingerprint_id: String? + attr_reader ip: String? + attr_reader description: String? + attr_reader header: Hash[String, BetaSessionServiceHeaderValues]? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_user_factor.rbs b/sig/zitadel/client/models/beta_session_service_user_factor.rbs new file mode 100644 index 00000000..27fb75f5 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_user_factor.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaSessionServiceUserFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + attr_reader id: String? + attr_reader login_name: String? + attr_reader display_name: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_user_id_query.rbs b/sig/zitadel/client/models/beta_session_service_user_id_query.rbs new file mode 100644 index 00000000..1f159482 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_user_id_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSessionServiceUserIDQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_user_verification_requirement.rbs b/sig/zitadel/client/models/beta_session_service_user_verification_requirement.rbs new file mode 100644 index 00000000..55f68755 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_user_verification_requirement.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSessionServiceUserVerificationRequirement + USER_VERIFICATION_REQUIREMENT_UNSPECIFIED: String + USER_VERIFICATION_REQUIREMENT_REQUIRED: String + USER_VERIFICATION_REQUIREMENT_PREFERRED: String + USER_VERIFICATION_REQUIREMENT_DISCOURAGED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_web_auth_n.rbs b/sig/zitadel/client/models/beta_session_service_web_auth_n.rbs new file mode 100644 index 00000000..289a2ba4 --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_web_auth_n.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSessionServiceWebAuthN < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain: String? + attr_reader user_verification_requirement: BetaSessionServiceUserVerificationRequirement? + end +end diff --git a/sig/zitadel/client/models/beta_session_service_web_auth_n_factor.rbs b/sig/zitadel/client/models/beta_session_service_web_auth_n_factor.rbs new file mode 100644 index 00000000..5f5aac0f --- /dev/null +++ b/sig/zitadel/client/models/beta_session_service_web_auth_n_factor.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSessionServiceWebAuthNFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + attr_reader user_verified: bool? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_any.rbs b/sig/zitadel/client/models/beta_settings_service_any.rbs new file mode 100644 index 00000000..297672b7 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSettingsServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_branding_settings.rbs b/sig/zitadel/client/models/beta_settings_service_branding_settings.rbs new file mode 100644 index 00000000..745f3580 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_branding_settings.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaSettingsServiceBrandingSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader light_theme: BetaSettingsServiceTheme? + attr_reader dark_theme: BetaSettingsServiceTheme? + attr_reader font_url: String? + attr_reader hide_login_name_suffix: bool? + attr_reader disable_watermark: bool? + attr_reader resource_owner_type: BetaSettingsServiceResourceOwnerType? + attr_reader theme_mode: BetaSettingsServiceThemeMode? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_connect_error.rbs b/sig/zitadel/client/models/beta_settings_service_connect_error.rbs new file mode 100644 index 00000000..5083a546 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSettingsServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaSettingsServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_details.rbs b/sig/zitadel/client/models/beta_settings_service_details.rbs new file mode 100644 index 00000000..02681d1a --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSettingsServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_domain_settings.rbs b/sig/zitadel/client/models/beta_settings_service_domain_settings.rbs new file mode 100644 index 00000000..2d925477 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_domain_settings.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSettingsServiceDomainSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_name_includes_domain: bool? + attr_reader require_org_domain_verification: bool? + attr_reader smtp_sender_address_matches_instance_domain: bool? + attr_reader resource_owner_type: BetaSettingsServiceResourceOwnerType? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rbs b/sig/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rbs new file mode 100644 index 00000000..5af84f9d --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_embedded_iframe_settings.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceEmbeddedIframeSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader enabled: bool? + attr_reader allowed_origins: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rbs b/sig/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rbs new file mode 100644 index 00000000..66e1b9b2 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_active_identity_providers_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetActiveIdentityProvidersRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: BetaSettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rbs new file mode 100644 index 00000000..71298612 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_active_identity_providers_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetActiveIdentityProvidersResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceListDetails? + attr_reader identity_providers: Array[BetaSettingsServiceIdentityProvider]? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_branding_settings_request.rbs b/sig/zitadel/client/models/beta_settings_service_get_branding_settings_request.rbs new file mode 100644 index 00000000..d92ddd37 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_branding_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetBrandingSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: BetaSettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_branding_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_branding_settings_response.rbs new file mode 100644 index 00000000..4f85c91b --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_branding_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetBrandingSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceDetails? + attr_reader settings: BetaSettingsServiceBrandingSettings? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_domain_settings_request.rbs b/sig/zitadel/client/models/beta_settings_service_get_domain_settings_request.rbs new file mode 100644 index 00000000..ac96b0e2 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_domain_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetDomainSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: BetaSettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_domain_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_domain_settings_response.rbs new file mode 100644 index 00000000..cbe49e42 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_domain_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetDomainSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceDetails? + attr_reader settings: BetaSettingsServiceDomainSettings? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_general_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_general_settings_response.rbs new file mode 100644 index 00000000..e2389912 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_general_settings_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetGeneralSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader default_org_id: String? + attr_reader default_language: String? + attr_reader supported_languages: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rbs b/sig/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rbs new file mode 100644 index 00000000..83deeccf --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetLegalAndSupportSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: BetaSettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rbs new file mode 100644 index 00000000..d3e0ac52 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_legal_and_support_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetLegalAndSupportSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceDetails? + attr_reader settings: BetaSettingsServiceLegalAndSupportSettings? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rbs b/sig/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rbs new file mode 100644 index 00000000..39ca8d4a --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_lockout_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetLockoutSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: BetaSettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rbs new file mode 100644 index 00000000..37b2957c --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_lockout_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetLockoutSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceDetails? + attr_reader settings: BetaSettingsServiceLockoutSettings? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_login_settings_request.rbs b/sig/zitadel/client/models/beta_settings_service_get_login_settings_request.rbs new file mode 100644 index 00000000..6051d93b --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_login_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetLoginSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: BetaSettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_login_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_login_settings_response.rbs new file mode 100644 index 00000000..22ad7638 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_login_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetLoginSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceDetails? + attr_reader settings: BetaSettingsServiceLoginSettings? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rbs b/sig/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rbs new file mode 100644 index 00000000..1abd0e21 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_password_complexity_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetPasswordComplexitySettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: BetaSettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rbs new file mode 100644 index 00000000..f484e9fb --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_password_complexity_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetPasswordComplexitySettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceDetails? + attr_reader settings: BetaSettingsServicePasswordComplexitySettings? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rbs b/sig/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rbs new file mode 100644 index 00000000..b7faea20 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_password_expiry_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetPasswordExpirySettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: BetaSettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rbs new file mode 100644 index 00000000..2b71f541 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_password_expiry_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetPasswordExpirySettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceDetails? + attr_reader settings: BetaSettingsServicePasswordExpirySettings? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_get_security_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_get_security_settings_response.rbs new file mode 100644 index 00000000..e4c57d8d --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_get_security_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceGetSecuritySettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceDetails? + attr_reader settings: BetaSettingsServiceSecuritySettings? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_identity_provider.rbs b/sig/zitadel/client/models/beta_settings_service_identity_provider.rbs new file mode 100644 index 00000000..62ca15c3 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_identity_provider.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSettingsServiceIdentityProvider < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + attr_reader type: BetaSettingsServiceIdentityProviderType? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_identity_provider_type.rbs b/sig/zitadel/client/models/beta_settings_service_identity_provider_type.rbs new file mode 100644 index 00000000..1898736b --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_identity_provider_type.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class BetaSettingsServiceIdentityProviderType + IDENTITY_PROVIDER_TYPE_UNSPECIFIED: String + IDENTITY_PROVIDER_TYPE_OIDC: String + IDENTITY_PROVIDER_TYPE_JWT: String + IDENTITY_PROVIDER_TYPE_LDAP: String + IDENTITY_PROVIDER_TYPE_OAUTH: String + IDENTITY_PROVIDER_TYPE_AZURE_AD: String + IDENTITY_PROVIDER_TYPE_GITHUB: String + IDENTITY_PROVIDER_TYPE_GITHUB_ES: String + IDENTITY_PROVIDER_TYPE_GITLAB: String + IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED: String + IDENTITY_PROVIDER_TYPE_GOOGLE: String + IDENTITY_PROVIDER_TYPE_SAML: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_legal_and_support_settings.rbs b/sig/zitadel/client/models/beta_settings_service_legal_and_support_settings.rbs new file mode 100644 index 00000000..a2434a3e --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_legal_and_support_settings.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class BetaSettingsServiceLegalAndSupportSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader tos_link: String? + attr_reader privacy_policy_link: String? + attr_reader help_link: String? + attr_reader support_email: String? + attr_reader resource_owner_type: BetaSettingsServiceResourceOwnerType? + attr_reader docs_link: String? + attr_reader custom_link: String? + attr_reader custom_link_text: String? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_list_details.rbs b/sig/zitadel/client/models/beta_settings_service_list_details.rbs new file mode 100644 index 00000000..9bf4a6b8 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_list_details.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSettingsServiceListDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader processed_sequence: untyped? + attr_reader timestamp: Time? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_lockout_settings.rbs b/sig/zitadel/client/models/beta_settings_service_lockout_settings.rbs new file mode 100644 index 00000000..c64f2378 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_lockout_settings.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSettingsServiceLockoutSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader max_password_attempts: untyped? + attr_reader resource_owner_type: BetaSettingsServiceResourceOwnerType? + attr_reader max_otp_attempts: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_login_settings.rbs b/sig/zitadel/client/models/beta_settings_service_login_settings.rbs new file mode 100644 index 00000000..c0ed81bb --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_login_settings.rbs @@ -0,0 +1,28 @@ +module Zitadel::Client::Models + class BetaSettingsServiceLoginSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader allow_username_password: bool? + attr_reader allow_register: bool? + attr_reader allow_external_idp: bool? + attr_reader force_mfa: bool? + attr_reader passkeys_type: BetaSettingsServicePasskeysType? + attr_reader hide_password_reset: bool? + attr_reader ignore_unknown_usernames: bool? + attr_reader default_redirect_uri: String? + attr_reader password_check_lifetime: ISO8601::Duration? + attr_reader external_login_check_lifetime: ISO8601::Duration? + attr_reader mfa_init_skip_lifetime: ISO8601::Duration? + attr_reader second_factor_check_lifetime: ISO8601::Duration? + attr_reader multi_factor_check_lifetime: ISO8601::Duration? + attr_reader second_factors: Array[BetaSettingsServiceSecondFactorType]? + attr_reader multi_factors: Array[BetaSettingsServiceMultiFactorType]? + attr_reader allow_domain_discovery: bool? + attr_reader disable_login_with_email: bool? + attr_reader disable_login_with_phone: bool? + attr_reader resource_owner_type: BetaSettingsServiceResourceOwnerType? + attr_reader force_mfa_local_only: bool? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_multi_factor_type.rbs b/sig/zitadel/client/models/beta_settings_service_multi_factor_type.rbs new file mode 100644 index 00000000..c2cf784b --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_multi_factor_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceMultiFactorType + MULTI_FACTOR_TYPE_UNSPECIFIED: String + MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_passkeys_type.rbs b/sig/zitadel/client/models/beta_settings_service_passkeys_type.rbs new file mode 100644 index 00000000..3a333942 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_passkeys_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServicePasskeysType + PASSKEYS_TYPE_NOT_ALLOWED: String + PASSKEYS_TYPE_ALLOWED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_password_complexity_settings.rbs b/sig/zitadel/client/models/beta_settings_service_password_complexity_settings.rbs new file mode 100644 index 00000000..4280d686 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_password_complexity_settings.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaSettingsServicePasswordComplexitySettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader min_length: untyped? + attr_reader requires_uppercase: bool? + attr_reader requires_lowercase: bool? + attr_reader requires_number: bool? + attr_reader requires_symbol: bool? + attr_reader resource_owner_type: BetaSettingsServiceResourceOwnerType? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_password_expiry_settings.rbs b/sig/zitadel/client/models/beta_settings_service_password_expiry_settings.rbs new file mode 100644 index 00000000..5cd4bc1b --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_password_expiry_settings.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSettingsServicePasswordExpirySettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader max_age_days: untyped? + attr_reader expire_warn_days: untyped? + attr_reader resource_owner_type: BetaSettingsServiceResourceOwnerType? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_request_context.rbs b/sig/zitadel/client/models/beta_settings_service_request_context.rbs new file mode 100644 index 00000000..f58f54b3 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_request_context.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceRequestContext < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance: bool? + attr_reader org_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_resource_owner_type.rbs b/sig/zitadel/client/models/beta_settings_service_resource_owner_type.rbs new file mode 100644 index 00000000..80fd224c --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_resource_owner_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceResourceOwnerType + RESOURCE_OWNER_TYPE_UNSPECIFIED: String + RESOURCE_OWNER_TYPE_INSTANCE: String + RESOURCE_OWNER_TYPE_ORG: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_second_factor_type.rbs b/sig/zitadel/client/models/beta_settings_service_second_factor_type.rbs new file mode 100644 index 00000000..73b045bf --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_second_factor_type.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaSettingsServiceSecondFactorType + SECOND_FACTOR_TYPE_UNSPECIFIED: String + SECOND_FACTOR_TYPE_OTP: String + SECOND_FACTOR_TYPE_U2_F: String + SECOND_FACTOR_TYPE_OTP_EMAIL: String + SECOND_FACTOR_TYPE_OTP_SMS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_security_settings.rbs b/sig/zitadel/client/models/beta_settings_service_security_settings.rbs new file mode 100644 index 00000000..d870d921 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_security_settings.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceSecuritySettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader embedded_iframe: BetaSettingsServiceEmbeddedIframeSettings? + attr_reader enable_impersonation: bool? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_set_security_settings_request.rbs b/sig/zitadel/client/models/beta_settings_service_set_security_settings_request.rbs new file mode 100644 index 00000000..98d78aa5 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_set_security_settings_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaSettingsServiceSetSecuritySettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader embedded_iframe: BetaSettingsServiceEmbeddedIframeSettings? + attr_reader enable_impersonation: bool? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_set_security_settings_response.rbs b/sig/zitadel/client/models/beta_settings_service_set_security_settings_response.rbs new file mode 100644 index 00000000..86bd79b7 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_set_security_settings_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaSettingsServiceSetSecuritySettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaSettingsServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_theme.rbs b/sig/zitadel/client/models/beta_settings_service_theme.rbs new file mode 100644 index 00000000..cd564687 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_theme.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaSettingsServiceTheme < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader primary_color: String? + attr_reader background_color: String? + attr_reader warn_color: String? + attr_reader font_color: String? + attr_reader logo_url: String? + attr_reader icon_url: String? + end +end diff --git a/sig/zitadel/client/models/beta_settings_service_theme_mode.rbs b/sig/zitadel/client/models/beta_settings_service_theme_mode.rbs new file mode 100644 index 00000000..b60991d5 --- /dev/null +++ b/sig/zitadel/client/models/beta_settings_service_theme_mode.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaSettingsServiceThemeMode + THEME_MODE_UNSPECIFIED: String + THEME_MODE_AUTO: String + THEME_MODE_LIGHT: String + THEME_MODE_DARK: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_telemetry_service_any.rbs b/sig/zitadel/client/models/beta_telemetry_service_any.rbs new file mode 100644 index 00000000..2502190e --- /dev/null +++ b/sig/zitadel/client/models/beta_telemetry_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaTelemetryServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_telemetry_service_connect_error.rbs b/sig/zitadel/client/models/beta_telemetry_service_connect_error.rbs new file mode 100644 index 00000000..006716ed --- /dev/null +++ b/sig/zitadel/client/models/beta_telemetry_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaTelemetryServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaTelemetryServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_telemetry_service_count_parent_type.rbs b/sig/zitadel/client/models/beta_telemetry_service_count_parent_type.rbs new file mode 100644 index 00000000..77930ba6 --- /dev/null +++ b/sig/zitadel/client/models/beta_telemetry_service_count_parent_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaTelemetryServiceCountParentType + COUNT_PARENT_TYPE_UNSPECIFIED: String + COUNT_PARENT_TYPE_INSTANCE: String + COUNT_PARENT_TYPE_ORGANIZATION: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_telemetry_service_instance_information.rbs b/sig/zitadel/client/models/beta_telemetry_service_instance_information.rbs new file mode 100644 index 00000000..343a742a --- /dev/null +++ b/sig/zitadel/client/models/beta_telemetry_service_instance_information.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaTelemetryServiceInstanceInformation < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader domains: Array[String]? + attr_reader created_at: Time? + end +end diff --git a/sig/zitadel/client/models/beta_telemetry_service_report_base_information_request.rbs b/sig/zitadel/client/models/beta_telemetry_service_report_base_information_request.rbs new file mode 100644 index 00000000..c0806534 --- /dev/null +++ b/sig/zitadel/client/models/beta_telemetry_service_report_base_information_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaTelemetryServiceReportBaseInformationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader system_id: String? + attr_reader version: String? + attr_reader instances: Array[BetaTelemetryServiceInstanceInformation]? + end +end diff --git a/sig/zitadel/client/models/beta_telemetry_service_report_base_information_response.rbs b/sig/zitadel/client/models/beta_telemetry_service_report_base_information_response.rbs new file mode 100644 index 00000000..b516a3aa --- /dev/null +++ b/sig/zitadel/client/models/beta_telemetry_service_report_base_information_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaTelemetryServiceReportBaseInformationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader report_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_telemetry_service_report_resource_counts_request.rbs b/sig/zitadel/client/models/beta_telemetry_service_report_resource_counts_request.rbs new file mode 100644 index 00000000..8bf8e6ef --- /dev/null +++ b/sig/zitadel/client/models/beta_telemetry_service_report_resource_counts_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaTelemetryServiceReportResourceCountsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader system_id: String? + attr_reader report_id: String? + attr_reader resource_counts: Array[BetaTelemetryServiceResourceCount]? + end +end diff --git a/sig/zitadel/client/models/beta_telemetry_service_report_resource_counts_response.rbs b/sig/zitadel/client/models/beta_telemetry_service_report_resource_counts_response.rbs new file mode 100644 index 00000000..ddbbc41b --- /dev/null +++ b/sig/zitadel/client/models/beta_telemetry_service_report_resource_counts_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaTelemetryServiceReportResourceCountsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader report_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_telemetry_service_resource_count.rbs b/sig/zitadel/client/models/beta_telemetry_service_resource_count.rbs new file mode 100644 index 00000000..009e9bb7 --- /dev/null +++ b/sig/zitadel/client/models/beta_telemetry_service_resource_count.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaTelemetryServiceResourceCount < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader parent_type: BetaTelemetryServiceCountParentType? + attr_reader parent_id: String? + attr_reader resource_name: String? + attr_reader table_name: String? + attr_reader updated_at: Time? + attr_reader amount: Integer? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_access_token_type.rbs b/sig/zitadel/client/models/beta_user_service_access_token_type.rbs new file mode 100644 index 00000000..bee2627a --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_access_token_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceAccessTokenType + ACCESS_TOKEN_TYPE_BEARER: String + ACCESS_TOKEN_TYPE_JWT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_add_human_user_request.rbs b/sig/zitadel/client/models/beta_user_service_add_human_user_request.rbs new file mode 100644 index 00000000..b24ae4e2 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_add_human_user_request.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class BetaUserServiceAddHumanUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader username: String? + attr_reader organization: BetaUserServiceOrganization? + attr_reader profile: BetaUserServiceSetHumanProfile? + attr_reader email: BetaUserServiceSetHumanEmail? + attr_reader phone: BetaUserServiceSetHumanPhone? + attr_reader metadata: Array[BetaUserServiceSetMetadataEntry]? + attr_reader idp_links: Array[BetaUserServiceIDPLink]? + attr_reader totp_secret: String? + attr_reader hashed_password: BetaUserServiceHashedPassword? + attr_reader password: BetaUserServicePassword? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_add_human_user_response.rbs b/sig/zitadel/client/models/beta_user_service_add_human_user_response.rbs new file mode 100644 index 00000000..c04e7887 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_add_human_user_response.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceAddHumanUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader details: BetaUserServiceDetails? + attr_reader email_code: String? + attr_reader phone_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_add_idp_link_request.rbs b/sig/zitadel/client/models/beta_user_service_add_idp_link_request.rbs new file mode 100644 index 00000000..b3324446 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_add_idp_link_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceAddIDPLinkRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader idp_link: BetaUserServiceIDPLink? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_add_idp_link_response.rbs b/sig/zitadel/client/models/beta_user_service_add_idp_link_response.rbs new file mode 100644 index 00000000..72e5b62e --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_add_idp_link_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceAddIDPLinkResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_add_otp_email_request.rbs b/sig/zitadel/client/models/beta_user_service_add_otp_email_request.rbs new file mode 100644 index 00000000..e274d225 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_add_otp_email_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceAddOTPEmailRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_add_otp_email_response.rbs b/sig/zitadel/client/models/beta_user_service_add_otp_email_response.rbs new file mode 100644 index 00000000..35387e4d --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_add_otp_email_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceAddOTPEmailResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_add_otpsms_request.rbs b/sig/zitadel/client/models/beta_user_service_add_otpsms_request.rbs new file mode 100644 index 00000000..69afc55e --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_add_otpsms_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceAddOTPSMSRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_add_otpsms_response.rbs b/sig/zitadel/client/models/beta_user_service_add_otpsms_response.rbs new file mode 100644 index 00000000..ec7851cf --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_add_otpsms_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceAddOTPSMSResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_and_query.rbs b/sig/zitadel/client/models/beta_user_service_and_query.rbs new file mode 100644 index 00000000..49b4bbbb --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_and_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceAndQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader queries: Array[BetaUserServiceSearchQuery]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_any.rbs b/sig/zitadel/client/models/beta_user_service_any.rbs new file mode 100644 index 00000000..cbd1b768 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_authentication_method_type.rbs b/sig/zitadel/client/models/beta_user_service_authentication_method_type.rbs new file mode 100644 index 00000000..c4b7692d --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_authentication_method_type.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaUserServiceAuthenticationMethodType + AUTHENTICATION_METHOD_TYPE_UNSPECIFIED: String + AUTHENTICATION_METHOD_TYPE_PASSWORD: String + AUTHENTICATION_METHOD_TYPE_PASSKEY: String + AUTHENTICATION_METHOD_TYPE_IDP: String + AUTHENTICATION_METHOD_TYPE_TOTP: String + AUTHENTICATION_METHOD_TYPE_U2_F: String + AUTHENTICATION_METHOD_TYPE_OTP_SMS: String + AUTHENTICATION_METHOD_TYPE_OTP_EMAIL: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_connect_error.rbs b/sig/zitadel/client/models/beta_user_service_connect_error.rbs new file mode 100644 index 00000000..9533adc0 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaUserServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rbs b/sig/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rbs new file mode 100644 index 00000000..bb521833 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_create_passkey_registration_link_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceCreatePasskeyRegistrationLinkRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_link: BetaUserServiceSendPasskeyRegistrationLink? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rbs b/sig/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rbs new file mode 100644 index 00000000..157cb685 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_create_passkey_registration_link_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceCreatePasskeyRegistrationLinkResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader code: BetaUserServicePasskeyRegistrationCode? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_deactivate_user_request.rbs b/sig/zitadel/client/models/beta_user_service_deactivate_user_request.rbs new file mode 100644 index 00000000..5fe1cd1c --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_deactivate_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceDeactivateUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_deactivate_user_response.rbs b/sig/zitadel/client/models/beta_user_service_deactivate_user_response.rbs new file mode 100644 index 00000000..e9a44028 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_deactivate_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceDeactivateUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_delete_user_request.rbs b/sig/zitadel/client/models/beta_user_service_delete_user_request.rbs new file mode 100644 index 00000000..77b46736 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_delete_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceDeleteUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_delete_user_response.rbs b/sig/zitadel/client/models/beta_user_service_delete_user_response.rbs new file mode 100644 index 00000000..d7707d05 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_delete_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceDeleteUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_details.rbs b/sig/zitadel/client/models/beta_user_service_details.rbs new file mode 100644 index 00000000..c9d0a229 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_display_name_query.rbs b/sig/zitadel/client/models/beta_user_service_display_name_query.rbs new file mode 100644 index 00000000..8c561ac2 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_display_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceDisplayNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name: String? + attr_reader method: BetaUserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_email_query.rbs b/sig/zitadel/client/models/beta_user_service_email_query.rbs new file mode 100644 index 00000000..7ca2cd77 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_email_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceEmailQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader email_address: String? + attr_reader method: BetaUserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_first_name_query.rbs b/sig/zitadel/client/models/beta_user_service_first_name_query.rbs new file mode 100644 index 00000000..599449c5 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_first_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceFirstNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader first_name: String? + attr_reader method: BetaUserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_form_data.rbs b/sig/zitadel/client/models/beta_user_service_form_data.rbs new file mode 100644 index 00000000..f20090dd --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_form_data.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceFormData < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url: String? + attr_reader fields: Hash[String, String]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_gender.rbs b/sig/zitadel/client/models/beta_user_service_gender.rbs new file mode 100644 index 00000000..029d8698 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_gender.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceGender + GENDER_UNSPECIFIED: String + GENDER_FEMALE: String + GENDER_MALE: String + GENDER_DIVERSE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_get_user_by_id_request.rbs b/sig/zitadel/client/models/beta_user_service_get_user_by_id_request.rbs new file mode 100644 index 00000000..48c8bbf5 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_get_user_by_id_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceGetUserByIDRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_get_user_by_id_response.rbs b/sig/zitadel/client/models/beta_user_service_get_user_by_id_response.rbs new file mode 100644 index 00000000..49f11847 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_get_user_by_id_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceGetUserByIDResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader user: BetaUserServiceUser? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_hashed_password.rbs b/sig/zitadel/client/models/beta_user_service_hashed_password.rbs new file mode 100644 index 00000000..ef88672f --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_hashed_password.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceHashedPassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader hash: String? + attr_reader change_required: bool? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_human_email.rbs b/sig/zitadel/client/models/beta_user_service_human_email.rbs new file mode 100644 index 00000000..780ac1b9 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_human_email.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceHumanEmail < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader email: String? + attr_reader is_verified: bool? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_human_phone.rbs b/sig/zitadel/client/models/beta_user_service_human_phone.rbs new file mode 100644 index 00000000..06828f1f --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_human_phone.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceHumanPhone < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader phone: String? + attr_reader is_verified: bool? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_human_profile.rbs b/sig/zitadel/client/models/beta_user_service_human_profile.rbs new file mode 100644 index 00000000..93db1047 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_human_profile.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaUserServiceHumanProfile < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader given_name: String? + attr_reader family_name: String? + attr_reader nick_name: String? + attr_reader display_name: String? + attr_reader preferred_language: String? + attr_reader gender: BetaUserServiceGender? + attr_reader avatar_url: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_human_user.rbs b/sig/zitadel/client/models/beta_user_service_human_user.rbs new file mode 100644 index 00000000..fcff5110 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_human_user.rbs @@ -0,0 +1,18 @@ +module Zitadel::Client::Models + class BetaUserServiceHumanUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader state: BetaUserServiceUserState? + attr_reader username: String? + attr_reader login_names: Array[String]? + attr_reader preferred_login_name: String? + attr_reader profile: BetaUserServiceHumanProfile? + attr_reader email: BetaUserServiceHumanEmail? + attr_reader phone: BetaUserServiceHumanPhone? + attr_reader password_change_required: bool? + attr_reader password_changed: Time? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_idp_information.rbs b/sig/zitadel/client/models/beta_user_service_idp_information.rbs new file mode 100644 index 00000000..44e52192 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_idp_information.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaUserServiceIDPInformation < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_id: String? + attr_reader user_id: String? + attr_reader user_name: String? + attr_reader raw_information: Hash[String, untyped]? + attr_reader ldap: BetaUserServiceIDPLDAPAccessInformation? + attr_reader oauth: BetaUserServiceIDPOAuthAccessInformation? + attr_reader saml: BetaUserServiceIDPSAMLAccessInformation? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_idp_intent.rbs b/sig/zitadel/client/models/beta_user_service_idp_intent.rbs new file mode 100644 index 00000000..01252a11 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_idp_intent.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceIDPIntent < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_intent_id: String? + attr_reader idp_intent_token: String? + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_idp_link.rbs b/sig/zitadel/client/models/beta_user_service_idp_link.rbs new file mode 100644 index 00000000..a7125d70 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_idp_link.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceIDPLink < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_id: String? + attr_reader user_id: String? + attr_reader user_name: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_idpldap_access_information.rbs b/sig/zitadel/client/models/beta_user_service_idpldap_access_information.rbs new file mode 100644 index 00000000..650325d5 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_idpldap_access_information.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceIDPLDAPAccessInformation < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader attributes: Hash[String, untyped]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_idpo_auth_access_information.rbs b/sig/zitadel/client/models/beta_user_service_idpo_auth_access_information.rbs new file mode 100644 index 00000000..9c8cc937 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_idpo_auth_access_information.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceIDPOAuthAccessInformation < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader access_token: String? + attr_reader id_token: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_idpsaml_access_information.rbs b/sig/zitadel/client/models/beta_user_service_idpsaml_access_information.rbs new file mode 100644 index 00000000..e6e05e13 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_idpsaml_access_information.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceIDPSAMLAccessInformation < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader assertion: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_in_user_emails_query.rbs b/sig/zitadel/client/models/beta_user_service_in_user_emails_query.rbs new file mode 100644 index 00000000..7407df6c --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_in_user_emails_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceInUserEmailsQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_emails: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_in_user_id_query.rbs b/sig/zitadel/client/models/beta_user_service_in_user_id_query.rbs new file mode 100644 index 00000000..8030154b --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_in_user_id_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceInUserIDQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_last_name_query.rbs b/sig/zitadel/client/models/beta_user_service_last_name_query.rbs new file mode 100644 index 00000000..ba7fe636 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_last_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceLastNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader last_name: String? + attr_reader method: BetaUserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_ldap_credentials.rbs b/sig/zitadel/client/models/beta_user_service_ldap_credentials.rbs new file mode 100644 index 00000000..8fb8b4f6 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_ldap_credentials.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceLDAPCredentials < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader username: String? + attr_reader password: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rbs b/sig/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rbs new file mode 100644 index 00000000..6e3712e1 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_list_authentication_method_types_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceListAuthenticationMethodTypesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rbs b/sig/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rbs new file mode 100644 index 00000000..65a98419 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_list_authentication_method_types_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceListAuthenticationMethodTypesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceListDetails? + attr_reader auth_method_types: Array[BetaUserServiceAuthenticationMethodType]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_list_details.rbs b/sig/zitadel/client/models/beta_user_service_list_details.rbs new file mode 100644 index 00000000..f337dfa0 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_list_details.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceListDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader processed_sequence: untyped? + attr_reader timestamp: Time? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_list_query.rbs b/sig/zitadel/client/models/beta_user_service_list_query.rbs new file mode 100644 index 00000000..10a7d9dc --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_list_query.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceListQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_list_users_request.rbs b/sig/zitadel/client/models/beta_user_service_list_users_request.rbs new file mode 100644 index 00000000..48806671 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_list_users_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceListUsersRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader query: BetaUserServiceListQuery? + attr_reader sorting_column: BetaUserServiceUserFieldName? + attr_reader queries: Array[BetaUserServiceSearchQuery]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_list_users_response.rbs b/sig/zitadel/client/models/beta_user_service_list_users_response.rbs new file mode 100644 index 00000000..74f6fcec --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_list_users_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceListUsersResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceListDetails? + attr_reader sorting_column: BetaUserServiceUserFieldName? + attr_reader result: Array[BetaUserServiceUser]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_lock_user_request.rbs b/sig/zitadel/client/models/beta_user_service_lock_user_request.rbs new file mode 100644 index 00000000..edd292b0 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_lock_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceLockUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_lock_user_response.rbs b/sig/zitadel/client/models/beta_user_service_lock_user_response.rbs new file mode 100644 index 00000000..cd246293 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_lock_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceLockUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_login_name_query.rbs b/sig/zitadel/client/models/beta_user_service_login_name_query.rbs new file mode 100644 index 00000000..7673638f --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_login_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceLoginNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_name: String? + attr_reader method: BetaUserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_machine_user.rbs b/sig/zitadel/client/models/beta_user_service_machine_user.rbs new file mode 100644 index 00000000..94bfb762 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_machine_user.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceMachineUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader description: String? + attr_reader has_secret: bool? + attr_reader access_token_type: BetaUserServiceAccessTokenType? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_nick_name_query.rbs b/sig/zitadel/client/models/beta_user_service_nick_name_query.rbs new file mode 100644 index 00000000..77cd425e --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_nick_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceNickNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader nick_name: String? + attr_reader method: BetaUserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_not_query.rbs b/sig/zitadel/client/models/beta_user_service_not_query.rbs new file mode 100644 index 00000000..48e9202f --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_not_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceNotQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader query: BetaUserServiceSearchQuery? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_notification_type.rbs b/sig/zitadel/client/models/beta_user_service_notification_type.rbs new file mode 100644 index 00000000..90c4d147 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_notification_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceNotificationType + NOTIFICATION_TYPE_UNSPECIFIED: String + NOTIFICATION_TYPE_EMAIL: String + NOTIFICATION_TYPE_SMS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_or_query.rbs b/sig/zitadel/client/models/beta_user_service_or_query.rbs new file mode 100644 index 00000000..ae2cfd00 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_or_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceOrQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader queries: Array[BetaUserServiceSearchQuery]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_organization.rbs b/sig/zitadel/client/models/beta_user_service_organization.rbs new file mode 100644 index 00000000..7b0c52f6 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_organization.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceOrganization < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader org_domain: String? + attr_reader org_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_organization_id_query.rbs b/sig/zitadel/client/models/beta_user_service_organization_id_query.rbs new file mode 100644 index 00000000..fdfb23ff --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_organization_id_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceOrganizationIdQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_passkey_authenticator.rbs b/sig/zitadel/client/models/beta_user_service_passkey_authenticator.rbs new file mode 100644 index 00000000..aa835940 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_passkey_authenticator.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServicePasskeyAuthenticator + PASSKEY_AUTHENTICATOR_UNSPECIFIED: String + PASSKEY_AUTHENTICATOR_PLATFORM: String + PASSKEY_AUTHENTICATOR_CROSS_PLATFORM: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_passkey_registration_code.rbs b/sig/zitadel/client/models/beta_user_service_passkey_registration_code.rbs new file mode 100644 index 00000000..d462a688 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_passkey_registration_code.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServicePasskeyRegistrationCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_password.rbs b/sig/zitadel/client/models/beta_user_service_password.rbs new file mode 100644 index 00000000..03e22857 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_password.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServicePassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader password: String? + attr_reader change_required: bool? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_password_reset_request.rbs b/sig/zitadel/client/models/beta_user_service_password_reset_request.rbs new file mode 100644 index 00000000..c5513aa9 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_password_reset_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServicePasswordResetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_link: BetaUserServiceSendPasswordResetLink? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_password_reset_response.rbs b/sig/zitadel/client/models/beta_user_service_password_reset_response.rbs new file mode 100644 index 00000000..1a63bfdc --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_password_reset_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServicePasswordResetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_phone_query.rbs b/sig/zitadel/client/models/beta_user_service_phone_query.rbs new file mode 100644 index 00000000..ffe84f4d --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_phone_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServicePhoneQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader number: String? + attr_reader method: BetaUserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_reactivate_user_request.rbs b/sig/zitadel/client/models/beta_user_service_reactivate_user_request.rbs new file mode 100644 index 00000000..a91d1718 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_reactivate_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceReactivateUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_reactivate_user_response.rbs b/sig/zitadel/client/models/beta_user_service_reactivate_user_response.rbs new file mode 100644 index 00000000..9058b1fe --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_reactivate_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceReactivateUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_redirect_urls.rbs b/sig/zitadel/client/models/beta_user_service_redirect_urls.rbs new file mode 100644 index 00000000..fae17c48 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_redirect_urls.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceRedirectURLs < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader success_url: String? + attr_reader failure_url: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_register_passkey_request.rbs b/sig/zitadel/client/models/beta_user_service_register_passkey_request.rbs new file mode 100644 index 00000000..267f9ff3 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_register_passkey_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceRegisterPasskeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader code: BetaUserServicePasskeyRegistrationCode? + attr_reader authenticator: BetaUserServicePasskeyAuthenticator? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_register_passkey_response.rbs b/sig/zitadel/client/models/beta_user_service_register_passkey_response.rbs new file mode 100644 index 00000000..6a3cf2c5 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_register_passkey_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceRegisterPasskeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader passkey_id: String? + attr_reader public_key_credential_creation_options: Hash[String, untyped]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_register_totp_request.rbs b/sig/zitadel/client/models/beta_user_service_register_totp_request.rbs new file mode 100644 index 00000000..b24a0dc4 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_register_totp_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceRegisterTOTPRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_register_totp_response.rbs b/sig/zitadel/client/models/beta_user_service_register_totp_response.rbs new file mode 100644 index 00000000..a5e2ab30 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_register_totp_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceRegisterTOTPResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader uri: String? + attr_reader secret: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_register_u2_f_request.rbs b/sig/zitadel/client/models/beta_user_service_register_u2_f_request.rbs new file mode 100644 index 00000000..57f6c859 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_register_u2_f_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceRegisterU2FRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_register_u2_f_response.rbs b/sig/zitadel/client/models/beta_user_service_register_u2_f_response.rbs new file mode 100644 index 00000000..09e5f3a9 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_register_u2_f_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceRegisterU2FResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader u2f_id: String? + attr_reader public_key_credential_creation_options: Hash[String, untyped]? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_remove_otp_email_request.rbs b/sig/zitadel/client/models/beta_user_service_remove_otp_email_request.rbs new file mode 100644 index 00000000..847bc6f1 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_remove_otp_email_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceRemoveOTPEmailRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_remove_otp_email_response.rbs b/sig/zitadel/client/models/beta_user_service_remove_otp_email_response.rbs new file mode 100644 index 00000000..e4e849cf --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_remove_otp_email_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceRemoveOTPEmailResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_remove_otpsms_request.rbs b/sig/zitadel/client/models/beta_user_service_remove_otpsms_request.rbs new file mode 100644 index 00000000..baadf4ca --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_remove_otpsms_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceRemoveOTPSMSRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_remove_otpsms_response.rbs b/sig/zitadel/client/models/beta_user_service_remove_otpsms_response.rbs new file mode 100644 index 00000000..9f68d14b --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_remove_otpsms_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceRemoveOTPSMSResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_remove_phone_request.rbs b/sig/zitadel/client/models/beta_user_service_remove_phone_request.rbs new file mode 100644 index 00000000..ef1bd30d --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_remove_phone_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceRemovePhoneRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_remove_phone_response.rbs b/sig/zitadel/client/models/beta_user_service_remove_phone_response.rbs new file mode 100644 index 00000000..c650adc7 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_remove_phone_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceRemovePhoneResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_remove_totp_request.rbs b/sig/zitadel/client/models/beta_user_service_remove_totp_request.rbs new file mode 100644 index 00000000..af2864ac --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_remove_totp_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceRemoveTOTPRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_remove_totp_response.rbs b/sig/zitadel/client/models/beta_user_service_remove_totp_response.rbs new file mode 100644 index 00000000..2f8e3211 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_remove_totp_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceRemoveTOTPResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_resend_email_code_request.rbs b/sig/zitadel/client/models/beta_user_service_resend_email_code_request.rbs new file mode 100644 index 00000000..b3b287f5 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_resend_email_code_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceResendEmailCodeRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_code: BetaUserServiceSendEmailVerificationCode? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_resend_email_code_response.rbs b/sig/zitadel/client/models/beta_user_service_resend_email_code_response.rbs new file mode 100644 index 00000000..aca3d211 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_resend_email_code_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceResendEmailCodeResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_resend_phone_code_request.rbs b/sig/zitadel/client/models/beta_user_service_resend_phone_code_request.rbs new file mode 100644 index 00000000..8b599e06 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_resend_phone_code_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceResendPhoneCodeRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_code: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_resend_phone_code_response.rbs b/sig/zitadel/client/models/beta_user_service_resend_phone_code_response.rbs new file mode 100644 index 00000000..9d73585c --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_resend_phone_code_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceResendPhoneCodeResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rbs b/sig/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rbs new file mode 100644 index 00000000..8f364574 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceRetrieveIdentityProviderIntentRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_intent_id: String? + attr_reader idp_intent_token: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rbs b/sig/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rbs new file mode 100644 index 00000000..12c94820 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_retrieve_identity_provider_intent_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceRetrieveIdentityProviderIntentResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader idp_information: BetaUserServiceIDPInformation? + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_search_query.rbs b/sig/zitadel/client/models/beta_user_service_search_query.rbs new file mode 100644 index 00000000..e5496e29 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_search_query.rbs @@ -0,0 +1,24 @@ +module Zitadel::Client::Models + class BetaUserServiceSearchQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader and_query: BetaUserServiceAndQuery? + attr_reader display_name_query: BetaUserServiceDisplayNameQuery? + attr_reader email_query: BetaUserServiceEmailQuery? + attr_reader first_name_query: BetaUserServiceFirstNameQuery? + attr_reader in_user_emails_query: BetaUserServiceInUserEmailsQuery? + attr_reader in_user_ids_query: BetaUserServiceInUserIDQuery? + attr_reader last_name_query: BetaUserServiceLastNameQuery? + attr_reader login_name_query: BetaUserServiceLoginNameQuery? + attr_reader nick_name_query: BetaUserServiceNickNameQuery? + attr_reader not_query: BetaUserServiceNotQuery? + attr_reader or_query: BetaUserServiceOrQuery? + attr_reader organization_id_query: BetaUserServiceOrganizationIdQuery? + attr_reader phone_query: BetaUserServicePhoneQuery? + attr_reader state_query: BetaUserServiceStateQuery? + attr_reader type_query: BetaUserServiceTypeQuery? + attr_reader user_name_query: BetaUserServiceUserNameQuery? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_send_email_verification_code.rbs b/sig/zitadel/client/models/beta_user_service_send_email_verification_code.rbs new file mode 100644 index 00000000..014c26c2 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_send_email_verification_code.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceSendEmailVerificationCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_send_passkey_registration_link.rbs b/sig/zitadel/client/models/beta_user_service_send_passkey_registration_link.rbs new file mode 100644 index 00000000..8a897c64 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_send_passkey_registration_link.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceSendPasskeyRegistrationLink < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_send_password_reset_link.rbs b/sig/zitadel/client/models/beta_user_service_send_password_reset_link.rbs new file mode 100644 index 00000000..dd0fca7b --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_send_password_reset_link.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceSendPasswordResetLink < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader notification_type: BetaUserServiceNotificationType? + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_email_request.rbs b/sig/zitadel/client/models/beta_user_service_set_email_request.rbs new file mode 100644 index 00000000..e0ba0a0c --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_email_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaUserServiceSetEmailRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader email: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: BetaUserServiceSendEmailVerificationCode? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_email_response.rbs b/sig/zitadel/client/models/beta_user_service_set_email_response.rbs new file mode 100644 index 00000000..c415d89a --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_email_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceSetEmailResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_human_email.rbs b/sig/zitadel/client/models/beta_user_service_set_human_email.rbs new file mode 100644 index 00000000..7e9717f6 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_human_email.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceSetHumanEmail < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader email: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: BetaUserServiceSendEmailVerificationCode? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_human_phone.rbs b/sig/zitadel/client/models/beta_user_service_set_human_phone.rbs new file mode 100644 index 00000000..4050c05e --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_human_phone.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceSetHumanPhone < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader phone: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_human_profile.rbs b/sig/zitadel/client/models/beta_user_service_set_human_profile.rbs new file mode 100644 index 00000000..bd1f9954 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_human_profile.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaUserServiceSetHumanProfile < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader given_name: String? + attr_reader family_name: String? + attr_reader nick_name: String? + attr_reader display_name: String? + attr_reader preferred_language: String? + attr_reader gender: BetaUserServiceGender? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_metadata_entry.rbs b/sig/zitadel/client/models/beta_user_service_set_metadata_entry.rbs new file mode 100644 index 00000000..5c306ad9 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_metadata_entry.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceSetMetadataEntry < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader value: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_password.rbs b/sig/zitadel/client/models/beta_user_service_set_password.rbs new file mode 100644 index 00000000..a487c9a2 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_password.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceSetPassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader hashed_password: BetaUserServiceHashedPassword? + attr_reader password: BetaUserServicePassword? + attr_reader current_password: String? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_password_request.rbs b/sig/zitadel/client/models/beta_user_service_set_password_request.rbs new file mode 100644 index 00000000..cf60c5e8 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_password_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceSetPasswordRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader new_password: BetaUserServicePassword? + attr_reader current_password: String? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_password_response.rbs b/sig/zitadel/client/models/beta_user_service_set_password_response.rbs new file mode 100644 index 00000000..cb84bc87 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_password_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceSetPasswordResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_phone_request.rbs b/sig/zitadel/client/models/beta_user_service_set_phone_request.rbs new file mode 100644 index 00000000..95788353 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_phone_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaUserServiceSetPhoneRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader phone: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_set_phone_response.rbs b/sig/zitadel/client/models/beta_user_service_set_phone_response.rbs new file mode 100644 index 00000000..ac99e1b3 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_set_phone_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceSetPhoneResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rbs b/sig/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rbs new file mode 100644 index 00000000..a8372be0 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_start_identity_provider_intent_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceStartIdentityProviderIntentRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_id: String? + attr_reader ldap: BetaUserServiceLDAPCredentials? + attr_reader urls: BetaUserServiceRedirectURLs? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rbs b/sig/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rbs new file mode 100644 index 00000000..64efbb9a --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_start_identity_provider_intent_response.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaUserServiceStartIdentityProviderIntentResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader auth_url: String? + attr_reader form_data: BetaUserServiceFormData? + attr_reader idp_intent: BetaUserServiceIDPIntent? + attr_reader post_form: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_state_query.rbs b/sig/zitadel/client/models/beta_user_service_state_query.rbs new file mode 100644 index 00000000..0903691d --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_state_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceStateQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader state: BetaUserServiceUserState? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_text_query_method.rbs b/sig/zitadel/client/models/beta_user_service_text_query_method.rbs new file mode 100644 index 00000000..0de06027 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_text_query_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaUserServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS: String + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE: String + TEXT_QUERY_METHOD_STARTS_WITH: String + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_QUERY_METHOD_CONTAINS: String + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_QUERY_METHOD_ENDS_WITH: String + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_type.rbs b/sig/zitadel/client/models/beta_user_service_type.rbs new file mode 100644 index 00000000..cf1044c9 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceType + TYPE_UNSPECIFIED: String + TYPE_HUMAN: String + TYPE_MACHINE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_type_query.rbs b/sig/zitadel/client/models/beta_user_service_type_query.rbs new file mode 100644 index 00000000..9295184b --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_type_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceTypeQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader type: BetaUserServiceType? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_unlock_user_request.rbs b/sig/zitadel/client/models/beta_user_service_unlock_user_request.rbs new file mode 100644 index 00000000..e98f7942 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_unlock_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceUnlockUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_unlock_user_response.rbs b/sig/zitadel/client/models/beta_user_service_unlock_user_response.rbs new file mode 100644 index 00000000..937f2ccd --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_unlock_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceUnlockUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_update_human_user_request.rbs b/sig/zitadel/client/models/beta_user_service_update_human_user_request.rbs new file mode 100644 index 00000000..0a075692 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_update_human_user_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class BetaUserServiceUpdateHumanUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader username: String? + attr_reader profile: BetaUserServiceSetHumanProfile? + attr_reader email: BetaUserServiceSetHumanEmail? + attr_reader phone: BetaUserServiceSetHumanPhone? + attr_reader password: BetaUserServiceSetPassword? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_update_human_user_response.rbs b/sig/zitadel/client/models/beta_user_service_update_human_user_response.rbs new file mode 100644 index 00000000..5e630966 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_update_human_user_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaUserServiceUpdateHumanUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + attr_reader email_code: String? + attr_reader phone_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_user.rbs b/sig/zitadel/client/models/beta_user_service_user.rbs new file mode 100644 index 00000000..6fef8bd7 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_user.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class BetaUserServiceUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader details: BetaUserServiceDetails? + attr_reader state: BetaUserServiceUserState? + attr_reader username: String? + attr_reader login_names: Array[String]? + attr_reader preferred_login_name: String? + attr_reader human: BetaUserServiceHumanUser? + attr_reader machine: BetaUserServiceMachineUser? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_user_field_name.rbs b/sig/zitadel/client/models/beta_user_service_user_field_name.rbs new file mode 100644 index 00000000..89956ff2 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_user_field_name.rbs @@ -0,0 +1,17 @@ +module Zitadel::Client::Models + class BetaUserServiceUserFieldName + USER_FIELD_NAME_UNSPECIFIED: String + USER_FIELD_NAME_USER_NAME: String + USER_FIELD_NAME_FIRST_NAME: String + USER_FIELD_NAME_LAST_NAME: String + USER_FIELD_NAME_NICK_NAME: String + USER_FIELD_NAME_DISPLAY_NAME: String + USER_FIELD_NAME_EMAIL: String + USER_FIELD_NAME_STATE: String + USER_FIELD_NAME_TYPE: String + USER_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_user_name_query.rbs b/sig/zitadel/client/models/beta_user_service_user_name_query.rbs new file mode 100644 index 00000000..e14f585c --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_user_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceUserNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_name: String? + attr_reader method: BetaUserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_user_state.rbs b/sig/zitadel/client/models/beta_user_service_user_state.rbs new file mode 100644 index 00000000..199f6252 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_user_state.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class BetaUserServiceUserState + USER_STATE_UNSPECIFIED: String + USER_STATE_ACTIVE: String + USER_STATE_INACTIVE: String + USER_STATE_DELETED: String + USER_STATE_LOCKED: String + USER_STATE_INITIAL: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_email_request.rbs b/sig/zitadel/client/models/beta_user_service_verify_email_request.rbs new file mode 100644 index 00000000..dafd015b --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_email_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyEmailRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_email_response.rbs b/sig/zitadel/client/models/beta_user_service_verify_email_response.rbs new file mode 100644 index 00000000..602957f9 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_email_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyEmailResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rbs b/sig/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rbs new file mode 100644 index 00000000..bf2ff454 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_passkey_registration_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyPasskeyRegistrationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader passkey_id: String? + attr_reader public_key_credential: Hash[String, untyped]? + attr_reader passkey_name: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rbs b/sig/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rbs new file mode 100644 index 00000000..ad7502aa --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_passkey_registration_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyPasskeyRegistrationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_phone_request.rbs b/sig/zitadel/client/models/beta_user_service_verify_phone_request.rbs new file mode 100644 index 00000000..3348fd8e --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_phone_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyPhoneRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_phone_response.rbs b/sig/zitadel/client/models/beta_user_service_verify_phone_response.rbs new file mode 100644 index 00000000..45eb5dd0 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_phone_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyPhoneResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_totp_registration_request.rbs b/sig/zitadel/client/models/beta_user_service_verify_totp_registration_request.rbs new file mode 100644 index 00000000..3c3f12c7 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_totp_registration_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyTOTPRegistrationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader code: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_totp_registration_response.rbs b/sig/zitadel/client/models/beta_user_service_verify_totp_registration_response.rbs new file mode 100644 index 00000000..83134317 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_totp_registration_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyTOTPRegistrationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rbs b/sig/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rbs new file mode 100644 index 00000000..691f5b52 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_u2_f_registration_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyU2FRegistrationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader u2f_id: String? + attr_reader public_key_credential: Hash[String, untyped]? + attr_reader token_name: String? + end +end diff --git a/sig/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rbs b/sig/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rbs new file mode 100644 index 00000000..05497c75 --- /dev/null +++ b/sig/zitadel/client/models/beta_user_service_verify_u2_f_registration_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaUserServiceVerifyU2FRegistrationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: BetaUserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_activate_web_key_request.rbs b/sig/zitadel/client/models/beta_web_key_service_activate_web_key_request.rbs new file mode 100644 index 00000000..ef1e3643 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_activate_web_key_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceActivateWebKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_activate_web_key_response.rbs b/sig/zitadel/client/models/beta_web_key_service_activate_web_key_response.rbs new file mode 100644 index 00000000..13d37565 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_activate_web_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceActivateWebKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_any.rbs b/sig/zitadel/client/models/beta_web_key_service_any.rbs new file mode 100644 index 00000000..3c314be5 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_connect_error.rbs b/sig/zitadel/client/models/beta_web_key_service_connect_error.rbs new file mode 100644 index 00000000..a18d6ad6 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[BetaWebKeyServiceAny]? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_create_web_key_request.rbs b/sig/zitadel/client/models/beta_web_key_service_create_web_key_request.rbs new file mode 100644 index 00000000..940fb9b5 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_create_web_key_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceCreateWebKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ecdsa: BetaWebKeyServiceECDSA? + attr_reader ed25519: untyped? + attr_reader rsa: BetaWebKeyServiceRSA? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_create_web_key_response.rbs b/sig/zitadel/client/models/beta_web_key_service_create_web_key_response.rbs new file mode 100644 index 00000000..9328f554 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_create_web_key_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceCreateWebKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_delete_web_key_request.rbs b/sig/zitadel/client/models/beta_web_key_service_delete_web_key_request.rbs new file mode 100644 index 00000000..05e35760 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_delete_web_key_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceDeleteWebKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_delete_web_key_response.rbs b/sig/zitadel/client/models/beta_web_key_service_delete_web_key_response.rbs new file mode 100644 index 00000000..810bfbe4 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_delete_web_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceDeleteWebKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_ecdsa.rbs b/sig/zitadel/client/models/beta_web_key_service_ecdsa.rbs new file mode 100644 index 00000000..571b848e --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_ecdsa.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceECDSA < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader curve: BetaWebKeyServiceECDSACurve? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_ecdsa_curve.rbs b/sig/zitadel/client/models/beta_web_key_service_ecdsa_curve.rbs new file mode 100644 index 00000000..2f41bf15 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_ecdsa_curve.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceECDSACurve + ECDSA_CURVE_UNSPECIFIED: String + ECDSA_CURVE_P256: String + ECDSA_CURVE_P384: String + ECDSA_CURVE_P512: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_list_web_keys_response.rbs b/sig/zitadel/client/models/beta_web_key_service_list_web_keys_response.rbs new file mode 100644 index 00000000..d31f1e7d --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_list_web_keys_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceListWebKeysResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader web_keys: Array[BetaWebKeyServiceWebKey]? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_rsa.rbs b/sig/zitadel/client/models/beta_web_key_service_rsa.rbs new file mode 100644 index 00000000..d64b35aa --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_rsa.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceRSA < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader bits: BetaWebKeyServiceRSABits? + attr_reader hasher: BetaWebKeyServiceRSAHasher? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_rsa_bits.rbs b/sig/zitadel/client/models/beta_web_key_service_rsa_bits.rbs new file mode 100644 index 00000000..43b91a5b --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_rsa_bits.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceRSABits + RSA_BITS_UNSPECIFIED: String + RSA_BITS_2048: String + RSA_BITS_3072: String + RSA_BITS_4096: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_rsa_hasher.rbs b/sig/zitadel/client/models/beta_web_key_service_rsa_hasher.rbs new file mode 100644 index 00000000..6041cc81 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_rsa_hasher.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceRSAHasher + RSA_HASHER_UNSPECIFIED: String + RSA_HASHER_SHA256: String + RSA_HASHER_SHA384: String + RSA_HASHER_SHA512: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_state.rbs b/sig/zitadel/client/models/beta_web_key_service_state.rbs new file mode 100644 index 00000000..a1acd37e --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_state.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceState + STATE_UNSPECIFIED: String + STATE_INITIAL: String + STATE_ACTIVE: String + STATE_INACTIVE: String + STATE_REMOVED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/beta_web_key_service_web_key.rbs b/sig/zitadel/client/models/beta_web_key_service_web_key.rbs new file mode 100644 index 00000000..60338332 --- /dev/null +++ b/sig/zitadel/client/models/beta_web_key_service_web_key.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class BetaWebKeyServiceWebKey < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader state: BetaWebKeyServiceState? + attr_reader ecdsa: BetaWebKeyServiceECDSA? + attr_reader ed25519: untyped? + attr_reader rsa: BetaWebKeyServiceRSA? + end +end diff --git a/sig/zitadel/client/models/feature_service_any.rbs b/sig/zitadel/client/models/feature_service_any.rbs new file mode 100644 index 00000000..27a58d41 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class FeatureServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/feature_service_connect_error.rbs b/sig/zitadel/client/models/feature_service_connect_error.rbs new file mode 100644 index 00000000..1a04d390 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class FeatureServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[FeatureServiceAny]? + end +end diff --git a/sig/zitadel/client/models/feature_service_details.rbs b/sig/zitadel/client/models/feature_service_details.rbs new file mode 100644 index 00000000..a01fff8a --- /dev/null +++ b/sig/zitadel/client/models/feature_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class FeatureServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/feature_service_feature_flag.rbs b/sig/zitadel/client/models/feature_service_feature_flag.rbs new file mode 100644 index 00000000..ebb1b297 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_feature_flag.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class FeatureServiceFeatureFlag < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader enabled: bool? + attr_reader source: FeatureServiceSource? + end +end diff --git a/sig/zitadel/client/models/feature_service_get_instance_features_request.rbs b/sig/zitadel/client/models/feature_service_get_instance_features_request.rbs new file mode 100644 index 00000000..955510dc --- /dev/null +++ b/sig/zitadel/client/models/feature_service_get_instance_features_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceGetInstanceFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader inheritance: bool? + end +end diff --git a/sig/zitadel/client/models/feature_service_get_instance_features_response.rbs b/sig/zitadel/client/models/feature_service_get_instance_features_response.rbs new file mode 100644 index 00000000..c307bc57 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_get_instance_features_response.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class FeatureServiceGetInstanceFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + attr_reader login_default_org: FeatureServiceFeatureFlag? + attr_reader user_schema: FeatureServiceFeatureFlag? + attr_reader oidc_token_exchange: FeatureServiceFeatureFlag? + attr_reader improved_performance: FeatureServiceImprovedPerformanceFeatureFlag? + attr_reader debug_oidc_parent_error: FeatureServiceFeatureFlag? + attr_reader oidc_single_v1_session_termination: FeatureServiceFeatureFlag? + attr_reader enable_back_channel_logout: FeatureServiceFeatureFlag? + attr_reader login_v2: FeatureServiceLoginV2FeatureFlag? + attr_reader permission_check_v2: FeatureServiceFeatureFlag? + attr_reader console_use_v2_user_api: FeatureServiceFeatureFlag? + end +end diff --git a/sig/zitadel/client/models/feature_service_get_organization_features_request.rbs b/sig/zitadel/client/models/feature_service_get_organization_features_request.rbs new file mode 100644 index 00000000..42044661 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_get_organization_features_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class FeatureServiceGetOrganizationFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader inheritance: bool? + end +end diff --git a/sig/zitadel/client/models/feature_service_get_organization_features_response.rbs b/sig/zitadel/client/models/feature_service_get_organization_features_response.rbs new file mode 100644 index 00000000..4043de0d --- /dev/null +++ b/sig/zitadel/client/models/feature_service_get_organization_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceGetOrganizationFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_get_system_features_response.rbs b/sig/zitadel/client/models/feature_service_get_system_features_response.rbs new file mode 100644 index 00000000..6b240bf8 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_get_system_features_response.rbs @@ -0,0 +1,17 @@ +module Zitadel::Client::Models + class FeatureServiceGetSystemFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + attr_reader login_default_org: FeatureServiceFeatureFlag? + attr_reader user_schema: FeatureServiceFeatureFlag? + attr_reader oidc_token_exchange: FeatureServiceFeatureFlag? + attr_reader improved_performance: FeatureServiceImprovedPerformanceFeatureFlag? + attr_reader oidc_single_v1_session_termination: FeatureServiceFeatureFlag? + attr_reader enable_back_channel_logout: FeatureServiceFeatureFlag? + attr_reader login_v2: FeatureServiceLoginV2FeatureFlag? + attr_reader permission_check_v2: FeatureServiceFeatureFlag? + end +end diff --git a/sig/zitadel/client/models/feature_service_get_user_features_request.rbs b/sig/zitadel/client/models/feature_service_get_user_features_request.rbs new file mode 100644 index 00000000..eb0bba94 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_get_user_features_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class FeatureServiceGetUserFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader inheritance: bool? + end +end diff --git a/sig/zitadel/client/models/feature_service_get_user_features_response.rbs b/sig/zitadel/client/models/feature_service_get_user_features_response.rbs new file mode 100644 index 00000000..30e86c90 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_get_user_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceGetUserFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_improved_performance.rbs b/sig/zitadel/client/models/feature_service_improved_performance.rbs new file mode 100644 index 00000000..ca17a3ee --- /dev/null +++ b/sig/zitadel/client/models/feature_service_improved_performance.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class FeatureServiceImprovedPerformance + IMPROVED_PERFORMANCE_UNSPECIFIED: String + IMPROVED_PERFORMANCE_PROJECT_GRANT: String + IMPROVED_PERFORMANCE_PROJECT: String + IMPROVED_PERFORMANCE_USER_GRANT: String + IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/feature_service_improved_performance_feature_flag.rbs b/sig/zitadel/client/models/feature_service_improved_performance_feature_flag.rbs new file mode 100644 index 00000000..2a30674f --- /dev/null +++ b/sig/zitadel/client/models/feature_service_improved_performance_feature_flag.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class FeatureServiceImprovedPerformanceFeatureFlag < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader execution_paths: Array[FeatureServiceImprovedPerformance]? + attr_reader source: FeatureServiceSource? + end +end diff --git a/sig/zitadel/client/models/feature_service_login_v2.rbs b/sig/zitadel/client/models/feature_service_login_v2.rbs new file mode 100644 index 00000000..24caf9b6 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_login_v2.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class FeatureServiceLoginV2 < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader required: bool? + attr_reader base_uri: String? + end +end diff --git a/sig/zitadel/client/models/feature_service_login_v2_feature_flag.rbs b/sig/zitadel/client/models/feature_service_login_v2_feature_flag.rbs new file mode 100644 index 00000000..91f2a6c4 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_login_v2_feature_flag.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class FeatureServiceLoginV2FeatureFlag < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader required: bool? + attr_reader base_uri: String? + attr_reader source: FeatureServiceSource? + end +end diff --git a/sig/zitadel/client/models/feature_service_reset_instance_features_response.rbs b/sig/zitadel/client/models/feature_service_reset_instance_features_response.rbs new file mode 100644 index 00000000..c3976f38 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_reset_instance_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceResetInstanceFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_reset_organization_features_request.rbs b/sig/zitadel/client/models/feature_service_reset_organization_features_request.rbs new file mode 100644 index 00000000..f47a7528 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_reset_organization_features_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceResetOrganizationFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/feature_service_reset_organization_features_response.rbs b/sig/zitadel/client/models/feature_service_reset_organization_features_response.rbs new file mode 100644 index 00000000..4721bbbb --- /dev/null +++ b/sig/zitadel/client/models/feature_service_reset_organization_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceResetOrganizationFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_reset_system_features_response.rbs b/sig/zitadel/client/models/feature_service_reset_system_features_response.rbs new file mode 100644 index 00000000..3fd42da5 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_reset_system_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceResetSystemFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_reset_user_features_request.rbs b/sig/zitadel/client/models/feature_service_reset_user_features_request.rbs new file mode 100644 index 00000000..d0a8d108 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_reset_user_features_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceResetUserFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/feature_service_reset_user_features_response.rbs b/sig/zitadel/client/models/feature_service_reset_user_features_response.rbs new file mode 100644 index 00000000..dab19bfb --- /dev/null +++ b/sig/zitadel/client/models/feature_service_reset_user_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceResetUserFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_set_instance_features_request.rbs b/sig/zitadel/client/models/feature_service_set_instance_features_request.rbs new file mode 100644 index 00000000..d4bba5c8 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_set_instance_features_request.rbs @@ -0,0 +1,18 @@ +module Zitadel::Client::Models + class FeatureServiceSetInstanceFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_default_org: bool? + attr_reader user_schema: bool? + attr_reader oidc_token_exchange: bool? + attr_reader improved_performance: Array[FeatureServiceImprovedPerformance]? + attr_reader debug_oidc_parent_error: bool? + attr_reader oidc_single_v1_session_termination: bool? + attr_reader enable_back_channel_logout: bool? + attr_reader login_v2: FeatureServiceLoginV2? + attr_reader permission_check_v2: bool? + attr_reader console_use_v2_user_api: bool? + end +end diff --git a/sig/zitadel/client/models/feature_service_set_instance_features_response.rbs b/sig/zitadel/client/models/feature_service_set_instance_features_response.rbs new file mode 100644 index 00000000..6b8242b6 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_set_instance_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceSetInstanceFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_set_organization_features_request.rbs b/sig/zitadel/client/models/feature_service_set_organization_features_request.rbs new file mode 100644 index 00000000..12c0b03c --- /dev/null +++ b/sig/zitadel/client/models/feature_service_set_organization_features_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceSetOrganizationFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/feature_service_set_organization_features_response.rbs b/sig/zitadel/client/models/feature_service_set_organization_features_response.rbs new file mode 100644 index 00000000..de2e75d2 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_set_organization_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceSetOrganizationFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_set_system_features_request.rbs b/sig/zitadel/client/models/feature_service_set_system_features_request.rbs new file mode 100644 index 00000000..ce2410d7 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_set_system_features_request.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class FeatureServiceSetSystemFeaturesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_default_org: bool? + attr_reader user_schema: bool? + attr_reader oidc_token_exchange: bool? + attr_reader improved_performance: Array[FeatureServiceImprovedPerformance]? + attr_reader oidc_single_v1_session_termination: bool? + attr_reader enable_back_channel_logout: bool? + attr_reader login_v2: FeatureServiceLoginV2? + attr_reader permission_check_v2: bool? + end +end diff --git a/sig/zitadel/client/models/feature_service_set_system_features_response.rbs b/sig/zitadel/client/models/feature_service_set_system_features_response.rbs new file mode 100644 index 00000000..d42007a6 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_set_system_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceSetSystemFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_set_user_feature_request.rbs b/sig/zitadel/client/models/feature_service_set_user_feature_request.rbs new file mode 100644 index 00000000..9b2a71d1 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_set_user_feature_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceSetUserFeatureRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/feature_service_set_user_features_response.rbs b/sig/zitadel/client/models/feature_service_set_user_features_response.rbs new file mode 100644 index 00000000..bfb65442 --- /dev/null +++ b/sig/zitadel/client/models/feature_service_set_user_features_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class FeatureServiceSetUserFeaturesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: FeatureServiceDetails? + end +end diff --git a/sig/zitadel/client/models/feature_service_source.rbs b/sig/zitadel/client/models/feature_service_source.rbs new file mode 100644 index 00000000..a56301bb --- /dev/null +++ b/sig/zitadel/client/models/feature_service_source.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class FeatureServiceSource + SOURCE_UNSPECIFIED: String + SOURCE_SYSTEM: String + SOURCE_INSTANCE: String + SOURCE_ORGANIZATION: String + SOURCE_PROJECT: String + SOURCE_APP: String + SOURCE_USER: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_any.rbs b/sig/zitadel/client/models/identity_provider_service_any.rbs new file mode 100644 index 00000000..d5da83ce --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class IdentityProviderServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_apple_config.rbs b/sig/zitadel/client/models/identity_provider_service_apple_config.rbs new file mode 100644 index 00000000..252d288f --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_apple_config.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class IdentityProviderServiceAppleConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader team_id: String? + attr_reader key_id: String? + attr_reader scopes: Array[String]? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_auto_linking_option.rbs b/sig/zitadel/client/models/identity_provider_service_auto_linking_option.rbs new file mode 100644 index 00000000..b9b79dca --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_auto_linking_option.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class IdentityProviderServiceAutoLinkingOption + AUTO_LINKING_OPTION_UNSPECIFIED: String + AUTO_LINKING_OPTION_USERNAME: String + AUTO_LINKING_OPTION_EMAIL: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_azure_ad_config.rbs b/sig/zitadel/client/models/identity_provider_service_azure_ad_config.rbs new file mode 100644 index 00000000..dab34d72 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_azure_ad_config.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class IdentityProviderServiceAzureADConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader tenant: IdentityProviderServiceAzureADTenant? + attr_reader email_verified: bool? + attr_reader scopes: Array[String]? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_azure_ad_tenant.rbs b/sig/zitadel/client/models/identity_provider_service_azure_ad_tenant.rbs new file mode 100644 index 00000000..cd615724 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_azure_ad_tenant.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class IdentityProviderServiceAzureADTenant < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader tenant_id: String? + attr_reader tenant_type: IdentityProviderServiceAzureADTenantType? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_azure_ad_tenant_type.rbs b/sig/zitadel/client/models/identity_provider_service_azure_ad_tenant_type.rbs new file mode 100644 index 00000000..5ad7e131 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_azure_ad_tenant_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class IdentityProviderServiceAzureADTenantType + AZURE_AD_TENANT_TYPE_COMMON: String + AZURE_AD_TENANT_TYPE_ORGANISATIONS: String + AZURE_AD_TENANT_TYPE_CONSUMERS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_connect_error.rbs b/sig/zitadel/client/models/identity_provider_service_connect_error.rbs new file mode 100644 index 00000000..5094efa6 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class IdentityProviderServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[IdentityProviderServiceAny]? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_details.rbs b/sig/zitadel/client/models/identity_provider_service_details.rbs new file mode 100644 index 00000000..a6d3b4f9 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class IdentityProviderServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_generic_oidc_config.rbs b/sig/zitadel/client/models/identity_provider_service_generic_oidc_config.rbs new file mode 100644 index 00000000..4127f750 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_generic_oidc_config.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class IdentityProviderServiceGenericOIDCConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader issuer: String? + attr_reader client_id: String? + attr_reader scopes: Array[String]? + attr_reader is_id_token_mapping: bool? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_get_idpby_id_request.rbs b/sig/zitadel/client/models/identity_provider_service_get_idpby_id_request.rbs new file mode 100644 index 00000000..b095f92e --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_get_idpby_id_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class IdentityProviderServiceGetIDPByIDRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_get_idpby_id_response.rbs b/sig/zitadel/client/models/identity_provider_service_get_idpby_id_response.rbs new file mode 100644 index 00000000..35606d20 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_get_idpby_id_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class IdentityProviderServiceGetIDPByIDResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp: IdentityProviderServiceIDP? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_git_hub_config.rbs b/sig/zitadel/client/models/identity_provider_service_git_hub_config.rbs new file mode 100644 index 00000000..df0b2566 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_git_hub_config.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class IdentityProviderServiceGitHubConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader scopes: Array[String]? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rbs b/sig/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rbs new file mode 100644 index 00000000..24a1178a --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_git_hub_enterprise_server_config.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class IdentityProviderServiceGitHubEnterpriseServerConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader authorization_endpoint: String? + attr_reader token_endpoint: String? + attr_reader user_endpoint: String? + attr_reader scopes: Array[String]? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_git_lab_config.rbs b/sig/zitadel/client/models/identity_provider_service_git_lab_config.rbs new file mode 100644 index 00000000..caf22177 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_git_lab_config.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class IdentityProviderServiceGitLabConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader scopes: Array[String]? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rbs b/sig/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rbs new file mode 100644 index 00000000..5768f06d --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_git_lab_self_hosted_config.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class IdentityProviderServiceGitLabSelfHostedConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader issuer: String? + attr_reader client_id: String? + attr_reader scopes: Array[String]? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_google_config.rbs b/sig/zitadel/client/models/identity_provider_service_google_config.rbs new file mode 100644 index 00000000..5d523e7b --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_google_config.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class IdentityProviderServiceGoogleConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader scopes: Array[String]? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_idp.rbs b/sig/zitadel/client/models/identity_provider_service_idp.rbs new file mode 100644 index 00000000..d4b089fe --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_idp.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class IdentityProviderServiceIDP < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader details: IdentityProviderServiceDetails? + attr_reader state: IdentityProviderServiceIDPState? + attr_reader name: String? + attr_reader type: IdentityProviderServiceIDPType? + attr_reader config: IdentityProviderServiceIDPConfig? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_idp_config.rbs b/sig/zitadel/client/models/identity_provider_service_idp_config.rbs new file mode 100644 index 00000000..9a3fbf0f --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_idp_config.rbs @@ -0,0 +1,21 @@ +module Zitadel::Client::Models + class IdentityProviderServiceIDPConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader options: IdentityProviderServiceOptions? + attr_reader apple: IdentityProviderServiceAppleConfig? + attr_reader azure_ad: IdentityProviderServiceAzureADConfig? + attr_reader github: IdentityProviderServiceGitHubConfig? + attr_reader github_es: IdentityProviderServiceGitHubEnterpriseServerConfig? + attr_reader gitlab: IdentityProviderServiceGitLabConfig? + attr_reader gitlab_self_hosted: IdentityProviderServiceGitLabSelfHostedConfig? + attr_reader google: IdentityProviderServiceGoogleConfig? + attr_reader jwt: IdentityProviderServiceJWTConfig? + attr_reader ldap: IdentityProviderServiceLDAPConfig? + attr_reader oauth: IdentityProviderServiceOAuthConfig? + attr_reader oidc: IdentityProviderServiceGenericOIDCConfig? + attr_reader saml: IdentityProviderServiceSAMLConfig? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_idp_state.rbs b/sig/zitadel/client/models/identity_provider_service_idp_state.rbs new file mode 100644 index 00000000..3f59dddd --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_idp_state.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class IdentityProviderServiceIDPState + IDP_STATE_UNSPECIFIED: String + IDP_STATE_ACTIVE: String + IDP_STATE_INACTIVE: String + IDP_STATE_REMOVED: String + IDP_STATE_MIGRATED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_idp_type.rbs b/sig/zitadel/client/models/identity_provider_service_idp_type.rbs new file mode 100644 index 00000000..caaa4e7a --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_idp_type.rbs @@ -0,0 +1,20 @@ +module Zitadel::Client::Models + class IdentityProviderServiceIDPType + IDP_TYPE_UNSPECIFIED: String + IDP_TYPE_OIDC: String + IDP_TYPE_JWT: String + IDP_TYPE_LDAP: String + IDP_TYPE_OAUTH: String + IDP_TYPE_AZURE_AD: String + IDP_TYPE_GITHUB: String + IDP_TYPE_GITHUB_ES: String + IDP_TYPE_GITLAB: String + IDP_TYPE_GITLAB_SELF_HOSTED: String + IDP_TYPE_GOOGLE: String + IDP_TYPE_APPLE: String + IDP_TYPE_SAML: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_jwt_config.rbs b/sig/zitadel/client/models/identity_provider_service_jwt_config.rbs new file mode 100644 index 00000000..05cd163f --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_jwt_config.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class IdentityProviderServiceJWTConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader jwt_endpoint: String? + attr_reader issuer: String? + attr_reader keys_endpoint: String? + attr_reader header_name: String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_ldap_attributes.rbs b/sig/zitadel/client/models/identity_provider_service_ldap_attributes.rbs new file mode 100644 index 00000000..4211d22c --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_ldap_attributes.rbs @@ -0,0 +1,22 @@ +module Zitadel::Client::Models + class IdentityProviderServiceLDAPAttributes < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id_attribute: String? + attr_reader first_name_attribute: String? + attr_reader last_name_attribute: String? + attr_reader display_name_attribute: String? + attr_reader nick_name_attribute: String? + attr_reader preferred_username_attribute: String? + attr_reader email_attribute: String? + attr_reader email_verified_attribute: String? + attr_reader phone_attribute: String? + attr_reader phone_verified_attribute: String? + attr_reader preferred_language_attribute: String? + attr_reader avatar_url_attribute: String? + attr_reader profile_attribute: String? + attr_reader root_ca: String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_ldap_config.rbs b/sig/zitadel/client/models/identity_provider_service_ldap_config.rbs new file mode 100644 index 00000000..93c5f9c6 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_ldap_config.rbs @@ -0,0 +1,18 @@ +module Zitadel::Client::Models + class IdentityProviderServiceLDAPConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader servers: Array[String]? + attr_reader start_tls: bool? + attr_reader base_dn: String? + attr_reader bind_dn: String? + attr_reader user_base: String? + attr_reader user_object_classes: Array[String]? + attr_reader user_filters: Array[String]? + attr_reader timeout: ISO8601::Duration? + attr_reader attributes: IdentityProviderServiceLDAPAttributes? + attr_reader root_ca: String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_o_auth_config.rbs b/sig/zitadel/client/models/identity_provider_service_o_auth_config.rbs new file mode 100644 index 00000000..e5f699a0 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_o_auth_config.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class IdentityProviderServiceOAuthConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader client_id: String? + attr_reader authorization_endpoint: String? + attr_reader token_endpoint: String? + attr_reader user_endpoint: String? + attr_reader scopes: Array[String]? + attr_reader id_attribute: String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_options.rbs b/sig/zitadel/client/models/identity_provider_service_options.rbs new file mode 100644 index 00000000..ce5ef4c9 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_options.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class IdentityProviderServiceOptions < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader is_linking_allowed: bool? + attr_reader is_creation_allowed: bool? + attr_reader is_auto_creation: bool? + attr_reader is_auto_update: bool? + attr_reader auto_linking: IdentityProviderServiceAutoLinkingOption? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_saml_binding.rbs b/sig/zitadel/client/models/identity_provider_service_saml_binding.rbs new file mode 100644 index 00000000..7b774a8f --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_saml_binding.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class IdentityProviderServiceSAMLBinding + SAML_BINDING_UNSPECIFIED: String + SAML_BINDING_POST: String + SAML_BINDING_REDIRECT: String + SAML_BINDING_ARTIFACT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_saml_config.rbs b/sig/zitadel/client/models/identity_provider_service_saml_config.rbs new file mode 100644 index 00000000..3ff3a4b0 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_saml_config.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class IdentityProviderServiceSAMLConfig < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader metadata_xml: String? + attr_reader binding: IdentityProviderServiceSAMLBinding? + attr_reader with_signed_request: bool? + attr_reader name_id_format: IdentityProviderServiceSAMLNameIDFormat? + attr_reader transient_mapping_attribute_name: String? + attr_reader federated_logout_enabled: bool? + attr_reader signature_algorithm: IdentityProviderServiceSAMLSignatureAlgorithm? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_saml_name_id_format.rbs b/sig/zitadel/client/models/identity_provider_service_saml_name_id_format.rbs new file mode 100644 index 00000000..6a8be72e --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_saml_name_id_format.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class IdentityProviderServiceSAMLNameIDFormat + SAML_NAME_ID_FORMAT_UNSPECIFIED: String + SAML_NAME_ID_FORMAT_EMAIL_ADDRESS: String + SAML_NAME_ID_FORMAT_PERSISTENT: String + SAML_NAME_ID_FORMAT_TRANSIENT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/identity_provider_service_saml_signature_algorithm.rbs b/sig/zitadel/client/models/identity_provider_service_saml_signature_algorithm.rbs new file mode 100644 index 00000000..4857cf70 --- /dev/null +++ b/sig/zitadel/client/models/identity_provider_service_saml_signature_algorithm.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class IdentityProviderServiceSAMLSignatureAlgorithm + SAML_SIGNATURE_UNSPECIFIED: String + SAML_SIGNATURE_RSA_SHA1: String + SAML_SIGNATURE_RSA_SHA256: String + SAML_SIGNATURE_RSA_SHA512: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/instance_service_add_custom_domain_request.rbs b/sig/zitadel/client/models/instance_service_add_custom_domain_request.rbs new file mode 100644 index 00000000..d38658dd --- /dev/null +++ b/sig/zitadel/client/models/instance_service_add_custom_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceAddCustomDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader custom_domain: String? + end +end diff --git a/sig/zitadel/client/models/instance_service_add_custom_domain_response.rbs b/sig/zitadel/client/models/instance_service_add_custom_domain_response.rbs new file mode 100644 index 00000000..8aae2254 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_add_custom_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceAddCustomDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/instance_service_add_trusted_domain_request.rbs b/sig/zitadel/client/models/instance_service_add_trusted_domain_request.rbs new file mode 100644 index 00000000..a21e67bb --- /dev/null +++ b/sig/zitadel/client/models/instance_service_add_trusted_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceAddTrustedDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader trusted_domain: String? + end +end diff --git a/sig/zitadel/client/models/instance_service_add_trusted_domain_response.rbs b/sig/zitadel/client/models/instance_service_add_trusted_domain_response.rbs new file mode 100644 index 00000000..ccdebb05 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_add_trusted_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceAddTrustedDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/instance_service_any.rbs b/sig/zitadel/client/models/instance_service_any.rbs new file mode 100644 index 00000000..6524d4f0 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InstanceServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/instance_service_connect_error.rbs b/sig/zitadel/client/models/instance_service_connect_error.rbs new file mode 100644 index 00000000..3c5861a9 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InstanceServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[InstanceServiceAny]? + end +end diff --git a/sig/zitadel/client/models/instance_service_custom_domain.rbs b/sig/zitadel/client/models/instance_service_custom_domain.rbs new file mode 100644 index 00000000..92196a91 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_custom_domain.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class InstanceServiceCustomDomain < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader creation_date: Time? + attr_reader domain: String? + attr_reader primary: bool? + attr_reader generated: bool? + end +end diff --git a/sig/zitadel/client/models/instance_service_custom_domain_filter.rbs b/sig/zitadel/client/models/instance_service_custom_domain_filter.rbs new file mode 100644 index 00000000..31b788b0 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_custom_domain_filter.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InstanceServiceCustomDomainFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain_filter: InstanceServiceDomainFilter? + attr_reader generated_filter: bool? + attr_reader primary_filter: bool? + end +end diff --git a/sig/zitadel/client/models/instance_service_custom_domains_filter.rbs b/sig/zitadel/client/models/instance_service_custom_domains_filter.rbs new file mode 100644 index 00000000..28a68945 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_custom_domains_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceCustomDomainsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domains: Array[String]? + end +end diff --git a/sig/zitadel/client/models/instance_service_delete_instance_request.rbs b/sig/zitadel/client/models/instance_service_delete_instance_request.rbs new file mode 100644 index 00000000..636c0804 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_delete_instance_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceDeleteInstanceRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + end +end diff --git a/sig/zitadel/client/models/instance_service_delete_instance_response.rbs b/sig/zitadel/client/models/instance_service_delete_instance_response.rbs new file mode 100644 index 00000000..ff41dcee --- /dev/null +++ b/sig/zitadel/client/models/instance_service_delete_instance_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceDeleteInstanceResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/instance_service_domain_field_name.rbs b/sig/zitadel/client/models/instance_service_domain_field_name.rbs new file mode 100644 index 00000000..7a95cf02 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_domain_field_name.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InstanceServiceDomainFieldName + DOMAIN_FIELD_NAME_UNSPECIFIED: String + DOMAIN_FIELD_NAME_DOMAIN: String + DOMAIN_FIELD_NAME_PRIMARY: String + DOMAIN_FIELD_NAME_GENERATED: String + DOMAIN_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/instance_service_domain_filter.rbs b/sig/zitadel/client/models/instance_service_domain_filter.rbs new file mode 100644 index 00000000..d304531b --- /dev/null +++ b/sig/zitadel/client/models/instance_service_domain_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceDomainFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain: String? + attr_reader method: InstanceServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/instance_service_field_name.rbs b/sig/zitadel/client/models/instance_service_field_name.rbs new file mode 100644 index 00000000..e0df7b41 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InstanceServiceFieldName + FIELD_NAME_UNSPECIFIED: String + FIELD_NAME_ID: String + FIELD_NAME_NAME: String + FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/instance_service_filter.rbs b/sig/zitadel/client/models/instance_service_filter.rbs new file mode 100644 index 00000000..9229c191 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader custom_domains_filter: InstanceServiceCustomDomainsFilter? + attr_reader in_ids_filter: InstanceServiceInIDsFilter? + end +end diff --git a/sig/zitadel/client/models/instance_service_get_instance_request.rbs b/sig/zitadel/client/models/instance_service_get_instance_request.rbs new file mode 100644 index 00000000..ccca9dd1 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_get_instance_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceGetInstanceRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + end +end diff --git a/sig/zitadel/client/models/instance_service_get_instance_response.rbs b/sig/zitadel/client/models/instance_service_get_instance_response.rbs new file mode 100644 index 00000000..d4087ab8 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_get_instance_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceGetInstanceResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance: InstanceServiceInstance? + end +end diff --git a/sig/zitadel/client/models/instance_service_in_ids_filter.rbs b/sig/zitadel/client/models/instance_service_in_ids_filter.rbs new file mode 100644 index 00000000..39d2cc00 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_in_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceInIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/instance_service_instance.rbs b/sig/zitadel/client/models/instance_service_instance.rbs new file mode 100644 index 00000000..0d7be9a8 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_instance.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class InstanceServiceInstance < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader change_date: Time? + attr_reader creation_date: Time? + attr_reader state: InstanceServiceState? + attr_reader name: String? + attr_reader version: String? + attr_reader custom_domains: Array[InstanceServiceCustomDomain]? + end +end diff --git a/sig/zitadel/client/models/instance_service_list_custom_domains_request.rbs b/sig/zitadel/client/models/instance_service_list_custom_domains_request.rbs new file mode 100644 index 00000000..1a5e416f --- /dev/null +++ b/sig/zitadel/client/models/instance_service_list_custom_domains_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InstanceServiceListCustomDomainsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader pagination: InstanceServicePaginationRequest? + attr_reader sorting_column: InstanceServiceDomainFieldName? + attr_reader filters: Array[InstanceServiceCustomDomainFilter]? + end +end diff --git a/sig/zitadel/client/models/instance_service_list_custom_domains_response.rbs b/sig/zitadel/client/models/instance_service_list_custom_domains_response.rbs new file mode 100644 index 00000000..eae2b202 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_list_custom_domains_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceListCustomDomainsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domains: Array[InstanceServiceCustomDomain]? + attr_reader pagination: InstanceServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/instance_service_list_instances_request.rbs b/sig/zitadel/client/models/instance_service_list_instances_request.rbs new file mode 100644 index 00000000..10f6c41a --- /dev/null +++ b/sig/zitadel/client/models/instance_service_list_instances_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InstanceServiceListInstancesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: InstanceServicePaginationRequest? + attr_reader sorting_column: InstanceServiceFieldName? + attr_reader filters: Array[InstanceServiceFilter]? + end +end diff --git a/sig/zitadel/client/models/instance_service_list_instances_response.rbs b/sig/zitadel/client/models/instance_service_list_instances_response.rbs new file mode 100644 index 00000000..76afd3f6 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_list_instances_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceListInstancesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instances: Array[InstanceServiceInstance]? + attr_reader pagination: InstanceServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/instance_service_list_trusted_domains_request.rbs b/sig/zitadel/client/models/instance_service_list_trusted_domains_request.rbs new file mode 100644 index 00000000..256a825a --- /dev/null +++ b/sig/zitadel/client/models/instance_service_list_trusted_domains_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InstanceServiceListTrustedDomainsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader pagination: InstanceServicePaginationRequest? + attr_reader sorting_column: InstanceServiceTrustedDomainFieldName? + attr_reader filters: Array[InstanceServiceTrustedDomainFilter]? + end +end diff --git a/sig/zitadel/client/models/instance_service_list_trusted_domains_response.rbs b/sig/zitadel/client/models/instance_service_list_trusted_domains_response.rbs new file mode 100644 index 00000000..5e88c04e --- /dev/null +++ b/sig/zitadel/client/models/instance_service_list_trusted_domains_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceListTrustedDomainsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader trusted_domain: Array[InstanceServiceTrustedDomain]? + attr_reader pagination: InstanceServicePaginationResponse? + end +end diff --git a/sig/zitadel/client/models/instance_service_pagination_request.rbs b/sig/zitadel/client/models/instance_service_pagination_request.rbs new file mode 100644 index 00000000..35418262 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InstanceServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/instance_service_pagination_response.rbs b/sig/zitadel/client/models/instance_service_pagination_response.rbs new file mode 100644 index 00000000..75d38104 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/instance_service_remove_custom_domain_request.rbs b/sig/zitadel/client/models/instance_service_remove_custom_domain_request.rbs new file mode 100644 index 00000000..b07aa374 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_remove_custom_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceRemoveCustomDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader custom_domain: String? + end +end diff --git a/sig/zitadel/client/models/instance_service_remove_custom_domain_response.rbs b/sig/zitadel/client/models/instance_service_remove_custom_domain_response.rbs new file mode 100644 index 00000000..87f170b6 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_remove_custom_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceRemoveCustomDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/instance_service_remove_trusted_domain_request.rbs b/sig/zitadel/client/models/instance_service_remove_trusted_domain_request.rbs new file mode 100644 index 00000000..cd8649f7 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_remove_trusted_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceRemoveTrustedDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader trusted_domain: String? + end +end diff --git a/sig/zitadel/client/models/instance_service_remove_trusted_domain_response.rbs b/sig/zitadel/client/models/instance_service_remove_trusted_domain_response.rbs new file mode 100644 index 00000000..38135309 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_remove_trusted_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceRemoveTrustedDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/instance_service_state.rbs b/sig/zitadel/client/models/instance_service_state.rbs new file mode 100644 index 00000000..8dc33a26 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_state.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InstanceServiceState + STATE_UNSPECIFIED: String + STATE_CREATING: String + STATE_RUNNING: String + STATE_STOPPING: String + STATE_STOPPED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/instance_service_text_query_method.rbs b/sig/zitadel/client/models/instance_service_text_query_method.rbs new file mode 100644 index 00000000..85354e4f --- /dev/null +++ b/sig/zitadel/client/models/instance_service_text_query_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class InstanceServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS: String + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE: String + TEXT_QUERY_METHOD_STARTS_WITH: String + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_QUERY_METHOD_CONTAINS: String + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_QUERY_METHOD_ENDS_WITH: String + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/instance_service_trusted_domain.rbs b/sig/zitadel/client/models/instance_service_trusted_domain.rbs new file mode 100644 index 00000000..e58fa30c --- /dev/null +++ b/sig/zitadel/client/models/instance_service_trusted_domain.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InstanceServiceTrustedDomain < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader creation_date: Time? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/instance_service_trusted_domain_field_name.rbs b/sig/zitadel/client/models/instance_service_trusted_domain_field_name.rbs new file mode 100644 index 00000000..cbea7df5 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_trusted_domain_field_name.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceTrustedDomainFieldName + TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED: String + TRUSTED_DOMAIN_FIELD_NAME_DOMAIN: String + TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/instance_service_trusted_domain_filter.rbs b/sig/zitadel/client/models/instance_service_trusted_domain_filter.rbs new file mode 100644 index 00000000..88306b27 --- /dev/null +++ b/sig/zitadel/client/models/instance_service_trusted_domain_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceTrustedDomainFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain_filter: InstanceServiceDomainFilter? + end +end diff --git a/sig/zitadel/client/models/instance_service_update_instance_request.rbs b/sig/zitadel/client/models/instance_service_update_instance_request.rbs new file mode 100644 index 00000000..122f083d --- /dev/null +++ b/sig/zitadel/client/models/instance_service_update_instance_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InstanceServiceUpdateInstanceRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance_id: String? + attr_reader instance_name: String? + end +end diff --git a/sig/zitadel/client/models/instance_service_update_instance_response.rbs b/sig/zitadel/client/models/instance_service_update_instance_response.rbs new file mode 100644 index 00000000..fefada7c --- /dev/null +++ b/sig/zitadel/client/models/instance_service_update_instance_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InstanceServiceUpdateInstanceResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_administrator.rbs b/sig/zitadel/client/models/internal_permission_service_administrator.rbs new file mode 100644 index 00000000..76fb1e3b --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_administrator.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class InternalPermissionServiceAdministrator < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader user: InternalPermissionServiceUser? + attr_reader roles: Array[String]? + attr_reader instance: bool? + attr_reader organization: InternalPermissionServiceOrganization? + attr_reader project: InternalPermissionServiceProject? + attr_reader project_grant: InternalPermissionServiceProjectGrant? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_administrator_field_name.rbs b/sig/zitadel/client/models/internal_permission_service_administrator_field_name.rbs new file mode 100644 index 00000000..d988d9df --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_administrator_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InternalPermissionServiceAdministratorFieldName + ADMINISTRATOR_FIELD_NAME_UNSPECIFIED: String + ADMINISTRATOR_FIELD_NAME_USER_ID: String + ADMINISTRATOR_FIELD_NAME_CREATION_DATE: String + ADMINISTRATOR_FIELD_NAME_CHANGE_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_administrator_search_filter.rbs b/sig/zitadel/client/models/internal_permission_service_administrator_search_filter.rbs new file mode 100644 index 00000000..a6dc95d1 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_administrator_search_filter.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class InternalPermissionServiceAdministratorSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader _and: InternalPermissionServiceAndFilter? + attr_reader change_date: InternalPermissionServiceTimestampFilter? + attr_reader creation_date: InternalPermissionServiceTimestampFilter? + attr_reader in_user_ids_filter: InternalPermissionServiceInIDsFilter? + attr_reader _not: InternalPermissionServiceNotFilter? + attr_reader _or: InternalPermissionServiceOrFilter? + attr_reader resource: InternalPermissionServiceResourceFilter? + attr_reader role: InternalPermissionServiceRoleFilter? + attr_reader user_display_name: InternalPermissionServiceUserDisplayNameFilter? + attr_reader user_organization_id: InternalPermissionServiceIDFilter? + attr_reader user_preferred_login_name: InternalPermissionServiceUserPreferredLoginNameFilter? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_and_filter.rbs b/sig/zitadel/client/models/internal_permission_service_and_filter.rbs new file mode 100644 index 00000000..03c9a0a5 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_and_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InternalPermissionServiceAndFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader queries: Array[InternalPermissionServiceAdministratorSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_any.rbs b/sig/zitadel/client/models/internal_permission_service_any.rbs new file mode 100644 index 00000000..d783a5ad --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InternalPermissionServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_connect_error.rbs b/sig/zitadel/client/models/internal_permission_service_connect_error.rbs new file mode 100644 index 00000000..752e45af --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InternalPermissionServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[InternalPermissionServiceAny]? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_create_administrator_request.rbs b/sig/zitadel/client/models/internal_permission_service_create_administrator_request.rbs new file mode 100644 index 00000000..4fc5fbf6 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_create_administrator_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InternalPermissionServiceCreateAdministratorRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader resource: InternalPermissionServiceResourceType? + attr_reader roles: Array[String]? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_create_administrator_response.rbs b/sig/zitadel/client/models/internal_permission_service_create_administrator_response.rbs new file mode 100644 index 00000000..d66f03dd --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_create_administrator_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InternalPermissionServiceCreateAdministratorResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_delete_administrator_request.rbs b/sig/zitadel/client/models/internal_permission_service_delete_administrator_request.rbs new file mode 100644 index 00000000..b405d55c --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_delete_administrator_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InternalPermissionServiceDeleteAdministratorRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader resource: InternalPermissionServiceResourceType? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_delete_administrator_response.rbs b/sig/zitadel/client/models/internal_permission_service_delete_administrator_response.rbs new file mode 100644 index 00000000..aed8d240 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_delete_administrator_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InternalPermissionServiceDeleteAdministratorResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_id_filter.rbs b/sig/zitadel/client/models/internal_permission_service_id_filter.rbs new file mode 100644 index 00000000..3dc04ede --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InternalPermissionServiceIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_in_ids_filter.rbs b/sig/zitadel/client/models/internal_permission_service_in_ids_filter.rbs new file mode 100644 index 00000000..f314a185 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_in_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InternalPermissionServiceInIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_list_administrators_request.rbs b/sig/zitadel/client/models/internal_permission_service_list_administrators_request.rbs new file mode 100644 index 00000000..31c1eb1d --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_list_administrators_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InternalPermissionServiceListAdministratorsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: InternalPermissionServicePaginationRequest? + attr_reader sorting_column: InternalPermissionServiceAdministratorFieldName? + attr_reader filters: Array[InternalPermissionServiceAdministratorSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_list_administrators_response.rbs b/sig/zitadel/client/models/internal_permission_service_list_administrators_response.rbs new file mode 100644 index 00000000..a80b59c9 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_list_administrators_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InternalPermissionServiceListAdministratorsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: InternalPermissionServicePaginationResponse? + attr_reader administrators: Array[InternalPermissionServiceAdministrator]? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_not_filter.rbs b/sig/zitadel/client/models/internal_permission_service_not_filter.rbs new file mode 100644 index 00000000..609c6183 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_not_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InternalPermissionServiceNotFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader query: InternalPermissionServiceAdministratorSearchFilter? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_or_filter.rbs b/sig/zitadel/client/models/internal_permission_service_or_filter.rbs new file mode 100644 index 00000000..fd03de1b --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_or_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InternalPermissionServiceOrFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader queries: Array[InternalPermissionServiceAdministratorSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_organization.rbs b/sig/zitadel/client/models/internal_permission_service_organization.rbs new file mode 100644 index 00000000..bd54219d --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_organization.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InternalPermissionServiceOrganization < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_pagination_request.rbs b/sig/zitadel/client/models/internal_permission_service_pagination_request.rbs new file mode 100644 index 00000000..84fb8b9a --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InternalPermissionServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_pagination_response.rbs b/sig/zitadel/client/models/internal_permission_service_pagination_response.rbs new file mode 100644 index 00000000..2273ad6d --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InternalPermissionServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_project.rbs b/sig/zitadel/client/models/internal_permission_service_project.rbs new file mode 100644 index 00000000..d7118749 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_project.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InternalPermissionServiceProject < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_project_grant.rbs b/sig/zitadel/client/models/internal_permission_service_project_grant.rbs new file mode 100644 index 00000000..57fa4b99 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_project_grant.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InternalPermissionServiceProjectGrant < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_resource_filter.rbs b/sig/zitadel/client/models/internal_permission_service_resource_filter.rbs new file mode 100644 index 00000000..6165796a --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_resource_filter.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InternalPermissionServiceResourceFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance: bool? + attr_reader organization_id: String? + attr_reader project_grant: InternalPermissionServiceProjectGrant? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_resource_type.rbs b/sig/zitadel/client/models/internal_permission_service_resource_type.rbs new file mode 100644 index 00000000..096d9f2e --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_resource_type.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InternalPermissionServiceResourceType < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance: bool? + attr_reader organization_id: String? + attr_reader project_grant: InternalPermissionServiceProjectGrant? + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_role_filter.rbs b/sig/zitadel/client/models/internal_permission_service_role_filter.rbs new file mode 100644 index 00000000..8d5231f0 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_role_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InternalPermissionServiceRoleFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader role_key: String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_text_filter_method.rbs b/sig/zitadel/client/models/internal_permission_service_text_filter_method.rbs new file mode 100644 index 00000000..aa023cfa --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class InternalPermissionServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_timestamp_filter.rbs b/sig/zitadel/client/models/internal_permission_service_timestamp_filter.rbs new file mode 100644 index 00000000..e5b7e2d8 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_timestamp_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InternalPermissionServiceTimestampFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader timestamp: Time? + attr_reader method: InternalPermissionServiceTimestampFilterMethod? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_timestamp_filter_method.rbs b/sig/zitadel/client/models/internal_permission_service_timestamp_filter_method.rbs new file mode 100644 index 00000000..2dbe6ecf --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_timestamp_filter_method.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InternalPermissionServiceTimestampFilterMethod + TIMESTAMP_FILTER_METHOD_EQUALS: String + TIMESTAMP_FILTER_METHOD_AFTER: String + TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS: String + TIMESTAMP_FILTER_METHOD_BEFORE: String + TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_update_administrator_request.rbs b/sig/zitadel/client/models/internal_permission_service_update_administrator_request.rbs new file mode 100644 index 00000000..5003c00f --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_update_administrator_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class InternalPermissionServiceUpdateAdministratorRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader resource: InternalPermissionServiceResourceType? + attr_reader roles: Array[String]? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_update_administrator_response.rbs b/sig/zitadel/client/models/internal_permission_service_update_administrator_response.rbs new file mode 100644 index 00000000..bb85bc15 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_update_administrator_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class InternalPermissionServiceUpdateAdministratorResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_user.rbs b/sig/zitadel/client/models/internal_permission_service_user.rbs new file mode 100644 index 00000000..57c8cdb6 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_user.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class InternalPermissionServiceUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader preferred_login_name: String? + attr_reader display_name: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_user_display_name_filter.rbs b/sig/zitadel/client/models/internal_permission_service_user_display_name_filter.rbs new file mode 100644 index 00000000..63962e7d --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_user_display_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InternalPermissionServiceUserDisplayNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name: String? + attr_reader method: InternalPermissionServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/internal_permission_service_user_preferred_login_name_filter.rbs b/sig/zitadel/client/models/internal_permission_service_user_preferred_login_name_filter.rbs new file mode 100644 index 00000000..10d46b76 --- /dev/null +++ b/sig/zitadel/client/models/internal_permission_service_user_preferred_login_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class InternalPermissionServiceUserPreferredLoginNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader preferred_login_name: String? + attr_reader method: InternalPermissionServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/oidc_service_any.rbs b/sig/zitadel/client/models/oidc_service_any.rbs new file mode 100644 index 00000000..b0fe098e --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OIDCServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/oidc_service_auth_request.rbs b/sig/zitadel/client/models/oidc_service_auth_request.rbs new file mode 100644 index 00000000..b3d10bda --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_auth_request.rbs @@ -0,0 +1,18 @@ +module Zitadel::Client::Models + class OIDCServiceAuthRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader client_id: String? + attr_reader scope: Array[String]? + attr_reader redirect_uri: String? + attr_reader prompt: Array[OIDCServicePrompt]? + attr_reader ui_locales: Array[String]? + attr_reader login_hint: String? + attr_reader max_age: ISO8601::Duration? + attr_reader hint_user_id: String? + end +end diff --git a/sig/zitadel/client/models/oidc_service_authorization_error.rbs b/sig/zitadel/client/models/oidc_service_authorization_error.rbs new file mode 100644 index 00000000..f6e23d37 --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_authorization_error.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OIDCServiceAuthorizationError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader error: OIDCServiceErrorReason? + attr_reader error_description: String? + attr_reader error_uri: String? + end +end diff --git a/sig/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rbs b/sig/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rbs new file mode 100644 index 00000000..7796736b --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_authorize_or_deny_device_authorization_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader device_authorization_id: String? + attr_reader deny: untyped? + attr_reader session: OIDCServiceSession? + end +end diff --git a/sig/zitadel/client/models/oidc_service_connect_error.rbs b/sig/zitadel/client/models/oidc_service_connect_error.rbs new file mode 100644 index 00000000..c1fdc6ed --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OIDCServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[OIDCServiceAny]? + end +end diff --git a/sig/zitadel/client/models/oidc_service_create_callback_request.rbs b/sig/zitadel/client/models/oidc_service_create_callback_request.rbs new file mode 100644 index 00000000..46fc6cfa --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_create_callback_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OIDCServiceCreateCallbackRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_request_id: String? + attr_reader error: OIDCServiceAuthorizationError? + attr_reader session: OIDCServiceSession? + end +end diff --git a/sig/zitadel/client/models/oidc_service_create_callback_response.rbs b/sig/zitadel/client/models/oidc_service_create_callback_response.rbs new file mode 100644 index 00000000..56b30100 --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_create_callback_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OIDCServiceCreateCallbackResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: OIDCServiceDetails? + attr_reader callback_url: String? + end +end diff --git a/sig/zitadel/client/models/oidc_service_details.rbs b/sig/zitadel/client/models/oidc_service_details.rbs new file mode 100644 index 00000000..5dbe2369 --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OIDCServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/oidc_service_device_authorization_request.rbs b/sig/zitadel/client/models/oidc_service_device_authorization_request.rbs new file mode 100644 index 00000000..097871bf --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_device_authorization_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class OIDCServiceDeviceAuthorizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader client_id: String? + attr_reader scope: Array[String]? + attr_reader app_name: String? + attr_reader project_name: String? + end +end diff --git a/sig/zitadel/client/models/oidc_service_error_reason.rbs b/sig/zitadel/client/models/oidc_service_error_reason.rbs new file mode 100644 index 00000000..dd696c8f --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_error_reason.rbs @@ -0,0 +1,24 @@ +module Zitadel::Client::Models + class OIDCServiceErrorReason + ERROR_REASON_UNSPECIFIED: String + ERROR_REASON_INVALID_REQUEST: String + ERROR_REASON_UNAUTHORIZED_CLIENT: String + ERROR_REASON_ACCESS_DENIED: String + ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE: String + ERROR_REASON_INVALID_SCOPE: String + ERROR_REASON_SERVER_ERROR: String + ERROR_REASON_TEMPORARY_UNAVAILABLE: String + ERROR_REASON_INTERACTION_REQUIRED: String + ERROR_REASON_LOGIN_REQUIRED: String + ERROR_REASON_ACCOUNT_SELECTION_REQUIRED: String + ERROR_REASON_CONSENT_REQUIRED: String + ERROR_REASON_INVALID_REQUEST_URI: String + ERROR_REASON_INVALID_REQUEST_OBJECT: String + ERROR_REASON_REQUEST_NOT_SUPPORTED: String + ERROR_REASON_REQUEST_URI_NOT_SUPPORTED: String + ERROR_REASON_REGISTRATION_NOT_SUPPORTED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/oidc_service_get_auth_request_request.rbs b/sig/zitadel/client/models/oidc_service_get_auth_request_request.rbs new file mode 100644 index 00000000..204145a5 --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_get_auth_request_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OIDCServiceGetAuthRequestRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_request_id: String? + end +end diff --git a/sig/zitadel/client/models/oidc_service_get_auth_request_response.rbs b/sig/zitadel/client/models/oidc_service_get_auth_request_response.rbs new file mode 100644 index 00000000..8274eadf --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_get_auth_request_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OIDCServiceGetAuthRequestResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader auth_request: OIDCServiceAuthRequest? + end +end diff --git a/sig/zitadel/client/models/oidc_service_get_device_authorization_request_request.rbs b/sig/zitadel/client/models/oidc_service_get_device_authorization_request_request.rbs new file mode 100644 index 00000000..9db923c4 --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_get_device_authorization_request_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OIDCServiceGetDeviceAuthorizationRequestRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_code: String? + end +end diff --git a/sig/zitadel/client/models/oidc_service_get_device_authorization_request_response.rbs b/sig/zitadel/client/models/oidc_service_get_device_authorization_request_response.rbs new file mode 100644 index 00000000..cc835071 --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_get_device_authorization_request_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OIDCServiceGetDeviceAuthorizationRequestResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader device_authorization_request: OIDCServiceDeviceAuthorizationRequest? + end +end diff --git a/sig/zitadel/client/models/oidc_service_prompt.rbs b/sig/zitadel/client/models/oidc_service_prompt.rbs new file mode 100644 index 00000000..5fbe05b5 --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_prompt.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class OIDCServicePrompt + PROMPT_UNSPECIFIED: String + PROMPT_NONE: String + PROMPT_LOGIN: String + PROMPT_CONSENT: String + PROMPT_SELECT_ACCOUNT: String + PROMPT_CREATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/oidc_service_session.rbs b/sig/zitadel/client/models/oidc_service_session.rbs new file mode 100644 index 00000000..ee0065b4 --- /dev/null +++ b/sig/zitadel/client/models/oidc_service_session.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OIDCServiceSession < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session_id: String? + attr_reader session_token: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_activate_organization_request.rbs b/sig/zitadel/client/models/organization_service_activate_organization_request.rbs new file mode 100644 index 00000000..cc5ec815 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_activate_organization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceActivateOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_activate_organization_response.rbs b/sig/zitadel/client/models/organization_service_activate_organization_response.rbs new file mode 100644 index 00000000..43e1765b --- /dev/null +++ b/sig/zitadel/client/models/organization_service_activate_organization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceActivateOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_add_human_user_request.rbs b/sig/zitadel/client/models/organization_service_add_human_user_request.rbs new file mode 100644 index 00000000..909c698f --- /dev/null +++ b/sig/zitadel/client/models/organization_service_add_human_user_request.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class OrganizationServiceAddHumanUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader username: String? + attr_reader organization: OrganizationServiceOrganization? + attr_reader profile: OrganizationServiceSetHumanProfile? + attr_reader email: OrganizationServiceSetHumanEmail? + attr_reader phone: OrganizationServiceSetHumanPhone? + attr_reader metadata: Array[OrganizationServiceSetMetadataEntry]? + attr_reader idp_links: Array[OrganizationServiceIDPLink]? + attr_reader totp_secret: String? + attr_reader hashed_password: OrganizationServiceHashedPassword? + attr_reader password: OrganizationServicePassword? + end +end diff --git a/sig/zitadel/client/models/organization_service_add_organization_domain_request.rbs b/sig/zitadel/client/models/organization_service_add_organization_domain_request.rbs new file mode 100644 index 00000000..53acb2f4 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_add_organization_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceAddOrganizationDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_add_organization_domain_response.rbs b/sig/zitadel/client/models/organization_service_add_organization_domain_response.rbs new file mode 100644 index 00000000..c5177be7 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_add_organization_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceAddOrganizationDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_add_organization_request.rbs b/sig/zitadel/client/models/organization_service_add_organization_request.rbs new file mode 100644 index 00000000..18f6df88 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_add_organization_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OrganizationServiceAddOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader admins: Array[OrganizationServiceAdmin]? + attr_reader organization_id: String? + attr_reader org_id: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_add_organization_response.rbs b/sig/zitadel/client/models/organization_service_add_organization_response.rbs new file mode 100644 index 00000000..4054fed9 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_add_organization_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceAddOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: OrganizationServiceDetails? + attr_reader organization_id: String? + attr_reader created_admins: Array[OrganizationServiceCreatedAdmin]? + end +end diff --git a/sig/zitadel/client/models/organization_service_admin.rbs b/sig/zitadel/client/models/organization_service_admin.rbs new file mode 100644 index 00000000..9335f3b8 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_admin.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceAdmin < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader roles: Array[String]? + attr_reader human: OrganizationServiceAddHumanUserRequest? + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_any.rbs b/sig/zitadel/client/models/organization_service_any.rbs new file mode 100644 index 00000000..be8bb19d --- /dev/null +++ b/sig/zitadel/client/models/organization_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OrganizationServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/organization_service_connect_error.rbs b/sig/zitadel/client/models/organization_service_connect_error.rbs new file mode 100644 index 00000000..0d466238 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OrganizationServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[OrganizationServiceAny]? + end +end diff --git a/sig/zitadel/client/models/organization_service_created_admin.rbs b/sig/zitadel/client/models/organization_service_created_admin.rbs new file mode 100644 index 00000000..9b01e249 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_created_admin.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceCreatedAdmin < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader email_code: String? + attr_reader phone_code: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_deactivate_organization_request.rbs b/sig/zitadel/client/models/organization_service_deactivate_organization_request.rbs new file mode 100644 index 00000000..023fa42e --- /dev/null +++ b/sig/zitadel/client/models/organization_service_deactivate_organization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceDeactivateOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_deactivate_organization_response.rbs b/sig/zitadel/client/models/organization_service_deactivate_organization_response.rbs new file mode 100644 index 00000000..07d53c3c --- /dev/null +++ b/sig/zitadel/client/models/organization_service_deactivate_organization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceDeactivateOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_delete_organization_domain_request.rbs b/sig/zitadel/client/models/organization_service_delete_organization_domain_request.rbs new file mode 100644 index 00000000..58d22502 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_delete_organization_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceDeleteOrganizationDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_delete_organization_domain_response.rbs b/sig/zitadel/client/models/organization_service_delete_organization_domain_response.rbs new file mode 100644 index 00000000..7e90af09 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_delete_organization_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceDeleteOrganizationDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_delete_organization_metadata_request.rbs b/sig/zitadel/client/models/organization_service_delete_organization_metadata_request.rbs new file mode 100644 index 00000000..db437ad9 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_delete_organization_metadata_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceDeleteOrganizationMetadataRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/organization_service_delete_organization_metadata_response.rbs b/sig/zitadel/client/models/organization_service_delete_organization_metadata_response.rbs new file mode 100644 index 00000000..f51dd335 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_delete_organization_metadata_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceDeleteOrganizationMetadataResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_delete_organization_request.rbs b/sig/zitadel/client/models/organization_service_delete_organization_request.rbs new file mode 100644 index 00000000..213a2044 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_delete_organization_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceDeleteOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_delete_organization_response.rbs b/sig/zitadel/client/models/organization_service_delete_organization_response.rbs new file mode 100644 index 00000000..466a05a5 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_delete_organization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceDeleteOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_details.rbs b/sig/zitadel/client/models/organization_service_details.rbs new file mode 100644 index 00000000..d5ebf96f --- /dev/null +++ b/sig/zitadel/client/models/organization_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OrganizationServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_domain.rbs b/sig/zitadel/client/models/organization_service_domain.rbs new file mode 100644 index 00000000..45922370 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_domain.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class OrganizationServiceDomain < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain: String? + attr_reader is_verified: bool? + attr_reader is_primary: bool? + attr_reader validation_type: OrganizationServiceDomainValidationType? + end +end diff --git a/sig/zitadel/client/models/organization_service_domain_field_name.rbs b/sig/zitadel/client/models/organization_service_domain_field_name.rbs new file mode 100644 index 00000000..586a7e20 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_domain_field_name.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceDomainFieldName + DOMAIN_FIELD_NAME_UNSPECIFIED: String + DOMAIN_FIELD_NAME_NAME: String + DOMAIN_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/organization_service_domain_search_filter.rbs b/sig/zitadel/client/models/organization_service_domain_search_filter.rbs new file mode 100644 index 00000000..d6ad2005 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_domain_search_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceDomainSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain_filter: OrganizationServiceOrganizationDomainQuery? + end +end diff --git a/sig/zitadel/client/models/organization_service_domain_validation_type.rbs b/sig/zitadel/client/models/organization_service_domain_validation_type.rbs new file mode 100644 index 00000000..6fe68853 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_domain_validation_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceDomainValidationType + DOMAIN_VALIDATION_TYPE_UNSPECIFIED: String + DOMAIN_VALIDATION_TYPE_HTTP: String + DOMAIN_VALIDATION_TYPE_DNS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/organization_service_gender.rbs b/sig/zitadel/client/models/organization_service_gender.rbs new file mode 100644 index 00000000..71ca8a79 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_gender.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceGender + GENDER_UNSPECIFIED: String + GENDER_FEMALE: String + GENDER_MALE: String + GENDER_DIVERSE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/organization_service_generate_organization_domain_validation_request.rbs b/sig/zitadel/client/models/organization_service_generate_organization_domain_validation_request.rbs new file mode 100644 index 00000000..3cc8b8b0 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_generate_organization_domain_validation_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceGenerateOrganizationDomainValidationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain: String? + attr_reader type: OrganizationServiceDomainValidationType? + end +end diff --git a/sig/zitadel/client/models/organization_service_generate_organization_domain_validation_response.rbs b/sig/zitadel/client/models/organization_service_generate_organization_domain_validation_response.rbs new file mode 100644 index 00000000..c5e67e42 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_generate_organization_domain_validation_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceGenerateOrganizationDomainValidationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader token: String? + attr_reader url: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_hashed_password.rbs b/sig/zitadel/client/models/organization_service_hashed_password.rbs new file mode 100644 index 00000000..bec82f3b --- /dev/null +++ b/sig/zitadel/client/models/organization_service_hashed_password.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceHashedPassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader hash: String? + attr_reader change_required: bool? + end +end diff --git a/sig/zitadel/client/models/organization_service_idp_link.rbs b/sig/zitadel/client/models/organization_service_idp_link.rbs new file mode 100644 index 00000000..5bf96aaa --- /dev/null +++ b/sig/zitadel/client/models/organization_service_idp_link.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceIDPLink < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_id: String? + attr_reader user_id: String? + attr_reader user_name: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_list_details.rbs b/sig/zitadel/client/models/organization_service_list_details.rbs new file mode 100644 index 00000000..1b8c6781 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_list_details.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceListDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader processed_sequence: untyped? + attr_reader timestamp: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_list_organization_domains_request.rbs b/sig/zitadel/client/models/organization_service_list_organization_domains_request.rbs new file mode 100644 index 00000000..1e619fd6 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_list_organization_domains_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OrganizationServiceListOrganizationDomainsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader pagination: OrganizationServicePaginationRequest? + attr_reader filters: Array[OrganizationServiceDomainSearchFilter]? + attr_reader sorting_column: OrganizationServiceDomainFieldName? + end +end diff --git a/sig/zitadel/client/models/organization_service_list_organization_domains_response.rbs b/sig/zitadel/client/models/organization_service_list_organization_domains_response.rbs new file mode 100644 index 00000000..c294efb5 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_list_organization_domains_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceListOrganizationDomainsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: OrganizationServicePaginationResponse? + attr_reader domains: Array[OrganizationServiceDomain]? + end +end diff --git a/sig/zitadel/client/models/organization_service_list_organization_metadata_request.rbs b/sig/zitadel/client/models/organization_service_list_organization_metadata_request.rbs new file mode 100644 index 00000000..e9ffa404 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_list_organization_metadata_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceListOrganizationMetadataRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader pagination: OrganizationServicePaginationRequest? + attr_reader filters: Array[OrganizationServiceMetadataSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/organization_service_list_organization_metadata_response.rbs b/sig/zitadel/client/models/organization_service_list_organization_metadata_response.rbs new file mode 100644 index 00000000..cd2f4674 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_list_organization_metadata_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceListOrganizationMetadataResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: OrganizationServicePaginationResponse? + attr_reader metadata: Array[OrganizationServiceMetadata]? + end +end diff --git a/sig/zitadel/client/models/organization_service_list_organizations_request.rbs b/sig/zitadel/client/models/organization_service_list_organizations_request.rbs new file mode 100644 index 00000000..0dec91c7 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_list_organizations_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceListOrganizationsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader query: OrganizationServiceListQuery? + attr_reader sorting_column: OrganizationServiceOrganizationFieldName? + attr_reader queries: Array[OrganizationServiceSearchQuery]? + end +end diff --git a/sig/zitadel/client/models/organization_service_list_organizations_response.rbs b/sig/zitadel/client/models/organization_service_list_organizations_response.rbs new file mode 100644 index 00000000..59003e43 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_list_organizations_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceListOrganizationsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: OrganizationServiceListDetails? + attr_reader sorting_column: OrganizationServiceOrganizationFieldName? + attr_reader result: Array[OrganizationServiceOrganization]? + end +end diff --git a/sig/zitadel/client/models/organization_service_list_query.rbs b/sig/zitadel/client/models/organization_service_list_query.rbs new file mode 100644 index 00000000..8c4f34ab --- /dev/null +++ b/sig/zitadel/client/models/organization_service_list_query.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceListQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/organization_service_metadata.rbs b/sig/zitadel/client/models/organization_service_metadata.rbs new file mode 100644 index 00000000..777cff07 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_metadata.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceMetadata < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader value: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_metadata_key_filter.rbs b/sig/zitadel/client/models/organization_service_metadata_key_filter.rbs new file mode 100644 index 00000000..1e976c5c --- /dev/null +++ b/sig/zitadel/client/models/organization_service_metadata_key_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceMetadataKeyFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader method: OrganizationServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/organization_service_metadata_search_filter.rbs b/sig/zitadel/client/models/organization_service_metadata_search_filter.rbs new file mode 100644 index 00000000..bd65977b --- /dev/null +++ b/sig/zitadel/client/models/organization_service_metadata_search_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceMetadataSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_filter: OrganizationServiceMetadataKeyFilter? + end +end diff --git a/sig/zitadel/client/models/organization_service_organization.rbs b/sig/zitadel/client/models/organization_service_organization.rbs new file mode 100644 index 00000000..d5b3f9bb --- /dev/null +++ b/sig/zitadel/client/models/organization_service_organization.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class OrganizationServiceOrganization < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader details: OrganizationServiceDetails? + attr_reader state: OrganizationServiceOrganizationState? + attr_reader name: String? + attr_reader primary_domain: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_organization_domain_query.rbs b/sig/zitadel/client/models/organization_service_organization_domain_query.rbs new file mode 100644 index 00000000..6fa2e60f --- /dev/null +++ b/sig/zitadel/client/models/organization_service_organization_domain_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceOrganizationDomainQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain: String? + attr_reader method: OrganizationServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/organization_service_organization_field_name.rbs b/sig/zitadel/client/models/organization_service_organization_field_name.rbs new file mode 100644 index 00000000..d19452e6 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_organization_field_name.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceOrganizationFieldName + ORGANIZATION_FIELD_NAME_UNSPECIFIED: String + ORGANIZATION_FIELD_NAME_NAME: String + ORGANIZATION_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/organization_service_organization_id_query.rbs b/sig/zitadel/client/models/organization_service_organization_id_query.rbs new file mode 100644 index 00000000..d89b2dfb --- /dev/null +++ b/sig/zitadel/client/models/organization_service_organization_id_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceOrganizationIDQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_organization_name_query.rbs b/sig/zitadel/client/models/organization_service_organization_name_query.rbs new file mode 100644 index 00000000..3f91dd49 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_organization_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceOrganizationNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader method: OrganizationServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/organization_service_organization_state.rbs b/sig/zitadel/client/models/organization_service_organization_state.rbs new file mode 100644 index 00000000..43f3c970 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_organization_state.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServiceOrganizationState + ORGANIZATION_STATE_UNSPECIFIED: String + ORGANIZATION_STATE_ACTIVE: String + ORGANIZATION_STATE_INACTIVE: String + ORGANIZATION_STATE_REMOVED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/organization_service_organization_state_query.rbs b/sig/zitadel/client/models/organization_service_organization_state_query.rbs new file mode 100644 index 00000000..150c2bba --- /dev/null +++ b/sig/zitadel/client/models/organization_service_organization_state_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceOrganizationStateQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader state: OrganizationServiceOrganizationState? + end +end diff --git a/sig/zitadel/client/models/organization_service_pagination_request.rbs b/sig/zitadel/client/models/organization_service_pagination_request.rbs new file mode 100644 index 00000000..aa3928b1 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class OrganizationServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/organization_service_pagination_response.rbs b/sig/zitadel/client/models/organization_service_pagination_response.rbs new file mode 100644 index 00000000..2b7e6f04 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/organization_service_password.rbs b/sig/zitadel/client/models/organization_service_password.rbs new file mode 100644 index 00000000..d70227eb --- /dev/null +++ b/sig/zitadel/client/models/organization_service_password.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServicePassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader password: String? + attr_reader change_required: bool? + end +end diff --git a/sig/zitadel/client/models/organization_service_search_query.rbs b/sig/zitadel/client/models/organization_service_search_query.rbs new file mode 100644 index 00000000..b4900476 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_search_query.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class OrganizationServiceSearchQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader default_query: untyped? + attr_reader domain_query: OrganizationServiceOrganizationDomainQuery? + attr_reader id_query: OrganizationServiceOrganizationIDQuery? + attr_reader name_query: OrganizationServiceOrganizationNameQuery? + attr_reader state_query: OrganizationServiceOrganizationStateQuery? + end +end diff --git a/sig/zitadel/client/models/organization_service_send_email_verification_code.rbs b/sig/zitadel/client/models/organization_service_send_email_verification_code.rbs new file mode 100644 index 00000000..24adcfc8 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_send_email_verification_code.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceSendEmailVerificationCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_set_human_email.rbs b/sig/zitadel/client/models/organization_service_set_human_email.rbs new file mode 100644 index 00000000..b8603452 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_set_human_email.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OrganizationServiceSetHumanEmail < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader email: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: OrganizationServiceSendEmailVerificationCode? + end +end diff --git a/sig/zitadel/client/models/organization_service_set_human_phone.rbs b/sig/zitadel/client/models/organization_service_set_human_phone.rbs new file mode 100644 index 00000000..b910c138 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_set_human_phone.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class OrganizationServiceSetHumanPhone < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader phone: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: untyped? + end +end diff --git a/sig/zitadel/client/models/organization_service_set_human_profile.rbs b/sig/zitadel/client/models/organization_service_set_human_profile.rbs new file mode 100644 index 00000000..fa7abbb2 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_set_human_profile.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class OrganizationServiceSetHumanProfile < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader given_name: String? + attr_reader family_name: String? + attr_reader nick_name: String? + attr_reader display_name: String? + attr_reader preferred_language: String? + attr_reader gender: OrganizationServiceGender? + end +end diff --git a/sig/zitadel/client/models/organization_service_set_metadata_entry.rbs b/sig/zitadel/client/models/organization_service_set_metadata_entry.rbs new file mode 100644 index 00000000..00dfb25c --- /dev/null +++ b/sig/zitadel/client/models/organization_service_set_metadata_entry.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceSetMetadataEntry < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader value: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_set_organization_metadata_request.rbs b/sig/zitadel/client/models/organization_service_set_organization_metadata_request.rbs new file mode 100644 index 00000000..5487c537 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_set_organization_metadata_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceSetOrganizationMetadataRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader metadata: Array[OrganizationServiceMetadata]? + end +end diff --git a/sig/zitadel/client/models/organization_service_set_organization_metadata_response.rbs b/sig/zitadel/client/models/organization_service_set_organization_metadata_response.rbs new file mode 100644 index 00000000..ea3095cd --- /dev/null +++ b/sig/zitadel/client/models/organization_service_set_organization_metadata_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceSetOrganizationMetadataResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader set_date: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_text_filter_method.rbs b/sig/zitadel/client/models/organization_service_text_filter_method.rbs new file mode 100644 index 00000000..35a37fc9 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class OrganizationServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/organization_service_text_query_method.rbs b/sig/zitadel/client/models/organization_service_text_query_method.rbs new file mode 100644 index 00000000..1a26ee2e --- /dev/null +++ b/sig/zitadel/client/models/organization_service_text_query_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class OrganizationServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS: String + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE: String + TEXT_QUERY_METHOD_STARTS_WITH: String + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_QUERY_METHOD_CONTAINS: String + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_QUERY_METHOD_ENDS_WITH: String + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/organization_service_update_organization_request.rbs b/sig/zitadel/client/models/organization_service_update_organization_request.rbs new file mode 100644 index 00000000..35d58876 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_update_organization_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceUpdateOrganizationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader name: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_update_organization_response.rbs b/sig/zitadel/client/models/organization_service_update_organization_response.rbs new file mode 100644 index 00000000..c8c3544e --- /dev/null +++ b/sig/zitadel/client/models/organization_service_update_organization_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceUpdateOrganizationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/organization_service_verify_organization_domain_request.rbs b/sig/zitadel/client/models/organization_service_verify_organization_domain_request.rbs new file mode 100644 index 00000000..912dfce3 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_verify_organization_domain_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class OrganizationServiceVerifyOrganizationDomainRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/organization_service_verify_organization_domain_response.rbs b/sig/zitadel/client/models/organization_service_verify_organization_domain_response.rbs new file mode 100644 index 00000000..dc5eca75 --- /dev/null +++ b/sig/zitadel/client/models/organization_service_verify_organization_domain_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class OrganizationServiceVerifyOrganizationDomainResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_activate_project_grant_request.rbs b/sig/zitadel/client/models/project_service_activate_project_grant_request.rbs new file mode 100644 index 00000000..02ed3318 --- /dev/null +++ b/sig/zitadel/client/models/project_service_activate_project_grant_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceActivateProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + end +end diff --git a/sig/zitadel/client/models/project_service_activate_project_grant_response.rbs b/sig/zitadel/client/models/project_service_activate_project_grant_response.rbs new file mode 100644 index 00000000..c4240b49 --- /dev/null +++ b/sig/zitadel/client/models/project_service_activate_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceActivateProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_activate_project_request.rbs b/sig/zitadel/client/models/project_service_activate_project_request.rbs new file mode 100644 index 00000000..a8c82621 --- /dev/null +++ b/sig/zitadel/client/models/project_service_activate_project_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceActivateProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/project_service_activate_project_response.rbs b/sig/zitadel/client/models/project_service_activate_project_response.rbs new file mode 100644 index 00000000..9d93bc4b --- /dev/null +++ b/sig/zitadel/client/models/project_service_activate_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceActivateProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_add_project_role_request.rbs b/sig/zitadel/client/models/project_service_add_project_role_request.rbs new file mode 100644 index 00000000..1cff1e9e --- /dev/null +++ b/sig/zitadel/client/models/project_service_add_project_role_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ProjectServiceAddProjectRoleRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader role_key: String? + attr_reader display_name: String? + attr_reader group: String? + end +end diff --git a/sig/zitadel/client/models/project_service_add_project_role_response.rbs b/sig/zitadel/client/models/project_service_add_project_role_response.rbs new file mode 100644 index 00000000..c815cf1e --- /dev/null +++ b/sig/zitadel/client/models/project_service_add_project_role_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceAddProjectRoleResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_any.rbs b/sig/zitadel/client/models/project_service_any.rbs new file mode 100644 index 00000000..18c5ae26 --- /dev/null +++ b/sig/zitadel/client/models/project_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ProjectServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/project_service_connect_error.rbs b/sig/zitadel/client/models/project_service_connect_error.rbs new file mode 100644 index 00000000..b87e08d6 --- /dev/null +++ b/sig/zitadel/client/models/project_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ProjectServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[ProjectServiceAny]? + end +end diff --git a/sig/zitadel/client/models/project_service_create_project_grant_request.rbs b/sig/zitadel/client/models/project_service_create_project_grant_request.rbs new file mode 100644 index 00000000..1e607dae --- /dev/null +++ b/sig/zitadel/client/models/project_service_create_project_grant_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ProjectServiceCreateProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + attr_reader role_keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/project_service_create_project_grant_response.rbs b/sig/zitadel/client/models/project_service_create_project_grant_response.rbs new file mode 100644 index 00000000..87cbe850 --- /dev/null +++ b/sig/zitadel/client/models/project_service_create_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceCreateProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_create_project_request.rbs b/sig/zitadel/client/models/project_service_create_project_request.rbs new file mode 100644 index 00000000..a401bbcc --- /dev/null +++ b/sig/zitadel/client/models/project_service_create_project_request.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class ProjectServiceCreateProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader project_id: String? + attr_reader name: String? + attr_reader project_role_assertion: bool? + attr_reader authorization_required: bool? + attr_reader project_access_required: bool? + attr_reader private_labeling_setting: ProjectServicePrivateLabelingSetting? + end +end diff --git a/sig/zitadel/client/models/project_service_create_project_response.rbs b/sig/zitadel/client/models/project_service_create_project_response.rbs new file mode 100644 index 00000000..7f479db2 --- /dev/null +++ b/sig/zitadel/client/models/project_service_create_project_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceCreateProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_deactivate_project_grant_request.rbs b/sig/zitadel/client/models/project_service_deactivate_project_grant_request.rbs new file mode 100644 index 00000000..119c76e8 --- /dev/null +++ b/sig/zitadel/client/models/project_service_deactivate_project_grant_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceDeactivateProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + end +end diff --git a/sig/zitadel/client/models/project_service_deactivate_project_grant_response.rbs b/sig/zitadel/client/models/project_service_deactivate_project_grant_response.rbs new file mode 100644 index 00000000..1b460ee2 --- /dev/null +++ b/sig/zitadel/client/models/project_service_deactivate_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceDeactivateProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_deactivate_project_request.rbs b/sig/zitadel/client/models/project_service_deactivate_project_request.rbs new file mode 100644 index 00000000..53b35a1e --- /dev/null +++ b/sig/zitadel/client/models/project_service_deactivate_project_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceDeactivateProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/project_service_deactivate_project_response.rbs b/sig/zitadel/client/models/project_service_deactivate_project_response.rbs new file mode 100644 index 00000000..320be0ec --- /dev/null +++ b/sig/zitadel/client/models/project_service_deactivate_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceDeactivateProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_delete_project_grant_request.rbs b/sig/zitadel/client/models/project_service_delete_project_grant_request.rbs new file mode 100644 index 00000000..2f5e68cf --- /dev/null +++ b/sig/zitadel/client/models/project_service_delete_project_grant_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceDeleteProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + end +end diff --git a/sig/zitadel/client/models/project_service_delete_project_grant_response.rbs b/sig/zitadel/client/models/project_service_delete_project_grant_response.rbs new file mode 100644 index 00000000..8922a9b9 --- /dev/null +++ b/sig/zitadel/client/models/project_service_delete_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceDeleteProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_delete_project_request.rbs b/sig/zitadel/client/models/project_service_delete_project_request.rbs new file mode 100644 index 00000000..28f87ab9 --- /dev/null +++ b/sig/zitadel/client/models/project_service_delete_project_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceDeleteProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/project_service_delete_project_response.rbs b/sig/zitadel/client/models/project_service_delete_project_response.rbs new file mode 100644 index 00000000..03a00ba7 --- /dev/null +++ b/sig/zitadel/client/models/project_service_delete_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceDeleteProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_get_project_request.rbs b/sig/zitadel/client/models/project_service_get_project_request.rbs new file mode 100644 index 00000000..9f9b4636 --- /dev/null +++ b/sig/zitadel/client/models/project_service_get_project_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceGetProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + end +end diff --git a/sig/zitadel/client/models/project_service_get_project_response.rbs b/sig/zitadel/client/models/project_service_get_project_response.rbs new file mode 100644 index 00000000..70f41e95 --- /dev/null +++ b/sig/zitadel/client/models/project_service_get_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceGetProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project: ProjectServiceProject? + end +end diff --git a/sig/zitadel/client/models/project_service_granted_project_state.rbs b/sig/zitadel/client/models/project_service_granted_project_state.rbs new file mode 100644 index 00000000..53d8ea97 --- /dev/null +++ b/sig/zitadel/client/models/project_service_granted_project_state.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceGrantedProjectState + GRANTED_PROJECT_STATE_UNSPECIFIED: String + GRANTED_PROJECT_STATE_ACTIVE: String + GRANTED_PROJECT_STATE_INACTIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/project_service_id_filter.rbs b/sig/zitadel/client/models/project_service_id_filter.rbs new file mode 100644 index 00000000..0eda0a0f --- /dev/null +++ b/sig/zitadel/client/models/project_service_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/project_service_in_ids_filter.rbs b/sig/zitadel/client/models/project_service_in_ids_filter.rbs new file mode 100644 index 00000000..2906e9fa --- /dev/null +++ b/sig/zitadel/client/models/project_service_in_ids_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceInIDsFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/project_service_list_project_grants_request.rbs b/sig/zitadel/client/models/project_service_list_project_grants_request.rbs new file mode 100644 index 00000000..50185ea4 --- /dev/null +++ b/sig/zitadel/client/models/project_service_list_project_grants_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ProjectServiceListProjectGrantsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ProjectServicePaginationRequest? + attr_reader sorting_column: ProjectServiceProjectGrantFieldName? + attr_reader filters: Array[ProjectServiceProjectGrantSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/project_service_list_project_grants_response.rbs b/sig/zitadel/client/models/project_service_list_project_grants_response.rbs new file mode 100644 index 00000000..02bcb83e --- /dev/null +++ b/sig/zitadel/client/models/project_service_list_project_grants_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceListProjectGrantsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ProjectServicePaginationResponse? + attr_reader project_grants: Array[ProjectServiceProjectGrant]? + end +end diff --git a/sig/zitadel/client/models/project_service_list_project_roles_request.rbs b/sig/zitadel/client/models/project_service_list_project_roles_request.rbs new file mode 100644 index 00000000..eabccf62 --- /dev/null +++ b/sig/zitadel/client/models/project_service_list_project_roles_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ProjectServiceListProjectRolesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader pagination: ProjectServicePaginationRequest? + attr_reader sorting_column: ProjectServiceProjectRoleFieldName? + attr_reader filters: Array[ProjectServiceProjectRoleSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/project_service_list_project_roles_response.rbs b/sig/zitadel/client/models/project_service_list_project_roles_response.rbs new file mode 100644 index 00000000..6bb5f921 --- /dev/null +++ b/sig/zitadel/client/models/project_service_list_project_roles_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceListProjectRolesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ProjectServicePaginationResponse? + attr_reader project_roles: Array[ProjectServiceProjectRole]? + end +end diff --git a/sig/zitadel/client/models/project_service_list_projects_request.rbs b/sig/zitadel/client/models/project_service_list_projects_request.rbs new file mode 100644 index 00000000..0192398e --- /dev/null +++ b/sig/zitadel/client/models/project_service_list_projects_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ProjectServiceListProjectsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ProjectServicePaginationRequest? + attr_reader sorting_column: ProjectServiceProjectFieldName? + attr_reader filters: Array[ProjectServiceProjectSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/project_service_list_projects_response.rbs b/sig/zitadel/client/models/project_service_list_projects_response.rbs new file mode 100644 index 00000000..c14b59bb --- /dev/null +++ b/sig/zitadel/client/models/project_service_list_projects_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceListProjectsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: ProjectServicePaginationResponse? + attr_reader projects: Array[ProjectServiceProject]? + end +end diff --git a/sig/zitadel/client/models/project_service_pagination_request.rbs b/sig/zitadel/client/models/project_service_pagination_request.rbs new file mode 100644 index 00000000..1b4f6e36 --- /dev/null +++ b/sig/zitadel/client/models/project_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ProjectServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/project_service_pagination_response.rbs b/sig/zitadel/client/models/project_service_pagination_response.rbs new file mode 100644 index 00000000..4bf3bda3 --- /dev/null +++ b/sig/zitadel/client/models/project_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/project_service_private_labeling_setting.rbs b/sig/zitadel/client/models/project_service_private_labeling_setting.rbs new file mode 100644 index 00000000..55fa1f7b --- /dev/null +++ b/sig/zitadel/client/models/project_service_private_labeling_setting.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServicePrivateLabelingSetting + PRIVATE_LABELING_SETTING_UNSPECIFIED: String + PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY: String + PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/project_service_project.rbs b/sig/zitadel/client/models/project_service_project.rbs new file mode 100644 index 00000000..3c4824d3 --- /dev/null +++ b/sig/zitadel/client/models/project_service_project.rbs @@ -0,0 +1,21 @@ +module Zitadel::Client::Models + class ProjectServiceProject < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader organization_id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader name: String? + attr_reader state: ProjectServiceProjectState? + attr_reader project_role_assertion: bool? + attr_reader authorization_required: bool? + attr_reader project_access_required: bool? + attr_reader private_labeling_setting: ProjectServicePrivateLabelingSetting? + attr_reader granted_organization_id: String? + attr_reader granted_organization_name: String? + attr_reader granted_state: ProjectServiceGrantedProjectState? + end +end diff --git a/sig/zitadel/client/models/project_service_project_field_name.rbs b/sig/zitadel/client/models/project_service_project_field_name.rbs new file mode 100644 index 00000000..7488b5cf --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_field_name.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ProjectServiceProjectFieldName + PROJECT_FIELD_NAME_UNSPECIFIED: String + PROJECT_FIELD_NAME_ID: String + PROJECT_FIELD_NAME_CREATION_DATE: String + PROJECT_FIELD_NAME_CHANGE_DATE: String + PROJECT_FIELD_NAME_NAME: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/project_service_project_grant.rbs b/sig/zitadel/client/models/project_service_project_grant.rbs new file mode 100644 index 00000000..946596ad --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_grant.rbs @@ -0,0 +1,17 @@ +module Zitadel::Client::Models + class ProjectServiceProjectGrant < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader granted_organization_id: String? + attr_reader granted_organization_name: String? + attr_reader granted_role_keys: Array[String]? + attr_reader project_id: String? + attr_reader project_name: String? + attr_reader state: ProjectServiceProjectGrantState? + end +end diff --git a/sig/zitadel/client/models/project_service_project_grant_field_name.rbs b/sig/zitadel/client/models/project_service_project_grant_field_name.rbs new file mode 100644 index 00000000..bb442dc4 --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_grant_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ProjectServiceProjectGrantFieldName + PROJECT_GRANT_FIELD_NAME_UNSPECIFIED: String + PROJECT_GRANT_FIELD_NAME_PROJECT_ID: String + PROJECT_GRANT_FIELD_NAME_CREATION_DATE: String + PROJECT_GRANT_FIELD_NAME_CHANGE_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/project_service_project_grant_search_filter.rbs b/sig/zitadel/client/models/project_service_project_grant_search_filter.rbs new file mode 100644 index 00000000..241dca9e --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_grant_search_filter.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class ProjectServiceProjectGrantSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader granted_organization_id_filter: ProjectServiceIDFilter? + attr_reader in_project_ids_filter: ProjectServiceInIDsFilter? + attr_reader organization_id_filter: ProjectServiceIDFilter? + attr_reader project_name_filter: ProjectServiceProjectNameFilter? + attr_reader role_key_filter: ProjectServiceProjectRoleKeyFilter? + end +end diff --git a/sig/zitadel/client/models/project_service_project_grant_state.rbs b/sig/zitadel/client/models/project_service_project_grant_state.rbs new file mode 100644 index 00000000..8ad859dd --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_grant_state.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceProjectGrantState + PROJECT_GRANT_STATE_UNSPECIFIED: String + PROJECT_GRANT_STATE_ACTIVE: String + PROJECT_GRANT_STATE_INACTIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/project_service_project_name_filter.rbs b/sig/zitadel/client/models/project_service_project_name_filter.rbs new file mode 100644 index 00000000..d23ebca9 --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceProjectNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_name: String? + attr_reader method: ProjectServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/project_service_project_organization_id_filter.rbs b/sig/zitadel/client/models/project_service_project_organization_id_filter.rbs new file mode 100644 index 00000000..125c5c08 --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_organization_id_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceProjectOrganizationIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader type: ProjectServiceType? + end +end diff --git a/sig/zitadel/client/models/project_service_project_role.rbs b/sig/zitadel/client/models/project_service_project_role.rbs new file mode 100644 index 00000000..7d6c3589 --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_role.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class ProjectServiceProjectRole < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader key: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader display_name: String? + attr_reader group: String? + end +end diff --git a/sig/zitadel/client/models/project_service_project_role_display_name_filter.rbs b/sig/zitadel/client/models/project_service_project_role_display_name_filter.rbs new file mode 100644 index 00000000..ca4145c9 --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_role_display_name_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceProjectRoleDisplayNameFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name: String? + attr_reader method: ProjectServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/project_service_project_role_field_name.rbs b/sig/zitadel/client/models/project_service_project_role_field_name.rbs new file mode 100644 index 00000000..b63cbe5b --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_role_field_name.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ProjectServiceProjectRoleFieldName + PROJECT_ROLE_FIELD_NAME_UNSPECIFIED: String + PROJECT_ROLE_FIELD_NAME_KEY: String + PROJECT_ROLE_FIELD_NAME_CREATION_DATE: String + PROJECT_ROLE_FIELD_NAME_CHANGE_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/project_service_project_role_key_filter.rbs b/sig/zitadel/client/models/project_service_project_role_key_filter.rbs new file mode 100644 index 00000000..42ada26e --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_role_key_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceProjectRoleKeyFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader method: ProjectServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/project_service_project_role_search_filter.rbs b/sig/zitadel/client/models/project_service_project_role_search_filter.rbs new file mode 100644 index 00000000..88eca2a0 --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_role_search_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceProjectRoleSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name_filter: ProjectServiceProjectRoleDisplayNameFilter? + attr_reader role_key_filter: ProjectServiceProjectRoleKeyFilter? + end +end diff --git a/sig/zitadel/client/models/project_service_project_search_filter.rbs b/sig/zitadel/client/models/project_service_project_search_filter.rbs new file mode 100644 index 00000000..c2d8ef0d --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_search_filter.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ProjectServiceProjectSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader in_project_ids_filter: ProjectServiceInIDsFilter? + attr_reader organization_id_filter: ProjectServiceProjectOrganizationIDFilter? + attr_reader project_name_filter: ProjectServiceProjectNameFilter? + end +end diff --git a/sig/zitadel/client/models/project_service_project_state.rbs b/sig/zitadel/client/models/project_service_project_state.rbs new file mode 100644 index 00000000..76757758 --- /dev/null +++ b/sig/zitadel/client/models/project_service_project_state.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceProjectState + PROJECT_STATE_UNSPECIFIED: String + PROJECT_STATE_ACTIVE: String + PROJECT_STATE_INACTIVE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/project_service_remove_project_role_request.rbs b/sig/zitadel/client/models/project_service_remove_project_role_request.rbs new file mode 100644 index 00000000..c70d151b --- /dev/null +++ b/sig/zitadel/client/models/project_service_remove_project_role_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class ProjectServiceRemoveProjectRoleRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader role_key: String? + end +end diff --git a/sig/zitadel/client/models/project_service_remove_project_role_response.rbs b/sig/zitadel/client/models/project_service_remove_project_role_response.rbs new file mode 100644 index 00000000..f28b92ce --- /dev/null +++ b/sig/zitadel/client/models/project_service_remove_project_role_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceRemoveProjectRoleResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader removal_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_text_filter_method.rbs b/sig/zitadel/client/models/project_service_text_filter_method.rbs new file mode 100644 index 00000000..7b494f74 --- /dev/null +++ b/sig/zitadel/client/models/project_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class ProjectServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/project_service_type.rbs b/sig/zitadel/client/models/project_service_type.rbs new file mode 100644 index 00000000..270c91fc --- /dev/null +++ b/sig/zitadel/client/models/project_service_type.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ProjectServiceType + TYPE_UNSPECIFIED: String + OWNED: String + GRANTED: String + OWNED_OR_GRANTED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/project_service_update_project_grant_request.rbs b/sig/zitadel/client/models/project_service_update_project_grant_request.rbs new file mode 100644 index 00000000..54db2e13 --- /dev/null +++ b/sig/zitadel/client/models/project_service_update_project_grant_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class ProjectServiceUpdateProjectGrantRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader granted_organization_id: String? + attr_reader role_keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/project_service_update_project_grant_response.rbs b/sig/zitadel/client/models/project_service_update_project_grant_response.rbs new file mode 100644 index 00000000..e0d9a6f0 --- /dev/null +++ b/sig/zitadel/client/models/project_service_update_project_grant_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceUpdateProjectGrantResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_update_project_request.rbs b/sig/zitadel/client/models/project_service_update_project_request.rbs new file mode 100644 index 00000000..7efa098c --- /dev/null +++ b/sig/zitadel/client/models/project_service_update_project_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class ProjectServiceUpdateProjectRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader name: String? + attr_reader project_role_assertion: bool? + attr_reader authorization_required: bool? + attr_reader project_access_required: bool? + attr_reader private_labeling_setting: ProjectServicePrivateLabelingSetting? + end +end diff --git a/sig/zitadel/client/models/project_service_update_project_response.rbs b/sig/zitadel/client/models/project_service_update_project_response.rbs new file mode 100644 index 00000000..fc5c3df1 --- /dev/null +++ b/sig/zitadel/client/models/project_service_update_project_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceUpdateProjectResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/project_service_update_project_role_request.rbs b/sig/zitadel/client/models/project_service_update_project_role_request.rbs new file mode 100644 index 00000000..e0a17be6 --- /dev/null +++ b/sig/zitadel/client/models/project_service_update_project_role_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class ProjectServiceUpdateProjectRoleRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader project_id: String? + attr_reader role_key: String? + attr_reader display_name: String? + attr_reader group: String? + end +end diff --git a/sig/zitadel/client/models/project_service_update_project_role_response.rbs b/sig/zitadel/client/models/project_service_update_project_role_response.rbs new file mode 100644 index 00000000..52ec76e3 --- /dev/null +++ b/sig/zitadel/client/models/project_service_update_project_role_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class ProjectServiceUpdateProjectRoleResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/saml_service_any.rbs b/sig/zitadel/client/models/saml_service_any.rbs new file mode 100644 index 00000000..1ec41bba --- /dev/null +++ b/sig/zitadel/client/models/saml_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SAMLServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/saml_service_authorization_error.rbs b/sig/zitadel/client/models/saml_service_authorization_error.rbs new file mode 100644 index 00000000..4411180f --- /dev/null +++ b/sig/zitadel/client/models/saml_service_authorization_error.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SAMLServiceAuthorizationError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader error: SAMLServiceErrorReason? + attr_reader error_description: String? + end +end diff --git a/sig/zitadel/client/models/saml_service_connect_error.rbs b/sig/zitadel/client/models/saml_service_connect_error.rbs new file mode 100644 index 00000000..0f2e2fce --- /dev/null +++ b/sig/zitadel/client/models/saml_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SAMLServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[SAMLServiceAny]? + end +end diff --git a/sig/zitadel/client/models/saml_service_create_response_request.rbs b/sig/zitadel/client/models/saml_service_create_response_request.rbs new file mode 100644 index 00000000..1abf235c --- /dev/null +++ b/sig/zitadel/client/models/saml_service_create_response_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SAMLServiceCreateResponseRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader saml_request_id: String? + attr_reader error: SAMLServiceAuthorizationError? + attr_reader session: SAMLServiceSession? + end +end diff --git a/sig/zitadel/client/models/saml_service_create_response_response.rbs b/sig/zitadel/client/models/saml_service_create_response_response.rbs new file mode 100644 index 00000000..a77a4676 --- /dev/null +++ b/sig/zitadel/client/models/saml_service_create_response_response.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SAMLServiceCreateResponseResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SAMLServiceDetails? + attr_reader url: String? + attr_reader post: SAMLServicePostResponse? + attr_reader redirect: untyped? + end +end diff --git a/sig/zitadel/client/models/saml_service_details.rbs b/sig/zitadel/client/models/saml_service_details.rbs new file mode 100644 index 00000000..c940e9e5 --- /dev/null +++ b/sig/zitadel/client/models/saml_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SAMLServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/saml_service_error_reason.rbs b/sig/zitadel/client/models/saml_service_error_reason.rbs new file mode 100644 index 00000000..1ea7055c --- /dev/null +++ b/sig/zitadel/client/models/saml_service_error_reason.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class SAMLServiceErrorReason + ERROR_REASON_UNSPECIFIED: String + ERROR_REASON_VERSION_MISSMATCH: String + ERROR_REASON_AUTH_N_FAILED: String + ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE: String + ERROR_REASON_INVALID_NAMEID_POLICY: String + ERROR_REASON_REQUEST_DENIED: String + ERROR_REASON_REQUEST_UNSUPPORTED: String + ERROR_REASON_UNSUPPORTED_BINDING: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/saml_service_get_saml_request_request.rbs b/sig/zitadel/client/models/saml_service_get_saml_request_request.rbs new file mode 100644 index 00000000..1b9b2192 --- /dev/null +++ b/sig/zitadel/client/models/saml_service_get_saml_request_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SAMLServiceGetSAMLRequestRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader saml_request_id: String? + end +end diff --git a/sig/zitadel/client/models/saml_service_get_saml_request_response.rbs b/sig/zitadel/client/models/saml_service_get_saml_request_response.rbs new file mode 100644 index 00000000..1a0e81ab --- /dev/null +++ b/sig/zitadel/client/models/saml_service_get_saml_request_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SAMLServiceGetSAMLRequestResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader saml_request: SAMLServiceSAMLRequest? + end +end diff --git a/sig/zitadel/client/models/saml_service_post_response.rbs b/sig/zitadel/client/models/saml_service_post_response.rbs new file mode 100644 index 00000000..8231ab65 --- /dev/null +++ b/sig/zitadel/client/models/saml_service_post_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SAMLServicePostResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader relay_state: String? + attr_reader saml_response: String? + end +end diff --git a/sig/zitadel/client/models/saml_service_saml_request.rbs b/sig/zitadel/client/models/saml_service_saml_request.rbs new file mode 100644 index 00000000..75586599 --- /dev/null +++ b/sig/zitadel/client/models/saml_service_saml_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class SAMLServiceSAMLRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader issuer: String? + attr_reader assertion_consumer_service: String? + attr_reader relay_state: String? + attr_reader binding: String? + end +end diff --git a/sig/zitadel/client/models/saml_service_session.rbs b/sig/zitadel/client/models/saml_service_session.rbs new file mode 100644 index 00000000..2e2c4af4 --- /dev/null +++ b/sig/zitadel/client/models/saml_service_session.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SAMLServiceSession < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session_id: String? + attr_reader session_token: String? + end +end diff --git a/sig/zitadel/client/models/session_service_any.rbs b/sig/zitadel/client/models/session_service_any.rbs new file mode 100644 index 00000000..1a746257 --- /dev/null +++ b/sig/zitadel/client/models/session_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SessionServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/session_service_challenges.rbs b/sig/zitadel/client/models/session_service_challenges.rbs new file mode 100644 index 00000000..e76749a6 --- /dev/null +++ b/sig/zitadel/client/models/session_service_challenges.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SessionServiceChallenges < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader web_auth_n: SessionServiceWebAuthN? + attr_reader otp_sms: String? + attr_reader otp_email: String? + end +end diff --git a/sig/zitadel/client/models/session_service_check_idp_intent.rbs b/sig/zitadel/client/models/session_service_check_idp_intent.rbs new file mode 100644 index 00000000..03c979bf --- /dev/null +++ b/sig/zitadel/client/models/session_service_check_idp_intent.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceCheckIDPIntent < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_intent_id: String? + attr_reader idp_intent_token: String? + end +end diff --git a/sig/zitadel/client/models/session_service_check_otp.rbs b/sig/zitadel/client/models/session_service_check_otp.rbs new file mode 100644 index 00000000..153e83e0 --- /dev/null +++ b/sig/zitadel/client/models/session_service_check_otp.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceCheckOTP < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader code: String? + end +end diff --git a/sig/zitadel/client/models/session_service_check_password.rbs b/sig/zitadel/client/models/session_service_check_password.rbs new file mode 100644 index 00000000..78b047f4 --- /dev/null +++ b/sig/zitadel/client/models/session_service_check_password.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceCheckPassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader password: String? + end +end diff --git a/sig/zitadel/client/models/session_service_check_recovery_code.rbs b/sig/zitadel/client/models/session_service_check_recovery_code.rbs new file mode 100644 index 00000000..f81c2b16 --- /dev/null +++ b/sig/zitadel/client/models/session_service_check_recovery_code.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceCheckRecoveryCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader code: String? + end +end diff --git a/sig/zitadel/client/models/session_service_check_totp.rbs b/sig/zitadel/client/models/session_service_check_totp.rbs new file mode 100644 index 00000000..c42d3245 --- /dev/null +++ b/sig/zitadel/client/models/session_service_check_totp.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceCheckTOTP < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader code: String? + end +end diff --git a/sig/zitadel/client/models/session_service_check_user.rbs b/sig/zitadel/client/models/session_service_check_user.rbs new file mode 100644 index 00000000..338457b1 --- /dev/null +++ b/sig/zitadel/client/models/session_service_check_user.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceCheckUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_name: String? + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/session_service_check_web_auth_n.rbs b/sig/zitadel/client/models/session_service_check_web_auth_n.rbs new file mode 100644 index 00000000..8af24174 --- /dev/null +++ b/sig/zitadel/client/models/session_service_check_web_auth_n.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceCheckWebAuthN < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader credential_assertion_data: Hash[String, untyped]? + end +end diff --git a/sig/zitadel/client/models/session_service_checks.rbs b/sig/zitadel/client/models/session_service_checks.rbs new file mode 100644 index 00000000..2decee5c --- /dev/null +++ b/sig/zitadel/client/models/session_service_checks.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class SessionServiceChecks < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user: SessionServiceCheckUser? + attr_reader password: SessionServiceCheckPassword? + attr_reader web_auth_n: SessionServiceCheckWebAuthN? + attr_reader idp_intent: SessionServiceCheckIDPIntent? + attr_reader totp: SessionServiceCheckTOTP? + attr_reader otp_sms: SessionServiceCheckOTP? + attr_reader otp_email: SessionServiceCheckOTP? + attr_reader recovery_code: SessionServiceCheckRecoveryCode? + end +end diff --git a/sig/zitadel/client/models/session_service_connect_error.rbs b/sig/zitadel/client/models/session_service_connect_error.rbs new file mode 100644 index 00000000..f38d958a --- /dev/null +++ b/sig/zitadel/client/models/session_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SessionServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[SessionServiceAny]? + end +end diff --git a/sig/zitadel/client/models/session_service_create_session_request.rbs b/sig/zitadel/client/models/session_service_create_session_request.rbs new file mode 100644 index 00000000..94fa94c0 --- /dev/null +++ b/sig/zitadel/client/models/session_service_create_session_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class SessionServiceCreateSessionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader checks: SessionServiceChecks? + attr_reader metadata: Hash[String, String]? + attr_reader challenges: SessionServiceRequestChallenges? + attr_reader user_agent: SessionServiceUserAgent? + attr_reader lifetime: ISO8601::Duration? + end +end diff --git a/sig/zitadel/client/models/session_service_create_session_response.rbs b/sig/zitadel/client/models/session_service_create_session_response.rbs new file mode 100644 index 00000000..b7df1075 --- /dev/null +++ b/sig/zitadel/client/models/session_service_create_session_response.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SessionServiceCreateSessionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SessionServiceDetails? + attr_reader session_id: String? + attr_reader session_token: String? + attr_reader challenges: SessionServiceChallenges? + end +end diff --git a/sig/zitadel/client/models/session_service_creation_date_query.rbs b/sig/zitadel/client/models/session_service_creation_date_query.rbs new file mode 100644 index 00000000..74049fea --- /dev/null +++ b/sig/zitadel/client/models/session_service_creation_date_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceCreationDateQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader method: SessionServiceTimestampQueryMethod? + end +end diff --git a/sig/zitadel/client/models/session_service_creator_query.rbs b/sig/zitadel/client/models/session_service_creator_query.rbs new file mode 100644 index 00000000..d22a92da --- /dev/null +++ b/sig/zitadel/client/models/session_service_creator_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceCreatorQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/session_service_delete_session_request.rbs b/sig/zitadel/client/models/session_service_delete_session_request.rbs new file mode 100644 index 00000000..b04bd46e --- /dev/null +++ b/sig/zitadel/client/models/session_service_delete_session_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceDeleteSessionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session_id: String? + attr_reader session_token: String? + end +end diff --git a/sig/zitadel/client/models/session_service_delete_session_response.rbs b/sig/zitadel/client/models/session_service_delete_session_response.rbs new file mode 100644 index 00000000..c32b79d4 --- /dev/null +++ b/sig/zitadel/client/models/session_service_delete_session_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceDeleteSessionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SessionServiceDetails? + end +end diff --git a/sig/zitadel/client/models/session_service_details.rbs b/sig/zitadel/client/models/session_service_details.rbs new file mode 100644 index 00000000..344c3c12 --- /dev/null +++ b/sig/zitadel/client/models/session_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SessionServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/session_service_expiration_date_query.rbs b/sig/zitadel/client/models/session_service_expiration_date_query.rbs new file mode 100644 index 00000000..e75a5eac --- /dev/null +++ b/sig/zitadel/client/models/session_service_expiration_date_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceExpirationDateQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader expiration_date: Time? + attr_reader method: SessionServiceTimestampQueryMethod? + end +end diff --git a/sig/zitadel/client/models/session_service_factors.rbs b/sig/zitadel/client/models/session_service_factors.rbs new file mode 100644 index 00000000..8454d868 --- /dev/null +++ b/sig/zitadel/client/models/session_service_factors.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class SessionServiceFactors < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user: SessionServiceUserFactor? + attr_reader password: SessionServicePasswordFactor? + attr_reader web_auth_n: SessionServiceWebAuthNFactor? + attr_reader intent: SessionServiceIntentFactor? + attr_reader totp: SessionServiceTOTPFactor? + attr_reader otp_sms: SessionServiceOTPFactor? + attr_reader otp_email: SessionServiceOTPFactor? + attr_reader recovery_code: SessionServiceRecoveryCodeFactor? + end +end diff --git a/sig/zitadel/client/models/session_service_get_session_request.rbs b/sig/zitadel/client/models/session_service_get_session_request.rbs new file mode 100644 index 00000000..fc070e70 --- /dev/null +++ b/sig/zitadel/client/models/session_service_get_session_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceGetSessionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session_id: String? + attr_reader session_token: String? + end +end diff --git a/sig/zitadel/client/models/session_service_get_session_response.rbs b/sig/zitadel/client/models/session_service_get_session_response.rbs new file mode 100644 index 00000000..acac7cea --- /dev/null +++ b/sig/zitadel/client/models/session_service_get_session_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceGetSessionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session: SessionServiceSession? + end +end diff --git a/sig/zitadel/client/models/session_service_header_values.rbs b/sig/zitadel/client/models/session_service_header_values.rbs new file mode 100644 index 00000000..fc005b97 --- /dev/null +++ b/sig/zitadel/client/models/session_service_header_values.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceHeaderValues < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader values: Array[String]? + end +end diff --git a/sig/zitadel/client/models/session_service_ids_query.rbs b/sig/zitadel/client/models/session_service_ids_query.rbs new file mode 100644 index 00000000..fd5a8309 --- /dev/null +++ b/sig/zitadel/client/models/session_service_ids_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceIDsQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/session_service_intent_factor.rbs b/sig/zitadel/client/models/session_service_intent_factor.rbs new file mode 100644 index 00000000..8fc71cb7 --- /dev/null +++ b/sig/zitadel/client/models/session_service_intent_factor.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceIntentFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + end +end diff --git a/sig/zitadel/client/models/session_service_list_details.rbs b/sig/zitadel/client/models/session_service_list_details.rbs new file mode 100644 index 00000000..291a0556 --- /dev/null +++ b/sig/zitadel/client/models/session_service_list_details.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SessionServiceListDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader processed_sequence: untyped? + attr_reader timestamp: Time? + end +end diff --git a/sig/zitadel/client/models/session_service_list_query.rbs b/sig/zitadel/client/models/session_service_list_query.rbs new file mode 100644 index 00000000..992c3b95 --- /dev/null +++ b/sig/zitadel/client/models/session_service_list_query.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SessionServiceListQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/session_service_list_sessions_request.rbs b/sig/zitadel/client/models/session_service_list_sessions_request.rbs new file mode 100644 index 00000000..8eef96c5 --- /dev/null +++ b/sig/zitadel/client/models/session_service_list_sessions_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SessionServiceListSessionsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader query: SessionServiceListQuery? + attr_reader queries: Array[SessionServiceSearchQuery]? + attr_reader sorting_column: SessionServiceSessionFieldName? + end +end diff --git a/sig/zitadel/client/models/session_service_list_sessions_response.rbs b/sig/zitadel/client/models/session_service_list_sessions_response.rbs new file mode 100644 index 00000000..b53fd1ed --- /dev/null +++ b/sig/zitadel/client/models/session_service_list_sessions_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceListSessionsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SessionServiceListDetails? + attr_reader sessions: Array[SessionServiceSession]? + end +end diff --git a/sig/zitadel/client/models/session_service_otp_email.rbs b/sig/zitadel/client/models/session_service_otp_email.rbs new file mode 100644 index 00000000..ac83aab0 --- /dev/null +++ b/sig/zitadel/client/models/session_service_otp_email.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceOTPEmail < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader return_code: untyped? + attr_reader send_code: SessionServiceSendCode? + end +end diff --git a/sig/zitadel/client/models/session_service_otp_factor.rbs b/sig/zitadel/client/models/session_service_otp_factor.rbs new file mode 100644 index 00000000..7b23cff6 --- /dev/null +++ b/sig/zitadel/client/models/session_service_otp_factor.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceOTPFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + end +end diff --git a/sig/zitadel/client/models/session_service_otpsms.rbs b/sig/zitadel/client/models/session_service_otpsms.rbs new file mode 100644 index 00000000..0903ff09 --- /dev/null +++ b/sig/zitadel/client/models/session_service_otpsms.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceOTPSMS < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader return_code: bool? + end +end diff --git a/sig/zitadel/client/models/session_service_password_factor.rbs b/sig/zitadel/client/models/session_service_password_factor.rbs new file mode 100644 index 00000000..587c85ff --- /dev/null +++ b/sig/zitadel/client/models/session_service_password_factor.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServicePasswordFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + end +end diff --git a/sig/zitadel/client/models/session_service_recovery_code_factor.rbs b/sig/zitadel/client/models/session_service_recovery_code_factor.rbs new file mode 100644 index 00000000..06357a91 --- /dev/null +++ b/sig/zitadel/client/models/session_service_recovery_code_factor.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceRecoveryCodeFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + end +end diff --git a/sig/zitadel/client/models/session_service_request_challenges.rbs b/sig/zitadel/client/models/session_service_request_challenges.rbs new file mode 100644 index 00000000..1a95089f --- /dev/null +++ b/sig/zitadel/client/models/session_service_request_challenges.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SessionServiceRequestChallenges < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader web_auth_n: SessionServiceWebAuthN? + attr_reader otp_sms: SessionServiceOTPSMS? + attr_reader otp_email: SessionServiceOTPEmail? + end +end diff --git a/sig/zitadel/client/models/session_service_search_query.rbs b/sig/zitadel/client/models/session_service_search_query.rbs new file mode 100644 index 00000000..6254b9c0 --- /dev/null +++ b/sig/zitadel/client/models/session_service_search_query.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class SessionServiceSearchQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date_query: SessionServiceCreationDateQuery? + attr_reader creator_query: SessionServiceCreatorQuery? + attr_reader expiration_date_query: SessionServiceExpirationDateQuery? + attr_reader ids_query: SessionServiceIDsQuery? + attr_reader user_agent_query: SessionServiceUserAgentQuery? + attr_reader user_id_query: SessionServiceUserIDQuery? + end +end diff --git a/sig/zitadel/client/models/session_service_send_code.rbs b/sig/zitadel/client/models/session_service_send_code.rbs new file mode 100644 index 00000000..30c2902a --- /dev/null +++ b/sig/zitadel/client/models/session_service_send_code.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceSendCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/session_service_session.rbs b/sig/zitadel/client/models/session_service_session.rbs new file mode 100644 index 00000000..647d22bf --- /dev/null +++ b/sig/zitadel/client/models/session_service_session.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class SessionServiceSession < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader sequence: untyped? + attr_reader factors: SessionServiceFactors? + attr_reader metadata: Hash[String, String]? + attr_reader user_agent: SessionServiceUserAgent? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/session_service_session_field_name.rbs b/sig/zitadel/client/models/session_service_session_field_name.rbs new file mode 100644 index 00000000..c6cbf119 --- /dev/null +++ b/sig/zitadel/client/models/session_service_session_field_name.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceSessionFieldName + SESSION_FIELD_NAME_UNSPECIFIED: String + SESSION_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/session_service_set_session_request.rbs b/sig/zitadel/client/models/session_service_set_session_request.rbs new file mode 100644 index 00000000..5ac1d549 --- /dev/null +++ b/sig/zitadel/client/models/session_service_set_session_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class SessionServiceSetSessionRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader session_id: String? + attr_reader session_token: String? + attr_reader checks: SessionServiceChecks? + attr_reader metadata: Hash[String, String]? + attr_reader challenges: SessionServiceRequestChallenges? + attr_reader lifetime: ISO8601::Duration? + end +end diff --git a/sig/zitadel/client/models/session_service_set_session_response.rbs b/sig/zitadel/client/models/session_service_set_session_response.rbs new file mode 100644 index 00000000..620e17d7 --- /dev/null +++ b/sig/zitadel/client/models/session_service_set_session_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SessionServiceSetSessionResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SessionServiceDetails? + attr_reader session_token: String? + attr_reader challenges: SessionServiceChallenges? + end +end diff --git a/sig/zitadel/client/models/session_service_timestamp_query_method.rbs b/sig/zitadel/client/models/session_service_timestamp_query_method.rbs new file mode 100644 index 00000000..ba061a1a --- /dev/null +++ b/sig/zitadel/client/models/session_service_timestamp_query_method.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SessionServiceTimestampQueryMethod + TIMESTAMP_QUERY_METHOD_EQUALS: String + TIMESTAMP_QUERY_METHOD_GREATER: String + TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS: String + TIMESTAMP_QUERY_METHOD_LESS: String + TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/session_service_totp_factor.rbs b/sig/zitadel/client/models/session_service_totp_factor.rbs new file mode 100644 index 00000000..83484e23 --- /dev/null +++ b/sig/zitadel/client/models/session_service_totp_factor.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceTOTPFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + end +end diff --git a/sig/zitadel/client/models/session_service_user_agent.rbs b/sig/zitadel/client/models/session_service_user_agent.rbs new file mode 100644 index 00000000..62705989 --- /dev/null +++ b/sig/zitadel/client/models/session_service_user_agent.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SessionServiceUserAgent < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader fingerprint_id: String? + attr_reader ip: String? + attr_reader description: String? + attr_reader header: Hash[String, SessionServiceHeaderValues]? + end +end diff --git a/sig/zitadel/client/models/session_service_user_agent_query.rbs b/sig/zitadel/client/models/session_service_user_agent_query.rbs new file mode 100644 index 00000000..d2463602 --- /dev/null +++ b/sig/zitadel/client/models/session_service_user_agent_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceUserAgentQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader fingerprint_id: String? + end +end diff --git a/sig/zitadel/client/models/session_service_user_factor.rbs b/sig/zitadel/client/models/session_service_user_factor.rbs new file mode 100644 index 00000000..bf082b3d --- /dev/null +++ b/sig/zitadel/client/models/session_service_user_factor.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class SessionServiceUserFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + attr_reader id: String? + attr_reader login_name: String? + attr_reader display_name: String? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/session_service_user_id_query.rbs b/sig/zitadel/client/models/session_service_user_id_query.rbs new file mode 100644 index 00000000..0ff75417 --- /dev/null +++ b/sig/zitadel/client/models/session_service_user_id_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SessionServiceUserIDQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/session_service_user_verification_requirement.rbs b/sig/zitadel/client/models/session_service_user_verification_requirement.rbs new file mode 100644 index 00000000..a7b811b9 --- /dev/null +++ b/sig/zitadel/client/models/session_service_user_verification_requirement.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SessionServiceUserVerificationRequirement + USER_VERIFICATION_REQUIREMENT_UNSPECIFIED: String + USER_VERIFICATION_REQUIREMENT_REQUIRED: String + USER_VERIFICATION_REQUIREMENT_PREFERRED: String + USER_VERIFICATION_REQUIREMENT_DISCOURAGED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/session_service_web_auth_n.rbs b/sig/zitadel/client/models/session_service_web_auth_n.rbs new file mode 100644 index 00000000..546b99e9 --- /dev/null +++ b/sig/zitadel/client/models/session_service_web_auth_n.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceWebAuthN < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader domain: String? + attr_reader user_verification_requirement: SessionServiceUserVerificationRequirement? + end +end diff --git a/sig/zitadel/client/models/session_service_web_auth_n_factor.rbs b/sig/zitadel/client/models/session_service_web_auth_n_factor.rbs new file mode 100644 index 00000000..dc1b9a58 --- /dev/null +++ b/sig/zitadel/client/models/session_service_web_auth_n_factor.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SessionServiceWebAuthNFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader verified_at: Time? + attr_reader user_verified: bool? + end +end diff --git a/sig/zitadel/client/models/settings_service_any.rbs b/sig/zitadel/client/models/settings_service_any.rbs new file mode 100644 index 00000000..bcebd005 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SettingsServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/settings_service_auto_linking_option.rbs b/sig/zitadel/client/models/settings_service_auto_linking_option.rbs new file mode 100644 index 00000000..6d3ac633 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_auto_linking_option.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceAutoLinkingOption + AUTO_LINKING_OPTION_UNSPECIFIED: String + AUTO_LINKING_OPTION_USERNAME: String + AUTO_LINKING_OPTION_EMAIL: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/settings_service_branding_settings.rbs b/sig/zitadel/client/models/settings_service_branding_settings.rbs new file mode 100644 index 00000000..b6379164 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_branding_settings.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class SettingsServiceBrandingSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader light_theme: SettingsServiceTheme? + attr_reader dark_theme: SettingsServiceTheme? + attr_reader font_url: String? + attr_reader hide_login_name_suffix: bool? + attr_reader disable_watermark: bool? + attr_reader resource_owner_type: SettingsServiceResourceOwnerType? + attr_reader theme_mode: SettingsServiceThemeMode? + end +end diff --git a/sig/zitadel/client/models/settings_service_connect_error.rbs b/sig/zitadel/client/models/settings_service_connect_error.rbs new file mode 100644 index 00000000..b0d05f65 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SettingsServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[SettingsServiceAny]? + end +end diff --git a/sig/zitadel/client/models/settings_service_details.rbs b/sig/zitadel/client/models/settings_service_details.rbs new file mode 100644 index 00000000..271079e9 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SettingsServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/settings_service_domain_settings.rbs b/sig/zitadel/client/models/settings_service_domain_settings.rbs new file mode 100644 index 00000000..378e6b2c --- /dev/null +++ b/sig/zitadel/client/models/settings_service_domain_settings.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SettingsServiceDomainSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_name_includes_domain: bool? + attr_reader require_org_domain_verification: bool? + attr_reader smtp_sender_address_matches_instance_domain: bool? + attr_reader resource_owner_type: SettingsServiceResourceOwnerType? + end +end diff --git a/sig/zitadel/client/models/settings_service_embedded_iframe_settings.rbs b/sig/zitadel/client/models/settings_service_embedded_iframe_settings.rbs new file mode 100644 index 00000000..37ace416 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_embedded_iframe_settings.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceEmbeddedIframeSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader enabled: bool? + attr_reader allowed_origins: Array[String]? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_active_identity_providers_request.rbs b/sig/zitadel/client/models/settings_service_get_active_identity_providers_request.rbs new file mode 100644 index 00000000..cb7fce2e --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_active_identity_providers_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class SettingsServiceGetActiveIdentityProvidersRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: SettingsServiceRequestContext? + attr_reader creation_allowed: bool? + attr_reader linking_allowed: bool? + attr_reader auto_creation: bool? + attr_reader auto_linking: bool? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_active_identity_providers_response.rbs b/sig/zitadel/client/models/settings_service_get_active_identity_providers_response.rbs new file mode 100644 index 00000000..8e6f9fa6 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_active_identity_providers_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetActiveIdentityProvidersResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceListDetails? + attr_reader identity_providers: Array[SettingsServiceIdentityProvider]? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_branding_settings_request.rbs b/sig/zitadel/client/models/settings_service_get_branding_settings_request.rbs new file mode 100644 index 00000000..ff47aebd --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_branding_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceGetBrandingSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: SettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_branding_settings_response.rbs b/sig/zitadel/client/models/settings_service_get_branding_settings_response.rbs new file mode 100644 index 00000000..1a0e8e4a --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_branding_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetBrandingSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceDetails? + attr_reader settings: SettingsServiceBrandingSettings? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_domain_settings_request.rbs b/sig/zitadel/client/models/settings_service_get_domain_settings_request.rbs new file mode 100644 index 00000000..7721653a --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_domain_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceGetDomainSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: SettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_domain_settings_response.rbs b/sig/zitadel/client/models/settings_service_get_domain_settings_response.rbs new file mode 100644 index 00000000..2204cd73 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_domain_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetDomainSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceDetails? + attr_reader settings: SettingsServiceDomainSettings? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_general_settings_response.rbs b/sig/zitadel/client/models/settings_service_get_general_settings_response.rbs new file mode 100644 index 00000000..0ae09493 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_general_settings_response.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class SettingsServiceGetGeneralSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader default_org_id: String? + attr_reader default_language: String? + attr_reader supported_languages: Array[String]? + attr_reader default_organization_id: String? + attr_reader allowed_languages: Array[String]? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_hosted_login_translation_request.rbs b/sig/zitadel/client/models/settings_service_get_hosted_login_translation_request.rbs new file mode 100644 index 00000000..2ecc3cd5 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_hosted_login_translation_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class SettingsServiceGetHostedLoginTranslationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader locale: String? + attr_reader ignore_inheritance: bool? + attr_reader instance: bool? + attr_reader organization_id: String? + attr_reader system: bool? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_hosted_login_translation_response.rbs b/sig/zitadel/client/models/settings_service_get_hosted_login_translation_response.rbs new file mode 100644 index 00000000..9b81f1f0 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_hosted_login_translation_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetHostedLoginTranslationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader etag: String? + attr_reader translations: Hash[String, untyped]? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rbs b/sig/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rbs new file mode 100644 index 00000000..cc57d0ee --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_legal_and_support_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceGetLegalAndSupportSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: SettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_legal_and_support_settings_response.rbs b/sig/zitadel/client/models/settings_service_get_legal_and_support_settings_response.rbs new file mode 100644 index 00000000..190522e7 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_legal_and_support_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetLegalAndSupportSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceDetails? + attr_reader settings: SettingsServiceLegalAndSupportSettings? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_lockout_settings_request.rbs b/sig/zitadel/client/models/settings_service_get_lockout_settings_request.rbs new file mode 100644 index 00000000..1cc7c0e0 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_lockout_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceGetLockoutSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: SettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_lockout_settings_response.rbs b/sig/zitadel/client/models/settings_service_get_lockout_settings_response.rbs new file mode 100644 index 00000000..92701f7c --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_lockout_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetLockoutSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceDetails? + attr_reader settings: SettingsServiceLockoutSettings? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_login_settings_request.rbs b/sig/zitadel/client/models/settings_service_get_login_settings_request.rbs new file mode 100644 index 00000000..2a9d8ba9 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_login_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceGetLoginSettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: SettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_login_settings_response.rbs b/sig/zitadel/client/models/settings_service_get_login_settings_response.rbs new file mode 100644 index 00000000..217e31e0 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_login_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetLoginSettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceDetails? + attr_reader settings: SettingsServiceLoginSettings? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_password_complexity_settings_request.rbs b/sig/zitadel/client/models/settings_service_get_password_complexity_settings_request.rbs new file mode 100644 index 00000000..86217064 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_password_complexity_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceGetPasswordComplexitySettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: SettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_password_complexity_settings_response.rbs b/sig/zitadel/client/models/settings_service_get_password_complexity_settings_response.rbs new file mode 100644 index 00000000..8b308a2e --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_password_complexity_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetPasswordComplexitySettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceDetails? + attr_reader settings: SettingsServicePasswordComplexitySettings? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_password_expiry_settings_request.rbs b/sig/zitadel/client/models/settings_service_get_password_expiry_settings_request.rbs new file mode 100644 index 00000000..0ea47efb --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_password_expiry_settings_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceGetPasswordExpirySettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ctx: SettingsServiceRequestContext? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_password_expiry_settings_response.rbs b/sig/zitadel/client/models/settings_service_get_password_expiry_settings_response.rbs new file mode 100644 index 00000000..c4bbf8eb --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_password_expiry_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetPasswordExpirySettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceDetails? + attr_reader settings: SettingsServicePasswordExpirySettings? + end +end diff --git a/sig/zitadel/client/models/settings_service_get_security_settings_response.rbs b/sig/zitadel/client/models/settings_service_get_security_settings_response.rbs new file mode 100644 index 00000000..e938263a --- /dev/null +++ b/sig/zitadel/client/models/settings_service_get_security_settings_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceGetSecuritySettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceDetails? + attr_reader settings: SettingsServiceSecuritySettings? + end +end diff --git a/sig/zitadel/client/models/settings_service_identity_provider.rbs b/sig/zitadel/client/models/settings_service_identity_provider.rbs new file mode 100644 index 00000000..5e2e8348 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_identity_provider.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SettingsServiceIdentityProvider < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + attr_reader type: SettingsServiceIdentityProviderType? + attr_reader options: SettingsServiceOptions? + end +end diff --git a/sig/zitadel/client/models/settings_service_identity_provider_type.rbs b/sig/zitadel/client/models/settings_service_identity_provider_type.rbs new file mode 100644 index 00000000..951d1119 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_identity_provider_type.rbs @@ -0,0 +1,20 @@ +module Zitadel::Client::Models + class SettingsServiceIdentityProviderType + IDENTITY_PROVIDER_TYPE_UNSPECIFIED: String + IDENTITY_PROVIDER_TYPE_OIDC: String + IDENTITY_PROVIDER_TYPE_JWT: String + IDENTITY_PROVIDER_TYPE_LDAP: String + IDENTITY_PROVIDER_TYPE_OAUTH: String + IDENTITY_PROVIDER_TYPE_AZURE_AD: String + IDENTITY_PROVIDER_TYPE_GITHUB: String + IDENTITY_PROVIDER_TYPE_GITHUB_ES: String + IDENTITY_PROVIDER_TYPE_GITLAB: String + IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED: String + IDENTITY_PROVIDER_TYPE_GOOGLE: String + IDENTITY_PROVIDER_TYPE_SAML: String + IDENTITY_PROVIDER_TYPE_APPLE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/settings_service_legal_and_support_settings.rbs b/sig/zitadel/client/models/settings_service_legal_and_support_settings.rbs new file mode 100644 index 00000000..ff9bf5b6 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_legal_and_support_settings.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class SettingsServiceLegalAndSupportSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader tos_link: String? + attr_reader privacy_policy_link: String? + attr_reader help_link: String? + attr_reader support_email: String? + attr_reader resource_owner_type: SettingsServiceResourceOwnerType? + attr_reader docs_link: String? + attr_reader custom_link: String? + attr_reader custom_link_text: String? + end +end diff --git a/sig/zitadel/client/models/settings_service_list_details.rbs b/sig/zitadel/client/models/settings_service_list_details.rbs new file mode 100644 index 00000000..667fd9c4 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_list_details.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SettingsServiceListDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader processed_sequence: untyped? + attr_reader timestamp: Time? + end +end diff --git a/sig/zitadel/client/models/settings_service_lockout_settings.rbs b/sig/zitadel/client/models/settings_service_lockout_settings.rbs new file mode 100644 index 00000000..0f23ff76 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_lockout_settings.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SettingsServiceLockoutSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader max_password_attempts: untyped? + attr_reader resource_owner_type: SettingsServiceResourceOwnerType? + attr_reader max_otp_attempts: untyped? + end +end diff --git a/sig/zitadel/client/models/settings_service_login_settings.rbs b/sig/zitadel/client/models/settings_service_login_settings.rbs new file mode 100644 index 00000000..6ae66152 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_login_settings.rbs @@ -0,0 +1,29 @@ +module Zitadel::Client::Models + class SettingsServiceLoginSettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader allow_username_password: bool? + attr_reader allow_local_authentication: bool? + attr_reader allow_register: bool? + attr_reader allow_external_idp: bool? + attr_reader force_mfa: bool? + attr_reader passkeys_type: SettingsServicePasskeysType? + attr_reader hide_password_reset: bool? + attr_reader ignore_unknown_usernames: bool? + attr_reader default_redirect_uri: String? + attr_reader password_check_lifetime: ISO8601::Duration? + attr_reader external_login_check_lifetime: ISO8601::Duration? + attr_reader mfa_init_skip_lifetime: ISO8601::Duration? + attr_reader second_factor_check_lifetime: ISO8601::Duration? + attr_reader multi_factor_check_lifetime: ISO8601::Duration? + attr_reader second_factors: Array[SettingsServiceSecondFactorType]? + attr_reader multi_factors: Array[SettingsServiceMultiFactorType]? + attr_reader allow_domain_discovery: bool? + attr_reader disable_login_with_email: bool? + attr_reader disable_login_with_phone: bool? + attr_reader resource_owner_type: SettingsServiceResourceOwnerType? + attr_reader force_mfa_local_only: bool? + end +end diff --git a/sig/zitadel/client/models/settings_service_multi_factor_type.rbs b/sig/zitadel/client/models/settings_service_multi_factor_type.rbs new file mode 100644 index 00000000..7b81424e --- /dev/null +++ b/sig/zitadel/client/models/settings_service_multi_factor_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceMultiFactorType + MULTI_FACTOR_TYPE_UNSPECIFIED: String + MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/settings_service_options.rbs b/sig/zitadel/client/models/settings_service_options.rbs new file mode 100644 index 00000000..71de613b --- /dev/null +++ b/sig/zitadel/client/models/settings_service_options.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class SettingsServiceOptions < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader is_linking_allowed: bool? + attr_reader is_creation_allowed: bool? + attr_reader is_auto_creation: bool? + attr_reader is_auto_update: bool? + attr_reader auto_linking: SettingsServiceAutoLinkingOption? + end +end diff --git a/sig/zitadel/client/models/settings_service_passkeys_type.rbs b/sig/zitadel/client/models/settings_service_passkeys_type.rbs new file mode 100644 index 00000000..e9a02a7d --- /dev/null +++ b/sig/zitadel/client/models/settings_service_passkeys_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServicePasskeysType + PASSKEYS_TYPE_NOT_ALLOWED: String + PASSKEYS_TYPE_ALLOWED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/settings_service_password_complexity_settings.rbs b/sig/zitadel/client/models/settings_service_password_complexity_settings.rbs new file mode 100644 index 00000000..c6d21830 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_password_complexity_settings.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class SettingsServicePasswordComplexitySettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader min_length: untyped? + attr_reader requires_uppercase: bool? + attr_reader requires_lowercase: bool? + attr_reader requires_number: bool? + attr_reader requires_symbol: bool? + attr_reader resource_owner_type: SettingsServiceResourceOwnerType? + end +end diff --git a/sig/zitadel/client/models/settings_service_password_expiry_settings.rbs b/sig/zitadel/client/models/settings_service_password_expiry_settings.rbs new file mode 100644 index 00000000..eda4e4d0 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_password_expiry_settings.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SettingsServicePasswordExpirySettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader max_age_days: untyped? + attr_reader expire_warn_days: untyped? + attr_reader resource_owner_type: SettingsServiceResourceOwnerType? + end +end diff --git a/sig/zitadel/client/models/settings_service_request_context.rbs b/sig/zitadel/client/models/settings_service_request_context.rbs new file mode 100644 index 00000000..a4833c81 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_request_context.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceRequestContext < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader instance: bool? + attr_reader org_id: String? + end +end diff --git a/sig/zitadel/client/models/settings_service_resource_owner_type.rbs b/sig/zitadel/client/models/settings_service_resource_owner_type.rbs new file mode 100644 index 00000000..c53cf0c2 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_resource_owner_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceResourceOwnerType + RESOURCE_OWNER_TYPE_UNSPECIFIED: String + RESOURCE_OWNER_TYPE_INSTANCE: String + RESOURCE_OWNER_TYPE_ORG: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/settings_service_second_factor_type.rbs b/sig/zitadel/client/models/settings_service_second_factor_type.rbs new file mode 100644 index 00000000..be4c4b02 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_second_factor_type.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class SettingsServiceSecondFactorType + SECOND_FACTOR_TYPE_UNSPECIFIED: String + SECOND_FACTOR_TYPE_OTP: String + SECOND_FACTOR_TYPE_TOTP: String + SECOND_FACTOR_TYPE_U2_F: String + SECOND_FACTOR_TYPE_OTP_EMAIL: String + SECOND_FACTOR_TYPE_OTP_SMS: String + SECOND_FACTOR_TYPE_RECOVERY_CODES: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/settings_service_security_settings.rbs b/sig/zitadel/client/models/settings_service_security_settings.rbs new file mode 100644 index 00000000..2ca7bbb9 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_security_settings.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceSecuritySettings < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader embedded_iframe: SettingsServiceEmbeddedIframeSettings? + attr_reader enable_impersonation: bool? + end +end diff --git a/sig/zitadel/client/models/settings_service_set_hosted_login_translation_request.rbs b/sig/zitadel/client/models/settings_service_set_hosted_login_translation_request.rbs new file mode 100644 index 00000000..b07f2c1f --- /dev/null +++ b/sig/zitadel/client/models/settings_service_set_hosted_login_translation_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class SettingsServiceSetHostedLoginTranslationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader locale: String? + attr_reader translations: Hash[String, untyped]? + attr_reader instance: bool? + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/settings_service_set_hosted_login_translation_response.rbs b/sig/zitadel/client/models/settings_service_set_hosted_login_translation_response.rbs new file mode 100644 index 00000000..7905f18d --- /dev/null +++ b/sig/zitadel/client/models/settings_service_set_hosted_login_translation_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceSetHostedLoginTranslationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader etag: String? + end +end diff --git a/sig/zitadel/client/models/settings_service_set_security_settings_request.rbs b/sig/zitadel/client/models/settings_service_set_security_settings_request.rbs new file mode 100644 index 00000000..8319f5cb --- /dev/null +++ b/sig/zitadel/client/models/settings_service_set_security_settings_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class SettingsServiceSetSecuritySettingsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader embedded_iframe: SettingsServiceEmbeddedIframeSettings? + attr_reader enable_impersonation: bool? + end +end diff --git a/sig/zitadel/client/models/settings_service_set_security_settings_response.rbs b/sig/zitadel/client/models/settings_service_set_security_settings_response.rbs new file mode 100644 index 00000000..69b9c156 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_set_security_settings_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class SettingsServiceSetSecuritySettingsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: SettingsServiceDetails? + end +end diff --git a/sig/zitadel/client/models/settings_service_theme.rbs b/sig/zitadel/client/models/settings_service_theme.rbs new file mode 100644 index 00000000..34aa61f7 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_theme.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class SettingsServiceTheme < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader primary_color: String? + attr_reader background_color: String? + attr_reader warn_color: String? + attr_reader font_color: String? + attr_reader logo_url: String? + attr_reader icon_url: String? + end +end diff --git a/sig/zitadel/client/models/settings_service_theme_mode.rbs b/sig/zitadel/client/models/settings_service_theme_mode.rbs new file mode 100644 index 00000000..1a0d63e1 --- /dev/null +++ b/sig/zitadel/client/models/settings_service_theme_mode.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class SettingsServiceThemeMode + THEME_MODE_UNSPECIFIED: String + THEME_MODE_AUTO: String + THEME_MODE_LIGHT: String + THEME_MODE_DARK: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_access_token_type.rbs b/sig/zitadel/client/models/user_service_access_token_type.rbs new file mode 100644 index 00000000..343d332d --- /dev/null +++ b/sig/zitadel/client/models/user_service_access_token_type.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceAccessTokenType + ACCESS_TOKEN_TYPE_BEARER: String + ACCESS_TOKEN_TYPE_JWT: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_add_human_user_request.rbs b/sig/zitadel/client/models/user_service_add_human_user_request.rbs new file mode 100644 index 00000000..d31bf745 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_human_user_request.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class UserServiceAddHumanUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader username: String? + attr_reader organization: UserServiceOrganization? + attr_reader profile: UserServiceSetHumanProfile? + attr_reader email: UserServiceSetHumanEmail? + attr_reader phone: UserServiceSetHumanPhone? + attr_reader metadata: Array[UserServiceSetMetadataEntry]? + attr_reader idp_links: Array[UserServiceIDPLink]? + attr_reader totp_secret: String? + attr_reader hashed_password: UserServiceHashedPassword? + attr_reader password: UserServicePassword? + end +end diff --git a/sig/zitadel/client/models/user_service_add_human_user_response.rbs b/sig/zitadel/client/models/user_service_add_human_user_response.rbs new file mode 100644 index 00000000..789e4b85 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_human_user_response.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceAddHumanUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader details: UserServiceDetails? + attr_reader email_code: String? + attr_reader phone_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_add_idp_link_request.rbs b/sig/zitadel/client/models/user_service_add_idp_link_request.rbs new file mode 100644 index 00000000..a9933413 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_idp_link_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceAddIDPLinkRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader idp_link: UserServiceIDPLink? + end +end diff --git a/sig/zitadel/client/models/user_service_add_idp_link_response.rbs b/sig/zitadel/client/models/user_service_add_idp_link_response.rbs new file mode 100644 index 00000000..60dd9f5f --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_idp_link_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceAddIDPLinkResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_add_key_request.rbs b/sig/zitadel/client/models/user_service_add_key_request.rbs new file mode 100644 index 00000000..fd45e6e8 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_key_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceAddKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader expiration_date: Time? + attr_reader public_key: String? + end +end diff --git a/sig/zitadel/client/models/user_service_add_key_response.rbs b/sig/zitadel/client/models/user_service_add_key_response.rbs new file mode 100644 index 00000000..e4b7eb27 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_key_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceAddKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader key_id: String? + attr_reader key_content: String? + end +end diff --git a/sig/zitadel/client/models/user_service_add_otp_email_request.rbs b/sig/zitadel/client/models/user_service_add_otp_email_request.rbs new file mode 100644 index 00000000..6b42ccb4 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_otp_email_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceAddOTPEmailRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_add_otp_email_response.rbs b/sig/zitadel/client/models/user_service_add_otp_email_response.rbs new file mode 100644 index 00000000..02542b37 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_otp_email_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceAddOTPEmailResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_add_otpsms_request.rbs b/sig/zitadel/client/models/user_service_add_otpsms_request.rbs new file mode 100644 index 00000000..de18abf1 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_otpsms_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceAddOTPSMSRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_add_otpsms_response.rbs b/sig/zitadel/client/models/user_service_add_otpsms_response.rbs new file mode 100644 index 00000000..357572f0 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_otpsms_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceAddOTPSMSResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_add_personal_access_token_request.rbs b/sig/zitadel/client/models/user_service_add_personal_access_token_request.rbs new file mode 100644 index 00000000..1a5fae27 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_personal_access_token_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceAddPersonalAccessTokenRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_add_personal_access_token_response.rbs b/sig/zitadel/client/models/user_service_add_personal_access_token_response.rbs new file mode 100644 index 00000000..33a56bb4 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_personal_access_token_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceAddPersonalAccessTokenResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader token_id: String? + attr_reader token: String? + end +end diff --git a/sig/zitadel/client/models/user_service_add_secret_request.rbs b/sig/zitadel/client/models/user_service_add_secret_request.rbs new file mode 100644 index 00000000..360b6ff4 --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_secret_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceAddSecretRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_add_secret_response.rbs b/sig/zitadel/client/models/user_service_add_secret_response.rbs new file mode 100644 index 00000000..6b1f32cb --- /dev/null +++ b/sig/zitadel/client/models/user_service_add_secret_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceAddSecretResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader client_secret: String? + end +end diff --git a/sig/zitadel/client/models/user_service_and_query.rbs b/sig/zitadel/client/models/user_service_and_query.rbs new file mode 100644 index 00000000..dbc7d4b0 --- /dev/null +++ b/sig/zitadel/client/models/user_service_and_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceAndQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader queries: Array[UserServiceSearchQuery]? + end +end diff --git a/sig/zitadel/client/models/user_service_any.rbs b/sig/zitadel/client/models/user_service_any.rbs new file mode 100644 index 00000000..787c1d9a --- /dev/null +++ b/sig/zitadel/client/models/user_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/user_service_auth_factor.rbs b/sig/zitadel/client/models/user_service_auth_factor.rbs new file mode 100644 index 00000000..7f02860d --- /dev/null +++ b/sig/zitadel/client/models/user_service_auth_factor.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServiceAuthFactor < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader state: UserServiceAuthFactorState? + attr_reader otp: untyped? + attr_reader otp_email: untyped? + attr_reader otp_sms: untyped? + attr_reader u2f: UserServiceAuthFactorU2F? + end +end diff --git a/sig/zitadel/client/models/user_service_auth_factor_state.rbs b/sig/zitadel/client/models/user_service_auth_factor_state.rbs new file mode 100644 index 00000000..33fde328 --- /dev/null +++ b/sig/zitadel/client/models/user_service_auth_factor_state.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceAuthFactorState + AUTH_FACTOR_STATE_UNSPECIFIED: String + AUTH_FACTOR_STATE_NOT_READY: String + AUTH_FACTOR_STATE_READY: String + AUTH_FACTOR_STATE_REMOVED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_auth_factor_u2_f.rbs b/sig/zitadel/client/models/user_service_auth_factor_u2_f.rbs new file mode 100644 index 00000000..305572a1 --- /dev/null +++ b/sig/zitadel/client/models/user_service_auth_factor_u2_f.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceAuthFactorU2F < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader name: String? + end +end diff --git a/sig/zitadel/client/models/user_service_auth_factors.rbs b/sig/zitadel/client/models/user_service_auth_factors.rbs new file mode 100644 index 00000000..31eb2151 --- /dev/null +++ b/sig/zitadel/client/models/user_service_auth_factors.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceAuthFactors + OTP: String + OTP_SMS: String + OTP_EMAIL: String + U2_F: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_authentication_method_type.rbs b/sig/zitadel/client/models/user_service_authentication_method_type.rbs new file mode 100644 index 00000000..803903fb --- /dev/null +++ b/sig/zitadel/client/models/user_service_authentication_method_type.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class UserServiceAuthenticationMethodType + AUTHENTICATION_METHOD_TYPE_UNSPECIFIED: String + AUTHENTICATION_METHOD_TYPE_PASSWORD: String + AUTHENTICATION_METHOD_TYPE_PASSKEY: String + AUTHENTICATION_METHOD_TYPE_IDP: String + AUTHENTICATION_METHOD_TYPE_TOTP: String + AUTHENTICATION_METHOD_TYPE_U2_F: String + AUTHENTICATION_METHOD_TYPE_OTP_SMS: String + AUTHENTICATION_METHOD_TYPE_OTP_EMAIL: String + AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_byte_filter_method.rbs b/sig/zitadel/client/models/user_service_byte_filter_method.rbs new file mode 100644 index 00000000..aef8d8e8 --- /dev/null +++ b/sig/zitadel/client/models/user_service_byte_filter_method.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceByteFilterMethod + BYTE_FILTER_METHOD_EQUALS: String + BYTE_FILTER_METHOD_NOT_EQUALS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_connect_error.rbs b/sig/zitadel/client/models/user_service_connect_error.rbs new file mode 100644 index 00000000..94737261 --- /dev/null +++ b/sig/zitadel/client/models/user_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[UserServiceAny]? + end +end diff --git a/sig/zitadel/client/models/user_service_create_invite_code_request.rbs b/sig/zitadel/client/models/user_service_create_invite_code_request.rbs new file mode 100644 index 00000000..bff6a25e --- /dev/null +++ b/sig/zitadel/client/models/user_service_create_invite_code_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceCreateInviteCodeRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_code: UserServiceSendInviteCode? + end +end diff --git a/sig/zitadel/client/models/user_service_create_invite_code_response.rbs b/sig/zitadel/client/models/user_service_create_invite_code_response.rbs new file mode 100644 index 00000000..53bd20f4 --- /dev/null +++ b/sig/zitadel/client/models/user_service_create_invite_code_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceCreateInviteCodeResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader invite_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_create_passkey_registration_link_request.rbs b/sig/zitadel/client/models/user_service_create_passkey_registration_link_request.rbs new file mode 100644 index 00000000..632638a6 --- /dev/null +++ b/sig/zitadel/client/models/user_service_create_passkey_registration_link_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceCreatePasskeyRegistrationLinkRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_link: UserServiceSendPasskeyRegistrationLink? + end +end diff --git a/sig/zitadel/client/models/user_service_create_passkey_registration_link_response.rbs b/sig/zitadel/client/models/user_service_create_passkey_registration_link_response.rbs new file mode 100644 index 00000000..143a4eb0 --- /dev/null +++ b/sig/zitadel/client/models/user_service_create_passkey_registration_link_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceCreatePasskeyRegistrationLinkResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader code: UserServicePasskeyRegistrationCode? + end +end diff --git a/sig/zitadel/client/models/user_service_create_user_request.rbs b/sig/zitadel/client/models/user_service_create_user_request.rbs new file mode 100644 index 00000000..1f27a563 --- /dev/null +++ b/sig/zitadel/client/models/user_service_create_user_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServiceCreateUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + attr_reader user_id: String? + attr_reader username: String? + attr_reader human: UserServiceHuman? + attr_reader machine: UserServiceMachine? + end +end diff --git a/sig/zitadel/client/models/user_service_create_user_response.rbs b/sig/zitadel/client/models/user_service_create_user_response.rbs new file mode 100644 index 00000000..8a37b23d --- /dev/null +++ b/sig/zitadel/client/models/user_service_create_user_response.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceCreateUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader email_code: String? + attr_reader phone_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_deactivate_user_request.rbs b/sig/zitadel/client/models/user_service_deactivate_user_request.rbs new file mode 100644 index 00000000..575c40f8 --- /dev/null +++ b/sig/zitadel/client/models/user_service_deactivate_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceDeactivateUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_deactivate_user_response.rbs b/sig/zitadel/client/models/user_service_deactivate_user_response.rbs new file mode 100644 index 00000000..47d0b1a7 --- /dev/null +++ b/sig/zitadel/client/models/user_service_deactivate_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceDeactivateUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_delete_user_metadata_request.rbs b/sig/zitadel/client/models/user_service_delete_user_metadata_request.rbs new file mode 100644 index 00000000..f181bcaa --- /dev/null +++ b/sig/zitadel/client/models/user_service_delete_user_metadata_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceDeleteUserMetadataRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader keys: Array[String]? + end +end diff --git a/sig/zitadel/client/models/user_service_delete_user_metadata_response.rbs b/sig/zitadel/client/models/user_service_delete_user_metadata_response.rbs new file mode 100644 index 00000000..9de78a92 --- /dev/null +++ b/sig/zitadel/client/models/user_service_delete_user_metadata_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceDeleteUserMetadataResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_delete_user_request.rbs b/sig/zitadel/client/models/user_service_delete_user_request.rbs new file mode 100644 index 00000000..18970729 --- /dev/null +++ b/sig/zitadel/client/models/user_service_delete_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceDeleteUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_delete_user_response.rbs b/sig/zitadel/client/models/user_service_delete_user_response.rbs new file mode 100644 index 00000000..bf2f9707 --- /dev/null +++ b/sig/zitadel/client/models/user_service_delete_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceDeleteUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_details.rbs b/sig/zitadel/client/models/user_service_details.rbs new file mode 100644 index 00000000..30574eba --- /dev/null +++ b/sig/zitadel/client/models/user_service_details.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader sequence: untyped? + attr_reader change_date: Time? + attr_reader resource_owner: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_display_name_query.rbs b/sig/zitadel/client/models/user_service_display_name_query.rbs new file mode 100644 index 00000000..a505e0fd --- /dev/null +++ b/sig/zitadel/client/models/user_service_display_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceDisplayNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader display_name: String? + attr_reader method: UserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_domain_query.rbs b/sig/zitadel/client/models/user_service_domain_query.rbs new file mode 100644 index 00000000..e9888708 --- /dev/null +++ b/sig/zitadel/client/models/user_service_domain_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceDomainQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader include_without_domain: bool? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/user_service_email_query.rbs b/sig/zitadel/client/models/user_service_email_query.rbs new file mode 100644 index 00000000..57df5179 --- /dev/null +++ b/sig/zitadel/client/models/user_service_email_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceEmailQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader email_address: String? + attr_reader method: UserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_first_name_query.rbs b/sig/zitadel/client/models/user_service_first_name_query.rbs new file mode 100644 index 00000000..fdac1a0d --- /dev/null +++ b/sig/zitadel/client/models/user_service_first_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceFirstNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader first_name: String? + attr_reader method: UserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_form_data.rbs b/sig/zitadel/client/models/user_service_form_data.rbs new file mode 100644 index 00000000..de143cd5 --- /dev/null +++ b/sig/zitadel/client/models/user_service_form_data.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceFormData < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url: String? + attr_reader fields: Hash[String, String]? + end +end diff --git a/sig/zitadel/client/models/user_service_gender.rbs b/sig/zitadel/client/models/user_service_gender.rbs new file mode 100644 index 00000000..2da36b51 --- /dev/null +++ b/sig/zitadel/client/models/user_service_gender.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceGender + GENDER_UNSPECIFIED: String + GENDER_FEMALE: String + GENDER_MALE: String + GENDER_DIVERSE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_generate_recovery_codes_request.rbs b/sig/zitadel/client/models/user_service_generate_recovery_codes_request.rbs new file mode 100644 index 00000000..f4f8f36f --- /dev/null +++ b/sig/zitadel/client/models/user_service_generate_recovery_codes_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceGenerateRecoveryCodesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader count: Integer? + end +end diff --git a/sig/zitadel/client/models/user_service_generate_recovery_codes_response.rbs b/sig/zitadel/client/models/user_service_generate_recovery_codes_response.rbs new file mode 100644 index 00000000..dc1bb43c --- /dev/null +++ b/sig/zitadel/client/models/user_service_generate_recovery_codes_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceGenerateRecoveryCodesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader recovery_codes: Array[String]? + end +end diff --git a/sig/zitadel/client/models/user_service_get_user_by_id_request.rbs b/sig/zitadel/client/models/user_service_get_user_by_id_request.rbs new file mode 100644 index 00000000..dfd54163 --- /dev/null +++ b/sig/zitadel/client/models/user_service_get_user_by_id_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceGetUserByIDRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_get_user_by_id_response.rbs b/sig/zitadel/client/models/user_service_get_user_by_id_response.rbs new file mode 100644 index 00000000..29b69415 --- /dev/null +++ b/sig/zitadel/client/models/user_service_get_user_by_id_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceGetUserByIDResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader user: UserServiceUser? + end +end diff --git a/sig/zitadel/client/models/user_service_hashed_password.rbs b/sig/zitadel/client/models/user_service_hashed_password.rbs new file mode 100644 index 00000000..383c5e3c --- /dev/null +++ b/sig/zitadel/client/models/user_service_hashed_password.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceHashedPassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader hash: String? + attr_reader change_required: bool? + end +end diff --git a/sig/zitadel/client/models/user_service_human.rbs b/sig/zitadel/client/models/user_service_human.rbs new file mode 100644 index 00000000..3a5e5890 --- /dev/null +++ b/sig/zitadel/client/models/user_service_human.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceHuman < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader profile: UserServiceProfile? + attr_reader email: UserServiceSetHumanEmail? + attr_reader phone: UserServiceSetHumanPhone? + attr_reader password: UserServiceSetPassword? + end +end diff --git a/sig/zitadel/client/models/user_service_human_email.rbs b/sig/zitadel/client/models/user_service_human_email.rbs new file mode 100644 index 00000000..55155a7f --- /dev/null +++ b/sig/zitadel/client/models/user_service_human_email.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceHumanEmail < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader email: String? + attr_reader is_verified: bool? + end +end diff --git a/sig/zitadel/client/models/user_service_human_mfa_init_skipped_request.rbs b/sig/zitadel/client/models/user_service_human_mfa_init_skipped_request.rbs new file mode 100644 index 00000000..4d111d2e --- /dev/null +++ b/sig/zitadel/client/models/user_service_human_mfa_init_skipped_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceHumanMFAInitSkippedRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_human_mfa_init_skipped_response.rbs b/sig/zitadel/client/models/user_service_human_mfa_init_skipped_response.rbs new file mode 100644 index 00000000..db7a0708 --- /dev/null +++ b/sig/zitadel/client/models/user_service_human_mfa_init_skipped_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceHumanMFAInitSkippedResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_human_phone.rbs b/sig/zitadel/client/models/user_service_human_phone.rbs new file mode 100644 index 00000000..06ec5e24 --- /dev/null +++ b/sig/zitadel/client/models/user_service_human_phone.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceHumanPhone < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader phone: String? + attr_reader is_verified: bool? + end +end diff --git a/sig/zitadel/client/models/user_service_human_profile.rbs b/sig/zitadel/client/models/user_service_human_profile.rbs new file mode 100644 index 00000000..9613bb81 --- /dev/null +++ b/sig/zitadel/client/models/user_service_human_profile.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class UserServiceHumanProfile < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader given_name: String? + attr_reader family_name: String? + attr_reader nick_name: String? + attr_reader display_name: String? + attr_reader preferred_language: String? + attr_reader gender: UserServiceGender? + attr_reader avatar_url: String? + end +end diff --git a/sig/zitadel/client/models/user_service_human_user.rbs b/sig/zitadel/client/models/user_service_human_user.rbs new file mode 100644 index 00000000..b8fa7fcc --- /dev/null +++ b/sig/zitadel/client/models/user_service_human_user.rbs @@ -0,0 +1,19 @@ +module Zitadel::Client::Models + class UserServiceHumanUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader state: UserServiceUserState? + attr_reader username: String? + attr_reader login_names: Array[String]? + attr_reader preferred_login_name: String? + attr_reader profile: UserServiceHumanProfile? + attr_reader email: UserServiceHumanEmail? + attr_reader phone: UserServiceHumanPhone? + attr_reader password_change_required: bool? + attr_reader password_changed: Time? + attr_reader mfa_init_skipped: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_id_filter.rbs b/sig/zitadel/client/models/user_service_id_filter.rbs new file mode 100644 index 00000000..dc9600dc --- /dev/null +++ b/sig/zitadel/client/models/user_service_id_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceIDFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_idp_information.rbs b/sig/zitadel/client/models/user_service_idp_information.rbs new file mode 100644 index 00000000..4fea9791 --- /dev/null +++ b/sig/zitadel/client/models/user_service_idp_information.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class UserServiceIDPInformation < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_id: String? + attr_reader user_id: String? + attr_reader user_name: String? + attr_reader raw_information: Hash[String, untyped]? + attr_reader ldap: UserServiceIDPLDAPAccessInformation? + attr_reader oauth: UserServiceIDPOAuthAccessInformation? + attr_reader saml: UserServiceIDPSAMLAccessInformation? + end +end diff --git a/sig/zitadel/client/models/user_service_idp_intent.rbs b/sig/zitadel/client/models/user_service_idp_intent.rbs new file mode 100644 index 00000000..f1c0a39c --- /dev/null +++ b/sig/zitadel/client/models/user_service_idp_intent.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceIDPIntent < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_intent_id: String? + attr_reader idp_intent_token: String? + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_idp_link.rbs b/sig/zitadel/client/models/user_service_idp_link.rbs new file mode 100644 index 00000000..27da4ea7 --- /dev/null +++ b/sig/zitadel/client/models/user_service_idp_link.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceIDPLink < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_id: String? + attr_reader user_id: String? + attr_reader user_name: String? + end +end diff --git a/sig/zitadel/client/models/user_service_idpldap_access_information.rbs b/sig/zitadel/client/models/user_service_idpldap_access_information.rbs new file mode 100644 index 00000000..d0844a09 --- /dev/null +++ b/sig/zitadel/client/models/user_service_idpldap_access_information.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceIDPLDAPAccessInformation < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader attributes: Hash[String, untyped]? + end +end diff --git a/sig/zitadel/client/models/user_service_idpo_auth_access_information.rbs b/sig/zitadel/client/models/user_service_idpo_auth_access_information.rbs new file mode 100644 index 00000000..531c2e32 --- /dev/null +++ b/sig/zitadel/client/models/user_service_idpo_auth_access_information.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceIDPOAuthAccessInformation < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader access_token: String? + attr_reader id_token: String? + end +end diff --git a/sig/zitadel/client/models/user_service_idpsaml_access_information.rbs b/sig/zitadel/client/models/user_service_idpsaml_access_information.rbs new file mode 100644 index 00000000..0fe76a01 --- /dev/null +++ b/sig/zitadel/client/models/user_service_idpsaml_access_information.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceIDPSAMLAccessInformation < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader assertion: String? + end +end diff --git a/sig/zitadel/client/models/user_service_in_user_emails_query.rbs b/sig/zitadel/client/models/user_service_in_user_emails_query.rbs new file mode 100644 index 00000000..12081a80 --- /dev/null +++ b/sig/zitadel/client/models/user_service_in_user_emails_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceInUserEmailsQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_emails: Array[String]? + end +end diff --git a/sig/zitadel/client/models/user_service_in_user_id_query.rbs b/sig/zitadel/client/models/user_service_in_user_id_query.rbs new file mode 100644 index 00000000..d4afb680 --- /dev/null +++ b/sig/zitadel/client/models/user_service_in_user_id_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceInUserIDQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_ids: Array[String]? + end +end diff --git a/sig/zitadel/client/models/user_service_key.rbs b/sig/zitadel/client/models/user_service_key.rbs new file mode 100644 index 00000000..de495763 --- /dev/null +++ b/sig/zitadel/client/models/user_service_key.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class UserServiceKey < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader id: String? + attr_reader user_id: String? + attr_reader organization_id: String? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_key_field_name.rbs b/sig/zitadel/client/models/user_service_key_field_name.rbs new file mode 100644 index 00000000..e87591f7 --- /dev/null +++ b/sig/zitadel/client/models/user_service_key_field_name.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServiceKeyFieldName + KEY_FIELD_NAME_UNSPECIFIED: String + KEY_FIELD_NAME_CREATED_DATE: String + KEY_FIELD_NAME_ID: String + KEY_FIELD_NAME_USER_ID: String + KEY_FIELD_NAME_ORGANIZATION_ID: String + KEY_FIELD_NAME_KEY_EXPIRATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_keys_search_filter.rbs b/sig/zitadel/client/models/user_service_keys_search_filter.rbs new file mode 100644 index 00000000..299e2600 --- /dev/null +++ b/sig/zitadel/client/models/user_service_keys_search_filter.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServiceKeysSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader created_date_filter: UserServiceTimestampFilter? + attr_reader expiration_date_filter: UserServiceTimestampFilter? + attr_reader key_id_filter: UserServiceIDFilter? + attr_reader organization_id_filter: UserServiceIDFilter? + attr_reader user_id_filter: UserServiceIDFilter? + end +end diff --git a/sig/zitadel/client/models/user_service_last_name_query.rbs b/sig/zitadel/client/models/user_service_last_name_query.rbs new file mode 100644 index 00000000..36fa0bb3 --- /dev/null +++ b/sig/zitadel/client/models/user_service_last_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceLastNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader last_name: String? + attr_reader method: UserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_ldap_credentials.rbs b/sig/zitadel/client/models/user_service_ldap_credentials.rbs new file mode 100644 index 00000000..e07ed3df --- /dev/null +++ b/sig/zitadel/client/models/user_service_ldap_credentials.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceLDAPCredentials < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader username: String? + attr_reader password: String? + end +end diff --git a/sig/zitadel/client/models/user_service_list_authentication_factors_request.rbs b/sig/zitadel/client/models/user_service_list_authentication_factors_request.rbs new file mode 100644 index 00000000..11a6dc40 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_authentication_factors_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceListAuthenticationFactorsRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader auth_factors: Array[UserServiceAuthFactors]? + attr_reader states: Array[UserServiceAuthFactorState]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_authentication_factors_response.rbs b/sig/zitadel/client/models/user_service_list_authentication_factors_response.rbs new file mode 100644 index 00000000..af0cfb1f --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_authentication_factors_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceListAuthenticationFactorsResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader result: Array[UserServiceAuthFactor]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_authentication_method_types_request.rbs b/sig/zitadel/client/models/user_service_list_authentication_method_types_request.rbs new file mode 100644 index 00000000..708fa66b --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_authentication_method_types_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceListAuthenticationMethodTypesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader domain_query: UserServiceDomainQuery? + end +end diff --git a/sig/zitadel/client/models/user_service_list_authentication_method_types_response.rbs b/sig/zitadel/client/models/user_service_list_authentication_method_types_response.rbs new file mode 100644 index 00000000..294970aa --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_authentication_method_types_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceListAuthenticationMethodTypesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceListDetails? + attr_reader auth_method_types: Array[UserServiceAuthenticationMethodType]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_details.rbs b/sig/zitadel/client/models/user_service_list_details.rbs new file mode 100644 index 00000000..38c1073a --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_details.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceListDetails < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader processed_sequence: untyped? + attr_reader timestamp: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_list_idp_links_request.rbs b/sig/zitadel/client/models/user_service_list_idp_links_request.rbs new file mode 100644 index 00000000..7c63ae4c --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_idp_links_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceListIDPLinksRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader query: UserServiceListQuery? + end +end diff --git a/sig/zitadel/client/models/user_service_list_idp_links_response.rbs b/sig/zitadel/client/models/user_service_list_idp_links_response.rbs new file mode 100644 index 00000000..643ad5ac --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_idp_links_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceListIDPLinksResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceListDetails? + attr_reader result: Array[UserServiceIDPLink]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_keys_request.rbs b/sig/zitadel/client/models/user_service_list_keys_request.rbs new file mode 100644 index 00000000..d3d86af9 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_keys_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceListKeysRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: UserServicePaginationRequest? + attr_reader sorting_column: UserServiceKeyFieldName? + attr_reader filters: Array[UserServiceKeysSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_keys_response.rbs b/sig/zitadel/client/models/user_service_list_keys_response.rbs new file mode 100644 index 00000000..6362ffe3 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_keys_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceListKeysResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: UserServicePaginationResponse? + attr_reader result: Array[UserServiceKey]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_passkeys_request.rbs b/sig/zitadel/client/models/user_service_list_passkeys_request.rbs new file mode 100644 index 00000000..ff54e649 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_passkeys_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceListPasskeysRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_list_passkeys_response.rbs b/sig/zitadel/client/models/user_service_list_passkeys_response.rbs new file mode 100644 index 00000000..069fcbfb --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_passkeys_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceListPasskeysResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceListDetails? + attr_reader result: Array[UserServicePasskey]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_personal_access_tokens_request.rbs b/sig/zitadel/client/models/user_service_list_personal_access_tokens_request.rbs new file mode 100644 index 00000000..6b08da76 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_personal_access_tokens_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceListPersonalAccessTokensRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: UserServicePaginationRequest? + attr_reader sorting_column: UserServicePersonalAccessTokenFieldName? + attr_reader filters: Array[UserServicePersonalAccessTokensSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_personal_access_tokens_response.rbs b/sig/zitadel/client/models/user_service_list_personal_access_tokens_response.rbs new file mode 100644 index 00000000..aa4b3e22 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_personal_access_tokens_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceListPersonalAccessTokensResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: UserServicePaginationResponse? + attr_reader result: Array[UserServicePersonalAccessToken]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_query.rbs b/sig/zitadel/client/models/user_service_list_query.rbs new file mode 100644 index 00000000..fdaf3af3 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_query.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceListQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/user_service_list_user_metadata_request.rbs b/sig/zitadel/client/models/user_service_list_user_metadata_request.rbs new file mode 100644 index 00000000..4d7470c8 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_user_metadata_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceListUserMetadataRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader pagination: UserServicePaginationRequest? + attr_reader filters: Array[UserServiceMetadataSearchFilter]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_user_metadata_response.rbs b/sig/zitadel/client/models/user_service_list_user_metadata_response.rbs new file mode 100644 index 00000000..f0fde5ab --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_user_metadata_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceListUserMetadataResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader pagination: UserServicePaginationResponse? + attr_reader metadata: Array[UserServiceMetadata]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_users_request.rbs b/sig/zitadel/client/models/user_service_list_users_request.rbs new file mode 100644 index 00000000..fd63fd34 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_users_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceListUsersRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader query: UserServiceListQuery? + attr_reader sorting_column: UserServiceUserFieldName? + attr_reader queries: Array[UserServiceSearchQuery]? + end +end diff --git a/sig/zitadel/client/models/user_service_list_users_response.rbs b/sig/zitadel/client/models/user_service_list_users_response.rbs new file mode 100644 index 00000000..8722ad92 --- /dev/null +++ b/sig/zitadel/client/models/user_service_list_users_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceListUsersResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceListDetails? + attr_reader sorting_column: UserServiceUserFieldName? + attr_reader result: Array[UserServiceUser]? + end +end diff --git a/sig/zitadel/client/models/user_service_lock_user_request.rbs b/sig/zitadel/client/models/user_service_lock_user_request.rbs new file mode 100644 index 00000000..29d4d66f --- /dev/null +++ b/sig/zitadel/client/models/user_service_lock_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceLockUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_lock_user_response.rbs b/sig/zitadel/client/models/user_service_lock_user_response.rbs new file mode 100644 index 00000000..7587de0a --- /dev/null +++ b/sig/zitadel/client/models/user_service_lock_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceLockUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_login_name_query.rbs b/sig/zitadel/client/models/user_service_login_name_query.rbs new file mode 100644 index 00000000..b18ed606 --- /dev/null +++ b/sig/zitadel/client/models/user_service_login_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceLoginNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader login_name: String? + attr_reader method: UserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_machine.rbs b/sig/zitadel/client/models/user_service_machine.rbs new file mode 100644 index 00000000..318d3cdb --- /dev/null +++ b/sig/zitadel/client/models/user_service_machine.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceMachine < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader description: String? + end +end diff --git a/sig/zitadel/client/models/user_service_machine_user.rbs b/sig/zitadel/client/models/user_service_machine_user.rbs new file mode 100644 index 00000000..e12ca321 --- /dev/null +++ b/sig/zitadel/client/models/user_service_machine_user.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceMachineUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader name: String? + attr_reader description: String? + attr_reader has_secret: bool? + attr_reader access_token_type: UserServiceAccessTokenType? + end +end diff --git a/sig/zitadel/client/models/user_service_metadata.rbs b/sig/zitadel/client/models/user_service_metadata.rbs new file mode 100644 index 00000000..1d398e38 --- /dev/null +++ b/sig/zitadel/client/models/user_service_metadata.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceMetadata < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader value: String? + end +end diff --git a/sig/zitadel/client/models/user_service_metadata_key_filter.rbs b/sig/zitadel/client/models/user_service_metadata_key_filter.rbs new file mode 100644 index 00000000..248ccb0a --- /dev/null +++ b/sig/zitadel/client/models/user_service_metadata_key_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceMetadataKeyFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader method: UserServiceTextFilterMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_metadata_search_filter.rbs b/sig/zitadel/client/models/user_service_metadata_search_filter.rbs new file mode 100644 index 00000000..15417a95 --- /dev/null +++ b/sig/zitadel/client/models/user_service_metadata_search_filter.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceMetadataSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key_filter: UserServiceMetadataKeyFilter? + end +end diff --git a/sig/zitadel/client/models/user_service_metadata_value_filter.rbs b/sig/zitadel/client/models/user_service_metadata_value_filter.rbs new file mode 100644 index 00000000..072a7fd1 --- /dev/null +++ b/sig/zitadel/client/models/user_service_metadata_value_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceMetadataValueFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader value: String? + attr_reader method: UserServiceByteFilterMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_nick_name_query.rbs b/sig/zitadel/client/models/user_service_nick_name_query.rbs new file mode 100644 index 00000000..b20b308d --- /dev/null +++ b/sig/zitadel/client/models/user_service_nick_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceNickNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader nick_name: String? + attr_reader method: UserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_not_query.rbs b/sig/zitadel/client/models/user_service_not_query.rbs new file mode 100644 index 00000000..f2b30583 --- /dev/null +++ b/sig/zitadel/client/models/user_service_not_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceNotQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader query: UserServiceSearchQuery? + end +end diff --git a/sig/zitadel/client/models/user_service_notification_type.rbs b/sig/zitadel/client/models/user_service_notification_type.rbs new file mode 100644 index 00000000..d78c40a4 --- /dev/null +++ b/sig/zitadel/client/models/user_service_notification_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceNotificationType + NOTIFICATION_TYPE_UNSPECIFIED: String + NOTIFICATION_TYPE_EMAIL: String + NOTIFICATION_TYPE_SMS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_or_query.rbs b/sig/zitadel/client/models/user_service_or_query.rbs new file mode 100644 index 00000000..b2782950 --- /dev/null +++ b/sig/zitadel/client/models/user_service_or_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceOrQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader queries: Array[UserServiceSearchQuery]? + end +end diff --git a/sig/zitadel/client/models/user_service_organization.rbs b/sig/zitadel/client/models/user_service_organization.rbs new file mode 100644 index 00000000..96e41879 --- /dev/null +++ b/sig/zitadel/client/models/user_service_organization.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceOrganization < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader org_domain: String? + attr_reader org_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_organization_id_query.rbs b/sig/zitadel/client/models/user_service_organization_id_query.rbs new file mode 100644 index 00000000..182cbd5d --- /dev/null +++ b/sig/zitadel/client/models/user_service_organization_id_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceOrganizationIdQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader organization_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_pagination_request.rbs b/sig/zitadel/client/models/user_service_pagination_request.rbs new file mode 100644 index 00000000..75359304 --- /dev/null +++ b/sig/zitadel/client/models/user_service_pagination_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServicePaginationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader offset: untyped? + attr_reader limit: Integer? + attr_reader asc: bool? + end +end diff --git a/sig/zitadel/client/models/user_service_pagination_response.rbs b/sig/zitadel/client/models/user_service_pagination_response.rbs new file mode 100644 index 00000000..3df1761a --- /dev/null +++ b/sig/zitadel/client/models/user_service_pagination_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServicePaginationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader total_result: untyped? + attr_reader applied_limit: untyped? + end +end diff --git a/sig/zitadel/client/models/user_service_passkey.rbs b/sig/zitadel/client/models/user_service_passkey.rbs new file mode 100644 index 00000000..62ac178c --- /dev/null +++ b/sig/zitadel/client/models/user_service_passkey.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServicePasskey < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader state: UserServiceAuthFactorState? + attr_reader name: String? + end +end diff --git a/sig/zitadel/client/models/user_service_passkey_authenticator.rbs b/sig/zitadel/client/models/user_service_passkey_authenticator.rbs new file mode 100644 index 00000000..5db13848 --- /dev/null +++ b/sig/zitadel/client/models/user_service_passkey_authenticator.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServicePasskeyAuthenticator + PASSKEY_AUTHENTICATOR_UNSPECIFIED: String + PASSKEY_AUTHENTICATOR_PLATFORM: String + PASSKEY_AUTHENTICATOR_CROSS_PLATFORM: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_passkey_registration_code.rbs b/sig/zitadel/client/models/user_service_passkey_registration_code.rbs new file mode 100644 index 00000000..f90144aa --- /dev/null +++ b/sig/zitadel/client/models/user_service_passkey_registration_code.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServicePasskeyRegistrationCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_password.rbs b/sig/zitadel/client/models/user_service_password.rbs new file mode 100644 index 00000000..77a75a20 --- /dev/null +++ b/sig/zitadel/client/models/user_service_password.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServicePassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader password: String? + attr_reader change_required: bool? + end +end diff --git a/sig/zitadel/client/models/user_service_password_reset_request.rbs b/sig/zitadel/client/models/user_service_password_reset_request.rbs new file mode 100644 index 00000000..8536171f --- /dev/null +++ b/sig/zitadel/client/models/user_service_password_reset_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServicePasswordResetRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_link: UserServiceSendPasswordResetLink? + end +end diff --git a/sig/zitadel/client/models/user_service_password_reset_response.rbs b/sig/zitadel/client/models/user_service_password_reset_response.rbs new file mode 100644 index 00000000..cb7dcbc2 --- /dev/null +++ b/sig/zitadel/client/models/user_service_password_reset_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServicePasswordResetResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_personal_access_token.rbs b/sig/zitadel/client/models/user_service_personal_access_token.rbs new file mode 100644 index 00000000..5d3dc3a7 --- /dev/null +++ b/sig/zitadel/client/models/user_service_personal_access_token.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class UserServicePersonalAccessToken < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader id: String? + attr_reader user_id: String? + attr_reader organization_id: String? + attr_reader expiration_date: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_personal_access_token_field_name.rbs b/sig/zitadel/client/models/user_service_personal_access_token_field_name.rbs new file mode 100644 index 00000000..57874be3 --- /dev/null +++ b/sig/zitadel/client/models/user_service_personal_access_token_field_name.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServicePersonalAccessTokenFieldName + PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED: String + PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE: String + PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID: String + PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID: String + PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID: String + PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_personal_access_tokens_search_filter.rbs b/sig/zitadel/client/models/user_service_personal_access_tokens_search_filter.rbs new file mode 100644 index 00000000..06138642 --- /dev/null +++ b/sig/zitadel/client/models/user_service_personal_access_tokens_search_filter.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServicePersonalAccessTokensSearchFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader created_date_filter: UserServiceTimestampFilter? + attr_reader expiration_date_filter: UserServiceTimestampFilter? + attr_reader organization_id_filter: UserServiceIDFilter? + attr_reader token_id_filter: UserServiceIDFilter? + attr_reader user_id_filter: UserServiceIDFilter? + end +end diff --git a/sig/zitadel/client/models/user_service_phone_query.rbs b/sig/zitadel/client/models/user_service_phone_query.rbs new file mode 100644 index 00000000..aa8e072b --- /dev/null +++ b/sig/zitadel/client/models/user_service_phone_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServicePhoneQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader number: String? + attr_reader method: UserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_profile.rbs b/sig/zitadel/client/models/user_service_profile.rbs new file mode 100644 index 00000000..1f866544 --- /dev/null +++ b/sig/zitadel/client/models/user_service_profile.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class UserServiceProfile < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader given_name: String? + attr_reader family_name: String? + attr_reader nick_name: String? + attr_reader display_name: String? + attr_reader preferred_language: String? + attr_reader gender: UserServiceGender? + end +end diff --git a/sig/zitadel/client/models/user_service_reactivate_user_request.rbs b/sig/zitadel/client/models/user_service_reactivate_user_request.rbs new file mode 100644 index 00000000..c123b2a7 --- /dev/null +++ b/sig/zitadel/client/models/user_service_reactivate_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceReactivateUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_reactivate_user_response.rbs b/sig/zitadel/client/models/user_service_reactivate_user_response.rbs new file mode 100644 index 00000000..9c9b18dc --- /dev/null +++ b/sig/zitadel/client/models/user_service_reactivate_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceReactivateUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_redirect_urls.rbs b/sig/zitadel/client/models/user_service_redirect_urls.rbs new file mode 100644 index 00000000..741e61d2 --- /dev/null +++ b/sig/zitadel/client/models/user_service_redirect_urls.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceRedirectURLs < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader success_url: String? + attr_reader failure_url: String? + end +end diff --git a/sig/zitadel/client/models/user_service_register_passkey_request.rbs b/sig/zitadel/client/models/user_service_register_passkey_request.rbs new file mode 100644 index 00000000..44992c14 --- /dev/null +++ b/sig/zitadel/client/models/user_service_register_passkey_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceRegisterPasskeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader code: UserServicePasskeyRegistrationCode? + attr_reader authenticator: UserServicePasskeyAuthenticator? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/user_service_register_passkey_response.rbs b/sig/zitadel/client/models/user_service_register_passkey_response.rbs new file mode 100644 index 00000000..136729d1 --- /dev/null +++ b/sig/zitadel/client/models/user_service_register_passkey_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceRegisterPasskeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader passkey_id: String? + attr_reader public_key_credential_creation_options: Hash[String, untyped]? + end +end diff --git a/sig/zitadel/client/models/user_service_register_totp_request.rbs b/sig/zitadel/client/models/user_service_register_totp_request.rbs new file mode 100644 index 00000000..fa381958 --- /dev/null +++ b/sig/zitadel/client/models/user_service_register_totp_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRegisterTOTPRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_register_totp_response.rbs b/sig/zitadel/client/models/user_service_register_totp_response.rbs new file mode 100644 index 00000000..37e909f3 --- /dev/null +++ b/sig/zitadel/client/models/user_service_register_totp_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceRegisterTOTPResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader uri: String? + attr_reader secret: String? + end +end diff --git a/sig/zitadel/client/models/user_service_register_u2_f_request.rbs b/sig/zitadel/client/models/user_service_register_u2_f_request.rbs new file mode 100644 index 00000000..2ac5425a --- /dev/null +++ b/sig/zitadel/client/models/user_service_register_u2_f_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceRegisterU2FRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader domain: String? + end +end diff --git a/sig/zitadel/client/models/user_service_register_u2_f_response.rbs b/sig/zitadel/client/models/user_service_register_u2_f_response.rbs new file mode 100644 index 00000000..b2beb763 --- /dev/null +++ b/sig/zitadel/client/models/user_service_register_u2_f_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceRegisterU2FResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader u2f_id: String? + attr_reader public_key_credential_creation_options: Hash[String, untyped]? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_idp_link_request.rbs b/sig/zitadel/client/models/user_service_remove_idp_link_request.rbs new file mode 100644 index 00000000..a4f0ae9b --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_idp_link_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceRemoveIDPLinkRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader idp_id: String? + attr_reader linked_user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_idp_link_response.rbs b/sig/zitadel/client/models/user_service_remove_idp_link_response.rbs new file mode 100644 index 00000000..a653300c --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_idp_link_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveIDPLinkResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_key_request.rbs b/sig/zitadel/client/models/user_service_remove_key_request.rbs new file mode 100644 index 00000000..7a4f3c8a --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_key_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceRemoveKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader key_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_key_response.rbs b/sig/zitadel/client/models/user_service_remove_key_response.rbs new file mode 100644 index 00000000..b43b7a6f --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_otp_email_request.rbs b/sig/zitadel/client/models/user_service_remove_otp_email_request.rbs new file mode 100644 index 00000000..c7aeb518 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_otp_email_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveOTPEmailRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_otp_email_response.rbs b/sig/zitadel/client/models/user_service_remove_otp_email_response.rbs new file mode 100644 index 00000000..5c429463 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_otp_email_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveOTPEmailResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_otpsms_request.rbs b/sig/zitadel/client/models/user_service_remove_otpsms_request.rbs new file mode 100644 index 00000000..036d535d --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_otpsms_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveOTPSMSRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_otpsms_response.rbs b/sig/zitadel/client/models/user_service_remove_otpsms_response.rbs new file mode 100644 index 00000000..3649aff5 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_otpsms_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveOTPSMSResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_passkey_request.rbs b/sig/zitadel/client/models/user_service_remove_passkey_request.rbs new file mode 100644 index 00000000..fba523a4 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_passkey_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceRemovePasskeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader passkey_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_passkey_response.rbs b/sig/zitadel/client/models/user_service_remove_passkey_response.rbs new file mode 100644 index 00000000..77a6cc54 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_passkey_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemovePasskeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_personal_access_token_request.rbs b/sig/zitadel/client/models/user_service_remove_personal_access_token_request.rbs new file mode 100644 index 00000000..00920fd7 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_personal_access_token_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceRemovePersonalAccessTokenRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader token_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_personal_access_token_response.rbs b/sig/zitadel/client/models/user_service_remove_personal_access_token_response.rbs new file mode 100644 index 00000000..b2866c72 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_personal_access_token_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemovePersonalAccessTokenResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_phone_request.rbs b/sig/zitadel/client/models/user_service_remove_phone_request.rbs new file mode 100644 index 00000000..c720c242 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_phone_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemovePhoneRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_phone_response.rbs b/sig/zitadel/client/models/user_service_remove_phone_response.rbs new file mode 100644 index 00000000..622b354d --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_phone_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemovePhoneResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_recovery_codes_request.rbs b/sig/zitadel/client/models/user_service_remove_recovery_codes_request.rbs new file mode 100644 index 00000000..298daa30 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_recovery_codes_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveRecoveryCodesRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_recovery_codes_response.rbs b/sig/zitadel/client/models/user_service_remove_recovery_codes_response.rbs new file mode 100644 index 00000000..94059587 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_recovery_codes_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveRecoveryCodesResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_secret_request.rbs b/sig/zitadel/client/models/user_service_remove_secret_request.rbs new file mode 100644 index 00000000..7bee7333 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_secret_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveSecretRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_secret_response.rbs b/sig/zitadel/client/models/user_service_remove_secret_response.rbs new file mode 100644 index 00000000..96b8d2a9 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_secret_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveSecretResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_totp_request.rbs b/sig/zitadel/client/models/user_service_remove_totp_request.rbs new file mode 100644 index 00000000..39a5bfd4 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_totp_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveTOTPRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_totp_response.rbs b/sig/zitadel/client/models/user_service_remove_totp_response.rbs new file mode 100644 index 00000000..6adab600 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_totp_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveTOTPResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_u2_f_request.rbs b/sig/zitadel/client/models/user_service_remove_u2_f_request.rbs new file mode 100644 index 00000000..7afbe752 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_u2_f_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceRemoveU2FRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader u2f_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_remove_u2_f_response.rbs b/sig/zitadel/client/models/user_service_remove_u2_f_response.rbs new file mode 100644 index 00000000..4e6f8571 --- /dev/null +++ b/sig/zitadel/client/models/user_service_remove_u2_f_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceRemoveU2FResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_resend_email_code_request.rbs b/sig/zitadel/client/models/user_service_resend_email_code_request.rbs new file mode 100644 index 00000000..fc6d36fd --- /dev/null +++ b/sig/zitadel/client/models/user_service_resend_email_code_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceResendEmailCodeRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_code: UserServiceSendEmailVerificationCode? + end +end diff --git a/sig/zitadel/client/models/user_service_resend_email_code_response.rbs b/sig/zitadel/client/models/user_service_resend_email_code_response.rbs new file mode 100644 index 00000000..08b5987a --- /dev/null +++ b/sig/zitadel/client/models/user_service_resend_email_code_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceResendEmailCodeResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_resend_invite_code_request.rbs b/sig/zitadel/client/models/user_service_resend_invite_code_request.rbs new file mode 100644 index 00000000..113815a2 --- /dev/null +++ b/sig/zitadel/client/models/user_service_resend_invite_code_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceResendInviteCodeRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_resend_invite_code_response.rbs b/sig/zitadel/client/models/user_service_resend_invite_code_response.rbs new file mode 100644 index 00000000..e6439a31 --- /dev/null +++ b/sig/zitadel/client/models/user_service_resend_invite_code_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceResendInviteCodeResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_resend_phone_code_request.rbs b/sig/zitadel/client/models/user_service_resend_phone_code_request.rbs new file mode 100644 index 00000000..2ca6b524 --- /dev/null +++ b/sig/zitadel/client/models/user_service_resend_phone_code_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceResendPhoneCodeRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_code: untyped? + end +end diff --git a/sig/zitadel/client/models/user_service_resend_phone_code_response.rbs b/sig/zitadel/client/models/user_service_resend_phone_code_response.rbs new file mode 100644 index 00000000..de212458 --- /dev/null +++ b/sig/zitadel/client/models/user_service_resend_phone_code_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceResendPhoneCodeResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rbs b/sig/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rbs new file mode 100644 index 00000000..58a9fbd2 --- /dev/null +++ b/sig/zitadel/client/models/user_service_retrieve_identity_provider_intent_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceRetrieveIdentityProviderIntentRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_intent_id: String? + attr_reader idp_intent_token: String? + end +end diff --git a/sig/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rbs b/sig/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rbs new file mode 100644 index 00000000..522c1df0 --- /dev/null +++ b/sig/zitadel/client/models/user_service_retrieve_identity_provider_intent_response.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServiceRetrieveIdentityProviderIntentResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader idp_information: UserServiceIDPInformation? + attr_reader user_id: String? + attr_reader add_human_user: UserServiceAddHumanUserRequest? + attr_reader update_human_user: UserServiceUpdateHumanUserRequest? + end +end diff --git a/sig/zitadel/client/models/user_service_search_query.rbs b/sig/zitadel/client/models/user_service_search_query.rbs new file mode 100644 index 00000000..d11e3a77 --- /dev/null +++ b/sig/zitadel/client/models/user_service_search_query.rbs @@ -0,0 +1,26 @@ +module Zitadel::Client::Models + class UserServiceSearchQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader and_query: UserServiceAndQuery? + attr_reader display_name_query: UserServiceDisplayNameQuery? + attr_reader email_query: UserServiceEmailQuery? + attr_reader first_name_query: UserServiceFirstNameQuery? + attr_reader in_user_emails_query: UserServiceInUserEmailsQuery? + attr_reader in_user_ids_query: UserServiceInUserIDQuery? + attr_reader last_name_query: UserServiceLastNameQuery? + attr_reader login_name_query: UserServiceLoginNameQuery? + attr_reader metadata_key_filter: UserServiceMetadataKeyFilter? + attr_reader metadata_value_filter: UserServiceMetadataValueFilter? + attr_reader nick_name_query: UserServiceNickNameQuery? + attr_reader not_query: UserServiceNotQuery? + attr_reader or_query: UserServiceOrQuery? + attr_reader organization_id_query: UserServiceOrganizationIdQuery? + attr_reader phone_query: UserServicePhoneQuery? + attr_reader state_query: UserServiceStateQuery? + attr_reader type_query: UserServiceTypeQuery? + attr_reader user_name_query: UserServiceUserNameQuery? + end +end diff --git a/sig/zitadel/client/models/user_service_send_email_code_request.rbs b/sig/zitadel/client/models/user_service_send_email_code_request.rbs new file mode 100644 index 00000000..a73ec3bf --- /dev/null +++ b/sig/zitadel/client/models/user_service_send_email_code_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceSendEmailCodeRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader return_code: untyped? + attr_reader send_code: UserServiceSendEmailVerificationCode? + end +end diff --git a/sig/zitadel/client/models/user_service_send_email_code_response.rbs b/sig/zitadel/client/models/user_service_send_email_code_response.rbs new file mode 100644 index 00000000..318f5eb0 --- /dev/null +++ b/sig/zitadel/client/models/user_service_send_email_code_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceSendEmailCodeResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_send_email_verification_code.rbs b/sig/zitadel/client/models/user_service_send_email_verification_code.rbs new file mode 100644 index 00000000..2f9de63a --- /dev/null +++ b/sig/zitadel/client/models/user_service_send_email_verification_code.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceSendEmailVerificationCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/user_service_send_invite_code.rbs b/sig/zitadel/client/models/user_service_send_invite_code.rbs new file mode 100644 index 00000000..e2ef4650 --- /dev/null +++ b/sig/zitadel/client/models/user_service_send_invite_code.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceSendInviteCode < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url_template: String? + attr_reader application_name: String? + end +end diff --git a/sig/zitadel/client/models/user_service_send_passkey_registration_link.rbs b/sig/zitadel/client/models/user_service_send_passkey_registration_link.rbs new file mode 100644 index 00000000..f838f27f --- /dev/null +++ b/sig/zitadel/client/models/user_service_send_passkey_registration_link.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceSendPasskeyRegistrationLink < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/user_service_send_password_reset_link.rbs b/sig/zitadel/client/models/user_service_send_password_reset_link.rbs new file mode 100644 index 00000000..94cb6d4e --- /dev/null +++ b/sig/zitadel/client/models/user_service_send_password_reset_link.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceSendPasswordResetLink < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader notification_type: UserServiceNotificationType? + attr_reader url_template: String? + end +end diff --git a/sig/zitadel/client/models/user_service_set_email_request.rbs b/sig/zitadel/client/models/user_service_set_email_request.rbs new file mode 100644 index 00000000..3ea4b4fe --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_email_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServiceSetEmailRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader email: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: UserServiceSendEmailVerificationCode? + end +end diff --git a/sig/zitadel/client/models/user_service_set_email_response.rbs b/sig/zitadel/client/models/user_service_set_email_response.rbs new file mode 100644 index 00000000..82c99fa2 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_email_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceSetEmailResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_set_human_email.rbs b/sig/zitadel/client/models/user_service_set_human_email.rbs new file mode 100644 index 00000000..db9ddc39 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_human_email.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceSetHumanEmail < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader email: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: UserServiceSendEmailVerificationCode? + end +end diff --git a/sig/zitadel/client/models/user_service_set_human_phone.rbs b/sig/zitadel/client/models/user_service_set_human_phone.rbs new file mode 100644 index 00000000..f393d2a0 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_human_phone.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceSetHumanPhone < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader phone: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: untyped? + end +end diff --git a/sig/zitadel/client/models/user_service_set_human_profile.rbs b/sig/zitadel/client/models/user_service_set_human_profile.rbs new file mode 100644 index 00000000..690d7222 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_human_profile.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class UserServiceSetHumanProfile < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader given_name: String? + attr_reader family_name: String? + attr_reader nick_name: String? + attr_reader display_name: String? + attr_reader preferred_language: String? + attr_reader gender: UserServiceGender? + end +end diff --git a/sig/zitadel/client/models/user_service_set_metadata_entry.rbs b/sig/zitadel/client/models/user_service_set_metadata_entry.rbs new file mode 100644 index 00000000..aa22a334 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_metadata_entry.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceSetMetadataEntry < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader key: String? + attr_reader value: String? + end +end diff --git a/sig/zitadel/client/models/user_service_set_password.rbs b/sig/zitadel/client/models/user_service_set_password.rbs new file mode 100644 index 00000000..9576c1a9 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_password.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceSetPassword < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader hashed_password: UserServiceHashedPassword? + attr_reader password: UserServicePassword? + attr_reader current_password: String? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_set_password_request.rbs b/sig/zitadel/client/models/user_service_set_password_request.rbs new file mode 100644 index 00000000..bd120361 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_password_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceSetPasswordRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader new_password: UserServicePassword? + attr_reader current_password: String? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_set_password_response.rbs b/sig/zitadel/client/models/user_service_set_password_response.rbs new file mode 100644 index 00000000..638d6732 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_password_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceSetPasswordResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_set_phone_request.rbs b/sig/zitadel/client/models/user_service_set_phone_request.rbs new file mode 100644 index 00000000..45bd6cd7 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_phone_request.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServiceSetPhoneRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader phone: String? + attr_reader is_verified: bool? + attr_reader return_code: untyped? + attr_reader send_code: untyped? + end +end diff --git a/sig/zitadel/client/models/user_service_set_phone_response.rbs b/sig/zitadel/client/models/user_service_set_phone_response.rbs new file mode 100644 index 00000000..ab3d8f86 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_phone_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceSetPhoneResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_set_user_metadata_request.rbs b/sig/zitadel/client/models/user_service_set_user_metadata_request.rbs new file mode 100644 index 00000000..dfa81c24 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_user_metadata_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceSetUserMetadataRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader metadata: Array[UserServiceMetadata]? + end +end diff --git a/sig/zitadel/client/models/user_service_set_user_metadata_response.rbs b/sig/zitadel/client/models/user_service_set_user_metadata_response.rbs new file mode 100644 index 00000000..07cc4b89 --- /dev/null +++ b/sig/zitadel/client/models/user_service_set_user_metadata_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceSetUserMetadataResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader set_date: Time? + end +end diff --git a/sig/zitadel/client/models/user_service_start_identity_provider_intent_request.rbs b/sig/zitadel/client/models/user_service_start_identity_provider_intent_request.rbs new file mode 100644 index 00000000..9a8dabce --- /dev/null +++ b/sig/zitadel/client/models/user_service_start_identity_provider_intent_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceStartIdentityProviderIntentRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader idp_id: String? + attr_reader ldap: UserServiceLDAPCredentials? + attr_reader urls: UserServiceRedirectURLs? + end +end diff --git a/sig/zitadel/client/models/user_service_start_identity_provider_intent_response.rbs b/sig/zitadel/client/models/user_service_start_identity_provider_intent_response.rbs new file mode 100644 index 00000000..06cb0041 --- /dev/null +++ b/sig/zitadel/client/models/user_service_start_identity_provider_intent_response.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServiceStartIdentityProviderIntentResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader auth_url: String? + attr_reader form_data: UserServiceFormData? + attr_reader idp_intent: UserServiceIDPIntent? + attr_reader post_form: String? + end +end diff --git a/sig/zitadel/client/models/user_service_state_query.rbs b/sig/zitadel/client/models/user_service_state_query.rbs new file mode 100644 index 00000000..4fc4918d --- /dev/null +++ b/sig/zitadel/client/models/user_service_state_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceStateQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader state: UserServiceUserState? + end +end diff --git a/sig/zitadel/client/models/user_service_text_filter_method.rbs b/sig/zitadel/client/models/user_service_text_filter_method.rbs new file mode 100644 index 00000000..c7679b5f --- /dev/null +++ b/sig/zitadel/client/models/user_service_text_filter_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class UserServiceTextFilterMethod + TEXT_FILTER_METHOD_EQUALS: String + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE: String + TEXT_FILTER_METHOD_STARTS_WITH: String + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_FILTER_METHOD_CONTAINS: String + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_FILTER_METHOD_ENDS_WITH: String + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_text_query_method.rbs b/sig/zitadel/client/models/user_service_text_query_method.rbs new file mode 100644 index 00000000..d0bf780c --- /dev/null +++ b/sig/zitadel/client/models/user_service_text_query_method.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class UserServiceTextQueryMethod + TEXT_QUERY_METHOD_EQUALS: String + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE: String + TEXT_QUERY_METHOD_STARTS_WITH: String + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE: String + TEXT_QUERY_METHOD_CONTAINS: String + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE: String + TEXT_QUERY_METHOD_ENDS_WITH: String + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_timestamp_filter.rbs b/sig/zitadel/client/models/user_service_timestamp_filter.rbs new file mode 100644 index 00000000..0fa36e99 --- /dev/null +++ b/sig/zitadel/client/models/user_service_timestamp_filter.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceTimestampFilter < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader timestamp: Time? + attr_reader method: UserServiceTimestampFilterMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_timestamp_filter_method.rbs b/sig/zitadel/client/models/user_service_timestamp_filter_method.rbs new file mode 100644 index 00000000..2042441f --- /dev/null +++ b/sig/zitadel/client/models/user_service_timestamp_filter_method.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceTimestampFilterMethod + TIMESTAMP_FILTER_METHOD_EQUALS: String + TIMESTAMP_FILTER_METHOD_AFTER: String + TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS: String + TIMESTAMP_FILTER_METHOD_BEFORE: String + TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_type.rbs b/sig/zitadel/client/models/user_service_type.rbs new file mode 100644 index 00000000..2314045f --- /dev/null +++ b/sig/zitadel/client/models/user_service_type.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceType + TYPE_UNSPECIFIED: String + TYPE_HUMAN: String + TYPE_MACHINE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_type_query.rbs b/sig/zitadel/client/models/user_service_type_query.rbs new file mode 100644 index 00000000..7a9fa08f --- /dev/null +++ b/sig/zitadel/client/models/user_service_type_query.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceTypeQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader type: UserServiceType? + end +end diff --git a/sig/zitadel/client/models/user_service_unlock_user_request.rbs b/sig/zitadel/client/models/user_service_unlock_user_request.rbs new file mode 100644 index 00000000..3242c7fb --- /dev/null +++ b/sig/zitadel/client/models/user_service_unlock_user_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceUnlockUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + end +end diff --git a/sig/zitadel/client/models/user_service_unlock_user_response.rbs b/sig/zitadel/client/models/user_service_unlock_user_response.rbs new file mode 100644 index 00000000..6eb3d760 --- /dev/null +++ b/sig/zitadel/client/models/user_service_unlock_user_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceUnlockUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_update_human_user_request.rbs b/sig/zitadel/client/models/user_service_update_human_user_request.rbs new file mode 100644 index 00000000..05105df9 --- /dev/null +++ b/sig/zitadel/client/models/user_service_update_human_user_request.rbs @@ -0,0 +1,14 @@ +module Zitadel::Client::Models + class UserServiceUpdateHumanUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader username: String? + attr_reader profile: UserServiceSetHumanProfile? + attr_reader email: UserServiceSetHumanEmail? + attr_reader phone: UserServiceSetHumanPhone? + attr_reader password: UserServiceSetPassword? + end +end diff --git a/sig/zitadel/client/models/user_service_update_human_user_response.rbs b/sig/zitadel/client/models/user_service_update_human_user_response.rbs new file mode 100644 index 00000000..daac3dfb --- /dev/null +++ b/sig/zitadel/client/models/user_service_update_human_user_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceUpdateHumanUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + attr_reader email_code: String? + attr_reader phone_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_update_user_request.rbs b/sig/zitadel/client/models/user_service_update_user_request.rbs new file mode 100644 index 00000000..3befa69f --- /dev/null +++ b/sig/zitadel/client/models/user_service_update_user_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceUpdateUserRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader username: String? + attr_reader human: UserServiceHuman? + attr_reader machine: UserServiceMachine? + end +end diff --git a/sig/zitadel/client/models/user_service_update_user_response.rbs b/sig/zitadel/client/models/user_service_update_user_response.rbs new file mode 100644 index 00000000..584a5674 --- /dev/null +++ b/sig/zitadel/client/models/user_service_update_user_response.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class UserServiceUpdateUserResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + attr_reader email_code: String? + attr_reader phone_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_user.rbs b/sig/zitadel/client/models/user_service_user.rbs new file mode 100644 index 00000000..5bfb54d6 --- /dev/null +++ b/sig/zitadel/client/models/user_service_user.rbs @@ -0,0 +1,16 @@ +module Zitadel::Client::Models + class UserServiceUser < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader details: UserServiceDetails? + attr_reader state: UserServiceUserState? + attr_reader username: String? + attr_reader login_names: Array[String]? + attr_reader preferred_login_name: String? + attr_reader human: UserServiceHumanUser? + attr_reader machine: UserServiceMachineUser? + end +end diff --git a/sig/zitadel/client/models/user_service_user_field_name.rbs b/sig/zitadel/client/models/user_service_user_field_name.rbs new file mode 100644 index 00000000..776ef8e1 --- /dev/null +++ b/sig/zitadel/client/models/user_service_user_field_name.rbs @@ -0,0 +1,17 @@ +module Zitadel::Client::Models + class UserServiceUserFieldName + USER_FIELD_NAME_UNSPECIFIED: String + USER_FIELD_NAME_USER_NAME: String + USER_FIELD_NAME_FIRST_NAME: String + USER_FIELD_NAME_LAST_NAME: String + USER_FIELD_NAME_NICK_NAME: String + USER_FIELD_NAME_DISPLAY_NAME: String + USER_FIELD_NAME_EMAIL: String + USER_FIELD_NAME_STATE: String + USER_FIELD_NAME_TYPE: String + USER_FIELD_NAME_CREATION_DATE: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_user_name_query.rbs b/sig/zitadel/client/models/user_service_user_name_query.rbs new file mode 100644 index 00000000..05131578 --- /dev/null +++ b/sig/zitadel/client/models/user_service_user_name_query.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceUserNameQuery < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_name: String? + attr_reader method: UserServiceTextQueryMethod? + end +end diff --git a/sig/zitadel/client/models/user_service_user_state.rbs b/sig/zitadel/client/models/user_service_user_state.rbs new file mode 100644 index 00000000..609b36b7 --- /dev/null +++ b/sig/zitadel/client/models/user_service_user_state.rbs @@ -0,0 +1,13 @@ +module Zitadel::Client::Models + class UserServiceUserState + USER_STATE_UNSPECIFIED: String + USER_STATE_ACTIVE: String + USER_STATE_INACTIVE: String + USER_STATE_DELETED: String + USER_STATE_LOCKED: String + USER_STATE_INITIAL: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_email_request.rbs b/sig/zitadel/client/models/user_service_verify_email_request.rbs new file mode 100644 index 00000000..dbed317a --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_email_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceVerifyEmailRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_email_response.rbs b/sig/zitadel/client/models/user_service_verify_email_response.rbs new file mode 100644 index 00000000..cd8316eb --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_email_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceVerifyEmailResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_invite_code_request.rbs b/sig/zitadel/client/models/user_service_verify_invite_code_request.rbs new file mode 100644 index 00000000..7d3d5182 --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_invite_code_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceVerifyInviteCodeRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_invite_code_response.rbs b/sig/zitadel/client/models/user_service_verify_invite_code_response.rbs new file mode 100644 index 00000000..6ee71b03 --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_invite_code_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceVerifyInviteCodeResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_passkey_registration_request.rbs b/sig/zitadel/client/models/user_service_verify_passkey_registration_request.rbs new file mode 100644 index 00000000..c14a9c4e --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_passkey_registration_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceVerifyPasskeyRegistrationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader passkey_id: String? + attr_reader public_key_credential: Hash[String, untyped]? + attr_reader passkey_name: String? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_passkey_registration_response.rbs b/sig/zitadel/client/models/user_service_verify_passkey_registration_response.rbs new file mode 100644 index 00000000..bf478e6e --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_passkey_registration_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceVerifyPasskeyRegistrationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_phone_request.rbs b/sig/zitadel/client/models/user_service_verify_phone_request.rbs new file mode 100644 index 00000000..c20a51a3 --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_phone_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceVerifyPhoneRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader verification_code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_phone_response.rbs b/sig/zitadel/client/models/user_service_verify_phone_response.rbs new file mode 100644 index 00000000..ce8c5c85 --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_phone_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceVerifyPhoneResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_totp_registration_request.rbs b/sig/zitadel/client/models/user_service_verify_totp_registration_request.rbs new file mode 100644 index 00000000..178acc99 --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_totp_registration_request.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class UserServiceVerifyTOTPRegistrationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader code: String? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_totp_registration_response.rbs b/sig/zitadel/client/models/user_service_verify_totp_registration_response.rbs new file mode 100644 index 00000000..3427d469 --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_totp_registration_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceVerifyTOTPRegistrationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_u2_f_registration_request.rbs b/sig/zitadel/client/models/user_service_verify_u2_f_registration_request.rbs new file mode 100644 index 00000000..03c6973a --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_u2_f_registration_request.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class UserServiceVerifyU2FRegistrationRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader user_id: String? + attr_reader u2f_id: String? + attr_reader public_key_credential: Hash[String, untyped]? + attr_reader token_name: String? + end +end diff --git a/sig/zitadel/client/models/user_service_verify_u2_f_registration_response.rbs b/sig/zitadel/client/models/user_service_verify_u2_f_registration_response.rbs new file mode 100644 index 00000000..850bc5d4 --- /dev/null +++ b/sig/zitadel/client/models/user_service_verify_u2_f_registration_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class UserServiceVerifyU2FRegistrationResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader details: UserServiceDetails? + end +end diff --git a/sig/zitadel/client/models/web_key_service_activate_web_key_request.rbs b/sig/zitadel/client/models/web_key_service_activate_web_key_request.rbs new file mode 100644 index 00000000..89ca5737 --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_activate_web_key_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class WebKeyServiceActivateWebKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/web_key_service_activate_web_key_response.rbs b/sig/zitadel/client/models/web_key_service_activate_web_key_response.rbs new file mode 100644 index 00000000..daaa5c67 --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_activate_web_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class WebKeyServiceActivateWebKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader change_date: Time? + end +end diff --git a/sig/zitadel/client/models/web_key_service_any.rbs b/sig/zitadel/client/models/web_key_service_any.rbs new file mode 100644 index 00000000..6481fd95 --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_any.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class WebKeyServiceAny < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader type: String? + attr_reader value: File? + attr_reader debug: untyped? + end +end diff --git a/sig/zitadel/client/models/web_key_service_connect_error.rbs b/sig/zitadel/client/models/web_key_service_connect_error.rbs new file mode 100644 index 00000000..7aaf4bf3 --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_connect_error.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class WebKeyServiceConnectError < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + ADDITIONAL_PROPERTIES: bool + attr_reader code: String? + attr_reader message: String? + attr_reader details: Array[WebKeyServiceAny]? + end +end diff --git a/sig/zitadel/client/models/web_key_service_create_web_key_request.rbs b/sig/zitadel/client/models/web_key_service_create_web_key_request.rbs new file mode 100644 index 00000000..f0c381b4 --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_create_web_key_request.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class WebKeyServiceCreateWebKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader ecdsa: WebKeyServiceECDSA? + attr_reader ed25519: untyped? + attr_reader rsa: WebKeyServiceRSA? + end +end diff --git a/sig/zitadel/client/models/web_key_service_create_web_key_response.rbs b/sig/zitadel/client/models/web_key_service_create_web_key_response.rbs new file mode 100644 index 00000000..0018fedd --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_create_web_key_response.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class WebKeyServiceCreateWebKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + end +end diff --git a/sig/zitadel/client/models/web_key_service_delete_web_key_request.rbs b/sig/zitadel/client/models/web_key_service_delete_web_key_request.rbs new file mode 100644 index 00000000..f8385efd --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_delete_web_key_request.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class WebKeyServiceDeleteWebKeyRequest < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + end +end diff --git a/sig/zitadel/client/models/web_key_service_delete_web_key_response.rbs b/sig/zitadel/client/models/web_key_service_delete_web_key_response.rbs new file mode 100644 index 00000000..799e2a34 --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_delete_web_key_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class WebKeyServiceDeleteWebKeyResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader deletion_date: Time? + end +end diff --git a/sig/zitadel/client/models/web_key_service_ecdsa.rbs b/sig/zitadel/client/models/web_key_service_ecdsa.rbs new file mode 100644 index 00000000..66f4228b --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_ecdsa.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class WebKeyServiceECDSA < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader curve: WebKeyServiceECDSACurve? + end +end diff --git a/sig/zitadel/client/models/web_key_service_ecdsa_curve.rbs b/sig/zitadel/client/models/web_key_service_ecdsa_curve.rbs new file mode 100644 index 00000000..34392bcf --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_ecdsa_curve.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class WebKeyServiceECDSACurve + ECDSA_CURVE_UNSPECIFIED: String + ECDSA_CURVE_P256: String + ECDSA_CURVE_P384: String + ECDSA_CURVE_P512: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/web_key_service_list_web_keys_response.rbs b/sig/zitadel/client/models/web_key_service_list_web_keys_response.rbs new file mode 100644 index 00000000..a6d6fb24 --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_list_web_keys_response.rbs @@ -0,0 +1,9 @@ +module Zitadel::Client::Models + class WebKeyServiceListWebKeysResponse < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader web_keys: Array[WebKeyServiceWebKey]? + end +end diff --git a/sig/zitadel/client/models/web_key_service_rsa.rbs b/sig/zitadel/client/models/web_key_service_rsa.rbs new file mode 100644 index 00000000..00a9a2fd --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_rsa.rbs @@ -0,0 +1,10 @@ +module Zitadel::Client::Models + class WebKeyServiceRSA < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader bits: WebKeyServiceRSABits? + attr_reader hasher: WebKeyServiceRSAHasher? + end +end diff --git a/sig/zitadel/client/models/web_key_service_rsa_bits.rbs b/sig/zitadel/client/models/web_key_service_rsa_bits.rbs new file mode 100644 index 00000000..30de07ba --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_rsa_bits.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class WebKeyServiceRSABits + RSA_BITS_UNSPECIFIED: String + RSA_BITS_2048: String + RSA_BITS_3072: String + RSA_BITS_4096: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/web_key_service_rsa_hasher.rbs b/sig/zitadel/client/models/web_key_service_rsa_hasher.rbs new file mode 100644 index 00000000..3ce670df --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_rsa_hasher.rbs @@ -0,0 +1,11 @@ +module Zitadel::Client::Models + class WebKeyServiceRSAHasher + RSA_HASHER_UNSPECIFIED: String + RSA_HASHER_SHA256: String + RSA_HASHER_SHA384: String + RSA_HASHER_SHA512: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/web_key_service_state.rbs b/sig/zitadel/client/models/web_key_service_state.rbs new file mode 100644 index 00000000..0ac5acaf --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_state.rbs @@ -0,0 +1,12 @@ +module Zitadel::Client::Models + class WebKeyServiceState + STATE_UNSPECIFIED: String + STATE_INITIAL: String + STATE_ACTIVE: String + STATE_INACTIVE: String + STATE_REMOVED: String + VALUES: Array[String] + def self.all_vars: () -> Array[String] + def self.validate!: (String?) -> String? + end +end diff --git a/sig/zitadel/client/models/web_key_service_web_key.rbs b/sig/zitadel/client/models/web_key_service_web_key.rbs new file mode 100644 index 00000000..84218559 --- /dev/null +++ b/sig/zitadel/client/models/web_key_service_web_key.rbs @@ -0,0 +1,15 @@ +module Zitadel::Client::Models + class WebKeyServiceWebKey < Dry::Struct + ATTRIBUTE_MAP: Hash[Symbol, String] + JSON_KEY_MAP: Hash[String, Symbol] + OPENAPI_TYPES: Hash[Symbol, String] + OPENAPI_FORMATS: Hash[Symbol, String] + attr_reader id: String? + attr_reader creation_date: Time? + attr_reader change_date: Time? + attr_reader state: WebKeyServiceState? + attr_reader ecdsa: WebKeyServiceECDSA? + attr_reader ed25519: untyped? + attr_reader rsa: WebKeyServiceRSA? + end +end diff --git a/spec/auth/use_access_token_spec.rb b/spec/auth/use_access_token_spec.rb index 5df31a04..52400e1b 100644 --- a/spec/auth/use_access_token_spec.rb +++ b/spec/auth/use_access_token_spec.rb @@ -16,17 +16,16 @@ # guarantee a clean, stateless call. class UseAccessTokenSpec < BaseSpec it 'retrieves general settings with valid token' do - client = Zitadel::Client::Zitadel.with_access_token(@base_url, @auth_token) - client.settings.get_general_settings + authenticator = Zitadel::Client::Auth::PersonalAccessTokenAuthenticator.new(@base_url, @auth_token) + client = Zitadel::Client::Zitadel.with_authenticator(authenticator) + client.settings_service.get_general_settings({}) end it 'raises an ApiError with invalid token' do - client = Zitadel::Client::Zitadel.with_access_token( - @base_url, - 'invalid' - ) + authenticator = Zitadel::Client::Auth::PersonalAccessTokenAuthenticator.new(@base_url, 'invalid') + client = Zitadel::Client::Zitadel.with_authenticator(authenticator) assert_raises(Zitadel::Client::ZitadelError) do - client.settings.get_general_settings + client.settings_service.get_general_settings({}) end end end diff --git a/spec/auth/use_client_credentials_spec.rb b/spec/auth/use_client_credentials_spec.rb index acbd7086..6830f685 100644 --- a/spec/auth/use_client_credentials_spec.rb +++ b/spec/auth/use_client_credentials_spec.rb @@ -18,78 +18,85 @@ # Each test runs in isolation: the client is instantiated in each example to # guarantee a clean, stateless call. class UseClientCredentialsSpec < BaseSpec - # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity - def generate_user_secret(token, login_name = 'api-user') - user_id_uri = URI("http://localhost:8099/management/v1/global/users/_by_login_name?loginName=#{URI.encode_www_form_component(login_name)}") - - # noinspection RubyMismatchedArgumentType - user_id_http = Net::HTTP.new(user_id_uri.host, user_id_uri.port) - user_id_request = Net::HTTP::Get.new(user_id_uri) - user_id_request['Authorization'] = "Bearer #{token}" - user_id_request['Accept'] = 'application/json' + # Built from the dynamically discovered base URL of the Zitadel service. + def management_base + "#{@base_url}/management/v1" + end - user_id_response = user_id_http.request(user_id_request) + def generate_user_secret(token, login_name = 'api-user') + user_id = lookup_user_id(token, login_name) + create_secret(token, user_id) + end - unless user_id_response.is_a?(Net::HTTPSuccess) - raise "API call to retrieve user failed for login name: '#{login_name}'. Response: #{user_id_response.body}" + # Resolves the user id for a login name via the management API. + def lookup_user_id(token, login_name) + query = URI.encode_www_form_component(login_name) + uri = URI("#{management_base}/global/users/_by_login_name?loginName=#{query}") + response = get_json(uri, token) + unless response.is_a?(Net::HTTPSuccess) + raise "API call to retrieve user failed for login name: '#{login_name}'. Response: #{response.body}" end - user_response_map = JSON.parse(user_id_response.body) - user_id = user_response_map.dig('user', 'id') - - if user_id && !user_id.empty? - secret_uri = URI("http://localhost:8099/management/v1/users/#{user_id}/secret") - - # noinspection RubyMismatchedArgumentType - secret_http = Net::HTTP.new(secret_uri.host, secret_uri.port) - secret_request = Net::HTTP::Put.new(secret_uri) - secret_request['Authorization'] = "Bearer #{token}" - secret_request['Content-Type'] = 'application/json' - secret_request['Accept'] = 'application/json' - secret_request.body = '{}' + user_id = JSON.parse(response.body).dig('user', 'id') + return user_id if user_id && !user_id.empty? - secret_response = secret_http.request(secret_request) + puts response.body + raise "Could not parse a valid user ID from API response for login name: '#{login_name}'." + end - unless secret_response.is_a?(Net::HTTPSuccess) - raise "API call to generate secret failed for user ID: '#{user_id}'. Response: #{secret_response.body}" - end + # Generates and returns a client-credentials secret for the given user id. + def create_secret(token, user_id) + response = put_json(URI("#{management_base}/users/#{user_id}/secret"), token) + unless response.is_a?(Net::HTTPSuccess) + raise "API call to generate secret failed for user ID: '#{user_id}'. Response: #{response.body}" + end - secret_data = JSON.parse(secret_response.body) - client_id = secret_data['clientId'] - client_secret = secret_data['clientSecret'] + data = JSON.parse(response.body) + client_id = data['clientId'] + client_secret = data['clientSecret'] + return { clientId: client_id, clientSecret: client_secret } if present?(client_id) && present?(client_secret) - if client_id && !client_id.empty? && client_secret && !client_secret.empty? - return { clientId: client_id, clientSecret: client_secret } - end + puts response.body + raise "API response for secret is missing 'clientId' or 'clientSecret'." + end - puts secret_response.body - raise "API response for secret is missing 'clientId' or 'clientSecret'." + def present?(value) + value && !value.empty? + end - else - puts user_id_response.body - raise "Could not parse a valid user ID from API response for login name: '#{login_name}'." - end + # noinspection RubyMismatchedArgumentType + def get_json(uri, token) + request = Net::HTTP::Get.new(uri) + request['Authorization'] = "Bearer #{token}" + request['Accept'] = 'application/json' + Net::HTTP.new(uri.host, uri.port).request(request) end - # rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity + # noinspection RubyMismatchedArgumentType + def put_json(uri, token) + request = Net::HTTP::Put.new(uri) + request['Authorization'] = "Bearer #{token}" + request['Content-Type'] = 'application/json' + request['Accept'] = 'application/json' + request.body = '{}' + Net::HTTP.new(uri.host, uri.port).request(request) + end it 'retrieves general settings with valid credentials' do credentials = generate_user_secret(@auth_token, 'api-user') - client = Zitadel::Client::Zitadel.with_client_credentials( - @base_url, - credentials[:clientId], - credentials[:clientSecret] - ) - client.settings.get_general_settings + authenticator = Zitadel::Client::Auth::ClientCredentialsAuthenticator + .builder(@base_url, credentials.fetch(:clientId), credentials.fetch(:clientSecret)) + .build + client = Zitadel::Client::Zitadel.with_authenticator(authenticator) + client.settings_service.get_general_settings({}) end it 'raises an ApiError with invalid credentials' do - client = Zitadel::Client::Zitadel.with_client_credentials( - @base_url, - 'invalid', - 'invalid' - ) + authenticator = Zitadel::Client::Auth::ClientCredentialsAuthenticator + .builder(@base_url, 'invalid', 'invalid') + .build + client = Zitadel::Client::Zitadel.with_authenticator(authenticator) assert_raises(Zitadel::Client::ZitadelError) do - client.settings.get_general_settings + client.settings_service.get_general_settings({}) end end end diff --git a/spec/auth/use_private_key_spec.rb b/spec/auth/use_private_key_spec.rb index 7514ffcb..e67842e6 100644 --- a/spec/auth/use_private_key_spec.rb +++ b/spec/auth/use_private_key_spec.rb @@ -17,17 +17,16 @@ # guarantee a clean, stateless call. class UsePrivateKeySpec < BaseSpec it 'retrieves general settings with valid private key' do - client = Zitadel::Client::Zitadel.with_private_key(@base_url, @jwt_key) - client.settings.get_general_settings + authenticator = Zitadel::Client::Auth::WebTokenAuthenticator.from_json(@base_url, @jwt_key) + client = Zitadel::Client::Zitadel.with_authenticator(authenticator) + client.settings_service.get_general_settings({}) end it 'raises an ApiError with invalid private key' do - client = Zitadel::Client::Zitadel.with_private_key( - 'https://zitadel.cloud', - @jwt_key - ) + authenticator = Zitadel::Client::Auth::WebTokenAuthenticator.from_json('https://zitadel.cloud', @jwt_key) + client = Zitadel::Client::Zitadel.with_authenticator(authenticator) assert_raises(Zitadel::Client::ZitadelError) do - client.settings.get_general_settings + client.settings_service.get_general_settings({}) end end end diff --git a/spec/base_spec.rb b/spec/base_spec.rb index 6d0f663f..6f5fa46a 100644 --- a/spec/base_spec.rb +++ b/spec/base_spec.rb @@ -25,11 +25,17 @@ class BaseSpec < Minitest::Spec # This method brings up the Docker Compose stack before each test run, # waits for the services to initialize, and loads necessary data such as # authentication tokens and JWT keys into instance variables. - # rubocop:disable Metrics/MethodLength def setup_docker_compose @compose_file_path = File.join(File.dirname(__FILE__), '..', 'etc', 'docker-compose.yaml') raise 'docker-compose file not found!' unless File.exist?(@compose_file_path) + compose_up + sleep 20 + load_credentials + end + + # Brings the Docker Compose stack up in detached mode. + def compose_up command = [ 'docker', 'compose', '--file', @compose_file_path, 'up', '--detach', '--no-color', '--quiet-pull', '--yes' @@ -38,9 +44,30 @@ def setup_docker_compose raise "Failed to bring up Docker Compose stack. Error: #{result}" unless $CHILD_STATUS.success? LOGGER.info('Docker Compose stack is up.') - sleep 20 + end + + # Discovers the base URL of the Zitadel service by asking Docker Compose + # for the host port that was ephemerally mapped to the container's port + # 8080. This avoids relying on a hardcoded host port. + def discover_base_url + command = [ + 'docker', 'compose', '--file', @compose_file_path, + 'port', 'zitadel', '8080' + ] + mapping = `#{command.join(' ')}`.strip + raise "Failed to discover mapped port for zitadel service. Error: #{mapping}" unless $CHILD_STATUS.success? + + # Output is of the form "host:port", e.g. "0.0.0.0:54321". + port = mapping.split(':').last + raise "Could not parse mapped port from Docker Compose output: #{mapping}" unless port =~ /\A\d+\z/ + + "http://localhost:#{port}" + end - @base_url = 'http://localhost:8099' + # Loads the base URL, PAT and service-account key produced by the stack. + def load_credentials + @base_url = discover_base_url + LOGGER.info("Exposed BASE_URL as: #{@base_url}") @auth_token = load_file_content_into_property('zitadel_output/pat.txt', 'auth_token') jwt_key_path = File.join(File.dirname(__FILE__), '..', 'etc', 'zitadel_output', 'sa-key.json') @@ -49,7 +76,6 @@ def setup_docker_compose @jwt_key = jwt_key_path LOGGER.info("Loaded JWT_KEY path: #{@jwt_key}") end - # rubocop:enable Metrics/MethodLength # Tear down the Docker Compose environment # diff --git a/spec/check_session_service_spec.rb b/spec/check_session_service_spec.rb index b8237f4b..8ef30469 100644 --- a/spec/check_session_service_spec.rb +++ b/spec/check_session_service_spec.rb @@ -21,7 +21,8 @@ class SessionServiceSanityCheckSpec < BaseSpec def client - Zitadel::Client::Zitadel.with_access_token(@base_url, @auth_token) + authenticator = Zitadel::Client::Auth::PersonalAccessTokenAuthenticator.new(@base_url, @auth_token) + Zitadel::Client::Zitadel.with_authenticator(authenticator) end before do @@ -37,7 +38,7 @@ def client ) ) - @user = client.users.add_human_user(request) + @user = client.user_service.add_human_user(request) request = Zitadel::Client::Models::SessionServiceCreateSessionRequest.new( checks: Zitadel::Client::Models::SessionServiceChecks.new( user: Zitadel::Client::Models::SessionServiceCheckUser.new( @@ -46,41 +47,42 @@ def client ), lifetime: '18000s' ) - resp = client.sessions.create_session(request) + resp = client.session_service.create_session(request) @session_id = resp.session_id @session_token = resp.session_token end after do request = Zitadel::Client::Models::SessionServiceDeleteSessionRequest.new(session_id: @session_id) - client.sessions.delete_session(request) + client.session_service.delete_session(request) rescue StandardError # Ignore cleanup errors end it 'retrieves the session details by the session identifier' do - request = Zitadel::Client::Models::SessionServiceGetSessionRequest.new(session_id: @session_id, session_token: @session_token) - response = client.sessions.get_session(request) - _(response.session.id).must_equal @session_id + request = Zitadel::Client::Models::SessionServiceGetSessionRequest.new(session_id: @session_id, + session_token: @session_token) + response = client.session_service.get_session(request) + _(response.session&.id).must_equal @session_id end it 'raises an error when retrieving a non-existent session' do request = Zitadel::Client::Models::SessionServiceGetSessionRequest.new(session_id: SecureRandom.uuid, session_token: @session_token) assert_raises(Zitadel::Client::ApiError) do - client.sessions.get_session(request) + client.session_service.get_session(request) end end it 'includes the created session when listing all sessions' do request = Zitadel::Client::Models::SessionServiceListSessionsRequest.new(queries: []) - response = client.sessions.list_sessions(request) - _(response.sessions.map(&:id)).must_include @session_id + response = client.session_service.list_sessions(request) + _(response.sessions&.map(&:id)).must_include @session_id end it 'updates the session lifetime and returns a new token' do request = Zitadel::Client::Models::SessionServiceSetSessionRequest.new(session_id: @session_id, lifetime: '36000s') - response = client.sessions.set_session(request) + response = client.session_service.set_session(request) _(response.session_token).must_be_instance_of String end end diff --git a/spec/check_user_service_spec.rb b/spec/check_user_service_spec.rb index efc2eb66..3f3b81b2 100644 --- a/spec/check_user_service_spec.rb +++ b/spec/check_user_service_spec.rb @@ -21,7 +21,8 @@ class UserServiceSanityCheckSpec < BaseSpec def client - Zitadel::Client::Zitadel.with_access_token(@base_url, @auth_token) + authenticator = Zitadel::Client::Auth::PersonalAccessTokenAuthenticator.new(@base_url, @auth_token) + Zitadel::Client::Zitadel.with_authenticator(authenticator) end before do @@ -36,30 +37,32 @@ def client ) ) - @user = client.users.add_human_user(request) + @user = client.user_service.add_human_user(request) end after do - client.users.delete_user(Zitadel::Client::Models::UserServiceDeleteUserRequest.new(user_id: @user.user_id)) + client.user_service.delete_user(Zitadel::Client::Models::UserServiceDeleteUserRequest.new(user_id: @user.user_id)) rescue StandardError # Ignore cleanup errors end it 'retrieves the user details by ID' do - response = client.users.get_user_by_id(Zitadel::Client::Models::UserServiceGetUserByIDRequest.new(user_id: @user.user_id)) - _(response.user.user_id).must_equal @user.user_id + request = Zitadel::Client::Models::UserServiceGetUserByIDRequest.new(user_id: @user.user_id) + response = client.user_service.get_user_by_id(request) + _(response.user&.user_id).must_equal @user.user_id end it 'raises an error when retrieving a non-existent user' do + request = Zitadel::Client::Models::UserServiceGetUserByIDRequest.new(user_id: SecureRandom.uuid) assert_raises(Zitadel::Client::ApiError) do - client.users.get_user_by_id(Zitadel::Client::Models::UserServiceGetUserByIDRequest.new(user_id: SecureRandom.uuid)) + client.user_service.get_user_by_id(request) end end it 'includes the created user when listing all users' do request = Zitadel::Client::Models::UserServiceListUsersRequest.new(queries: []) - response = client.users.list_users(request) - _(response.result.map(&:user_id)).must_include @user.user_id + response = client.user_service.list_users(request) + _(response.result&.map(&:user_id)).must_include @user.user_id end it "updates the user's email and reflects the change" do @@ -68,9 +71,11 @@ def client user_id: @user.user_id, email: Zitadel::Client::Models::UserServiceSetHumanEmail.new(email: new_email) ) - client.users.update_human_user(update_req) + client.user_service.update_human_user(update_req) - response = client.users.get_user_by_id(Zitadel::Client::Models::UserServiceGetUserByIDRequest.new(user_id: @user.user_id)) - _(response.user.human.email.email).must_equal new_email + get_req = Zitadel::Client::Models::UserServiceGetUserByIDRequest.new(user_id: @user.user_id) + response = client.user_service.get_user_by_id(get_req) + human = response.user&.human + _(human&.email&.email).must_equal new_email end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8e880dd3..3f44cb1e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -16,13 +16,11 @@ # Override the HTMLFormatter so that it writes its report inside build/coverage/html module SimpleCov module Formatter - # rubocop:disable Style/Documentation module HTMLFormatterPatch def output_path File.join(SimpleCov.coverage_path, 'html') end end - # rubocop:enable Style/Documentation class HTMLFormatter prepend HTMLFormatterPatch @@ -51,50 +49,43 @@ class HTMLFormatter module Minitest module Reporters - # rubocop:disable Metrics/AbcSize,Style/Documentation,Metrics/MethodLength class JUnitReporter private def parse_xml_for(xml, suite, tests) - suite_result = analyze_suite(tests) file_path = get_relative_path(tests.first) + attributes = testsuite_attributes(suite, tests, file_path) - testsuite_attributes = { - name: suite, - file: file_path, - skipped: suite_result[:skip_count], - failures: suite_result[:fail_count], - errors: suite_result[:error_count], - tests: suite_result[:test_count], - assertions: suite_result[:assertion_count], - time: suite_result[:time], - timestamp: Time.now.iso8601, - hostname: Socket.gethostname + # noinspection RubyResolve + xml.testsuite(attributes) do + tests.each { |test| emit_testcase(xml, suite, file_path, test) } + end + end + + def testsuite_attributes(suite, tests, file_path) + result = analyze_suite(tests) + attrs = { + name: suite, file: file_path, + skipped: result[:skip_count], failures: result[:fail_count], + errors: result[:error_count], tests: result[:test_count], + assertions: result[:assertion_count], time: result[:time], + timestamp: Time.now.iso8601, hostname: Socket.gethostname } - testsuite_attributes[:timestamp] = suite_result[:timestamp] if @timestamp_report + attrs[:timestamp] = result[:timestamp] if @timestamp_report + attrs + end + def emit_testcase(xml, suite, file_path, test) # noinspection RubyResolve - xml.testsuite(testsuite_attributes) do - tests.each do |test| - line = get_source_location(test).last - # noinspection RubyResolve - xml.testcase( - name: test.name, - line: line, - classname: suite, - assertions: test.assertions, - time: test.time, - file: file_path - ) do - xml << xml_message_for(test) unless test.passed? - xml << xml_attachment_for(test) if test.respond_to?('metadata') && test.metadata[:failure_screenshot_path] - end - end + xml.testcase( + name: test.name, line: get_source_location(test).last, classname: suite, + assertions: test.assertions, time: test.time, file: file_path + ) do + xml << xml_message_for(test) unless test.passed? + xml << xml_attachment_for(test) if test.respond_to?('metadata') && test.metadata[:failure_screenshot_path] end end end - - # rubocop:enable Metrics/AbcSize,Style/Documentation,Metrics/MethodLength end end diff --git a/test/configuration_test.rb b/test/configuration_test.rb new file mode 100644 index 00000000..b045e05d --- /dev/null +++ b/test/configuration_test.rb @@ -0,0 +1,216 @@ +# frozen_string_literal: true +# rubocop:disable all + +require 'test_helper' + +describe Zitadel::Client::Configuration do + before do + @saved_default = Zitadel::Client::Configuration.default + Zitadel::Client::Configuration.default = Zitadel::Client::Configuration.builder.build + end + + after do + Zitadel::Client::Configuration.default = @saved_default + end + + it 'builder produces correct defaults' do + config = Zitadel::Client::Configuration.builder.build + + _(config.base_url).must_equal('https://zitadel.com') + _(config.default_headers).must_equal({}) + end + + it 'builder returns Builder instance' do + builder = Zitadel::Client::Configuration.builder + + _(builder).must_be_instance_of(Zitadel::Client::Configuration::Builder) + end + + it 'builder sets base_url' do + config = Zitadel::Client::Configuration.builder + .base_url('https://custom.example.com') + .build + + _(config.base_url).must_equal('https://custom.example.com') + end + + it 'builder sets single default header' do + config = Zitadel::Client::Configuration.builder + .default_header('Authorization', 'Bearer token123') + .build + + _(config.default_headers).must_equal({ 'Authorization' => 'Bearer token123' }) + end + + it 'builder sets multiple default headers' do + config = Zitadel::Client::Configuration.builder + .default_headers({ + 'Authorization' => 'Bearer token123', + 'X-Custom' => 'value' + }) + .build + + _(config.default_headers).must_equal({ + 'Authorization' => 'Bearer token123', + 'X-Custom' => 'value' + }) + end + + it 'builder accumulates headers' do + config = Zitadel::Client::Configuration.builder + .default_header('X-First', 'one') + .default_header('X-Second', 'two') + .default_headers({ 'X-Third' => 'three' }) + .build + + _(config.default_headers.size).must_equal(3) + _(config.default_headers['X-First']).must_equal('one') + _(config.default_headers['X-Second']).must_equal('two') + _(config.default_headers['X-Third']).must_equal('three') + end + + it 'builder sets all fields' do + config = Zitadel::Client::Configuration.builder + .base_url('https://api.example.com') + .default_header('Authorization', 'Bearer token') + .default_headers({ 'X-Custom' => 'value' }) + .build + + _(config.base_url).must_equal('https://api.example.com') + _(config.default_headers).must_equal({ + 'Authorization' => 'Bearer token', + 'X-Custom' => 'value' + }) + end + + it 'server resolves URL with default variables' do + server = Zitadel::Client::ServerConfiguration.new( + url_template: 'https://{env}.example.com/api/{version}', + description: 'Test server', + variables: { + 'env' => Zitadel::Client::ServerVariable.new( + default_value: 'api', + enum_values: %w[api staging] + ), + 'version' => Zitadel::Client::ServerVariable.new( + default_value: 'v3', + enum_values: %w[v2 v3] + ) + } + ) + + config = Zitadel::Client::Configuration.builder + .server(server) + .build + + _(config.base_url).must_equal('https://api.example.com/api/v3') + end + + it 'server resolves URL with variable overrides' do + server = Zitadel::Client::ServerConfiguration.new( + url_template: 'https://{env}.example.com/api/{version}', + variables: { + 'env' => Zitadel::Client::ServerVariable.new( + default_value: 'api', + enum_values: %w[api staging] + ), + 'version' => Zitadel::Client::ServerVariable.new( + default_value: 'v3', + enum_values: %w[v2 v3] + ) + } + ) + + config = Zitadel::Client::Configuration.builder + .server(server, { 'env' => 'staging', 'version' => 'v2' }) + .build + + _(config.base_url).must_equal('https://staging.example.com/api/v2') + end + + it 'invalid enum value raises' do + server = Zitadel::Client::ServerConfiguration.new( + url_template: 'https://{env}.example.com', + variables: { + 'env' => Zitadel::Client::ServerVariable.new( + default_value: 'api', + enum_values: %w[api staging] + ) + } + ) + + _(proc { + Zitadel::Client::Configuration.builder + .server(server, { 'env' => 'invalid' }) + .build + }).must_raise(ArgumentError) + end + + it 'base_url overrides server' do + server = Zitadel::Client::ServerConfiguration.new( + url_template: 'https://api.example.com' + ) + + config = Zitadel::Client::Configuration.builder + .server(server) + .base_url('https://override.example.com') + .build + + _(config.base_url).must_equal('https://override.example.com') + end + + it 'default returns an instance' do + config = Zitadel::Client::Configuration.default + + _(config).must_be_instance_of(Zitadel::Client::Configuration) + _(config.base_url).must_equal('https://zitadel.com') + end + + it 'default returns the same instance' do + first = Zitadel::Client::Configuration.default + second = Zitadel::Client::Configuration.default + + _(first).must_be_same_as(second) + end + + it 'setting default changes the default' do + custom = Zitadel::Client::Configuration.builder + .base_url('https://custom.example.com') + .build + + Zitadel::Client::Configuration.default = custom + + _(Zitadel::Client::Configuration.default).must_be_same_as(custom) + _(Zitadel::Client::Configuration.default.base_url).must_equal('https://custom.example.com') + end + + it 'builder produces independent instances' do + builder = Zitadel::Client::Configuration.builder + .base_url('https://example.com') + first = builder.build + second = builder.build + + _(first).wont_be_same_as(second) + _(first.base_url).must_equal(second.base_url) + end + + it 'configuration is frozen' do + config = Zitadel::Client::Configuration.builder + .default_header('X-Key', 'value') + .build + + _(config).must_be(:frozen?) + _(config.default_headers).must_be(:frozen?) + end + + it 'builder is fluent' do + builder = Zitadel::Client::Configuration.builder + + _(builder.base_url('https://example.com')).must_be_same_as(builder) + _(builder.default_header('X-Key', 'value')).must_be_same_as(builder) + _(builder.default_headers({ 'X-Other' => 'val' })).must_be_same_as(builder) + + server = Zitadel::Client::ServerConfiguration.new(url_template: 'https://example.com') + _(builder.server(server)).must_be_same_as(builder) + end +end diff --git a/test/default_api_client_unit_test.rb b/test/default_api_client_unit_test.rb new file mode 100644 index 00000000..7f3cdc8e --- /dev/null +++ b/test/default_api_client_unit_test.rb @@ -0,0 +1,775 @@ +# frozen_string_literal: true +# rubocop:disable all + +require 'minitest/autorun' +require 'json' +require 'stringio' +require 'zlib' +require 'zitadel-client' + +describe Zitadel::Client::DefaultApiClient do + parallelize_me! + + def stub_connection(stubs) + Faraday.new('http://localhost') { |f| f.adapter :test, stubs } + end + + it 'sends GET request and returns response' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/echo') { [200, { 'content-type' => 'application/json' }, '{"method":"GET"}'] } + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/echo', {}, nil) + _(response.status_code).must_equal 200 + body = JSON.parse(response.body) + _(body['method']).must_equal 'GET' + end + stubs.verify_stubbed_calls + end + + it 'sends POST with JSON body' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/echo') { [200, {}, '{"method":"POST","body":"{key}"}'] } + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + headers = { 'Content-Type' => 'application/json' } + response = client.send_request('POST', 'http://localhost/echo', headers, '{"key":"value"}') + _(response.status_code).must_equal 200 + _(response.body).must_include 'POST' + _(response.body).must_include 'key' + end + stubs.verify_stubbed_calls + end + + it 'returns response headers' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/echo') { [200, { 'x-test-header' => 'test-value' }, 'ok'] } + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/echo', {}, nil) + _(response.headers['x-test-header']).must_equal 'test-value' + end + stubs.verify_stubbed_calls + end + + it 'returns non-2xx status code' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/not-found') { [404, {}, 'not found'] } + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/not-found', {}, nil) + _(response.status_code).must_equal 404 + _(response.body).must_equal 'not found' + end + stubs.verify_stubbed_calls + end + + it 'sends PUT request' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.put('/echo') { [200, {}, '{"method":"PUT"}'] } + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('PUT', 'http://localhost/echo', {}, 'update') + _(response.status_code).must_equal 200 + _(response.body).must_include 'PUT' + end + stubs.verify_stubbed_calls + end + + it 'sends DELETE request' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.delete('/echo') { [200, {}, '{"method":"DELETE"}'] } + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('DELETE', 'http://localhost/echo', {}, nil) + _(response.status_code).must_equal 200 + _(response.body).must_include 'DELETE' + end + stubs.verify_stubbed_calls + end + + it 'returns JSON body for vendor JSON content type' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/vendor-json') do + [200, { 'content-type' => 'application/vnd.api+json' }, '{"format":"vendor"}'] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/vendor-json', {}, nil) + _(response.status_code).must_equal 200 + body = JSON.parse(response.body) + _(body['format']).must_equal 'vendor' + end + stubs.verify_stubbed_calls + end + + it 'joins multi-value response headers' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/multi-header') do + [200, { 'x-custom-value' => 'val1, val2' }, 'ok'] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/multi-header', {}, nil) + _(response.status_code).must_equal 200 + _(response.headers['x-custom-value']).must_include 'val1' + _(response.headers['x-custom-value']).must_include 'val2' + end + stubs.verify_stubbed_calls + end + + it 'injects custom User-Agent header' do + captured_ua = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/test') do |env| + captured_ua = env.request_headers['User-Agent'] + [200, {}, '{}'] + end + end + transport = Zitadel::Client::TransportOptions.builder.user_agent('MyApp/1.0').build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('GET', 'http://localhost/test', {}, nil) + end + _(captured_ua).must_equal 'MyApp/1.0' + stubs.verify_stubbed_calls + end + + it 'injects default User-Agent when not explicitly set' do + captured_ua = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/test') do |env| + captured_ua = env.request_headers['User-Agent'] + [200, {}, '{}'] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('GET', 'http://localhost/test', {}, nil) + end + _(captured_ua).wont_be_nil + _(captured_ua).wont_be_empty + stubs.verify_stubbed_calls + end + + it 'injects X-Request-ID when enabled' do + captured_id = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/test') do |env| + captured_id = env.request_headers['X-Request-ID'] + [200, {}, '{}'] + end + end + transport = Zitadel::Client::TransportOptions.builder.inject_request_id(true).build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('GET', 'http://localhost/test', {}, nil) + end + _(captured_id).wont_be_nil + _(captured_id).must_match(/\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/) + stubs.verify_stubbed_calls + end + + it 'does not inject X-Request-ID when disabled' do + captured_headers = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/test') do |env| + captured_headers = env.request_headers + [200, {}, '{}'] + end + end + transport = Zitadel::Client::TransportOptions.builder.inject_request_id(false).build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('GET', 'http://localhost/test', {}, nil) + end + _(captured_headers).wont_be_nil + _(captured_headers.key?('X-Request-ID')).must_equal false + stubs.verify_stubbed_calls + end + + it 'does not override caller-provided X-Request-ID' do + captured_id = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/test') do |env| + captured_id = env.request_headers['X-Request-ID'] + [200, {}, '{}'] + end + end + transport = Zitadel::Client::TransportOptions.builder.inject_request_id(true).build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('GET', 'http://localhost/test', { 'X-Request-ID' => 'caller-id' }, nil) + end + _(captured_id).must_equal 'caller-id' + stubs.verify_stubbed_calls + end + + it 'generates unique X-Request-ID per request' do + captured_ids = [] + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/test') do |env| + captured_ids << env.request_headers['X-Request-ID'] + [200, {}, '{}'] + end + stub.get('/test') do |env| + captured_ids << env.request_headers['X-Request-ID'] + [200, {}, '{}'] + end + end + transport = Zitadel::Client::TransportOptions.builder.inject_request_id(true).build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('GET', 'http://localhost/test', {}, nil) + client.send_request('GET', 'http://localhost/test', {}, nil) + end + _(captured_ids.length).must_equal 2 + _(captured_ids[0]).wont_equal captured_ids[1] + end + + it 'includes transport-level default headers' do + captured_value = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/test') do |env| + captured_value = env.request_headers['X-Custom'] + [200, {}, '{}'] + end + end + transport = Zitadel::Client::TransportOptions.builder.default_header('X-Custom', 'custom-value').build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('GET', 'http://localhost/test', {}, nil) + end + _(captured_value).must_equal 'custom-value' + stubs.verify_stubbed_calls + end + + it 'caller headers override transport default headers' do + captured_accept = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/test') do |env| + captured_accept = env.request_headers['Accept'] + [200, {}, '{}'] + end + end + transport = Zitadel::Client::TransportOptions.builder.default_header('Accept', 'text/plain').build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('GET', 'http://localhost/test', { 'Accept' => 'application/json' }, nil) + end + _(captured_accept).must_equal 'application/json' + stubs.verify_stubbed_calls + end + + # ── Multipart filename sanitization (Gap F) ── + + it 'rejects multipart filename containing CRLF (header injection)' do + require 'stringio' + client = Zitadel::Client::DefaultApiClient.new + io = StringIO.new('payload') + io.define_singleton_method(:path) { "a\r\nX-Injected: yes" } + assert_raises(ArgumentError) do + client.send_request('POST', 'http://localhost/upload', {}, { 'file' => io }) + end + end + + it 'rejects multipart filename containing NUL byte' do + require 'stringio' + client = Zitadel::Client::DefaultApiClient.new + io = StringIO.new('payload') + io.define_singleton_method(:path) { "a\0b.txt" } + assert_raises(ArgumentError) do + client.send_request('POST', 'http://localhost/upload', {}, { 'file' => io }) + end + end + + it 'backslash-escapes quotes and backslashes in multipart filename' do + captured_body = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/upload') do |env| + captured_body = env.body + [200, {}, '{}'] + end + end + require 'stringio' + io = StringIO.new('payload') + io.define_singleton_method(:path) { 'a"b.txt' } + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('POST', 'http://localhost/upload', {}, { 'file' => io }) + end + _(captured_body.to_s).must_include 'filename="a\\"b.txt"' + stubs.verify_stubbed_calls + end + + it 'emits RFC 5987 filename* for non-ASCII multipart filenames' do + captured_body = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/upload') do |env| + captured_body = env.body + [200, {}, '{}'] + end + end + require 'stringio' + io = StringIO.new('payload') + io.define_singleton_method(:path) { '日本.pdf' } + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('POST', 'http://localhost/upload', {}, { 'file' => io }) + end + body_str = captured_body.to_s.dup.force_encoding(Encoding::ASCII_8BIT) + _(body_str).must_include "filename*=UTF-8''%E6%97%A5%E6%9C%AC.pdf" + stubs.verify_stubbed_calls + end + + # ── Non-ASCII multipart field name preserved as UTF-8 (canonical #5) ── + # + # A multipart form field NAME containing non-ASCII characters must be + # emitted verbatim as UTF-8 bytes in the Content-Disposition `name="..."` + # parameter — not transliterated to '?', not stripped to ASCII. The field + # name is interpolated raw (after CR/LF/NUL rejection and quote escaping) + # and the part is built as binary, so the UTF-8 bytes survive intact. + it 'preserves a non-ASCII multipart field name as UTF-8' do + captured_body = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/upload') do |env| + captured_body = env.body + [200, {}, '{}'] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + # 'café' is a plain scalar form field whose NAME is non-ASCII. + client.send_request('POST', 'http://localhost/upload', {}, { 'café' => 'value' }) + end + body_str = captured_body.to_s.dup.force_encoding(Encoding::UTF_8) + _(body_str).must_include 'name="café"' + # The raw UTF-8 bytes for 'é' (0xC3 0xA9) must be present unmangled. + body_bytes = captured_body.to_s.dup.force_encoding(Encoding::ASCII_8BIT) + _(body_bytes).must_include 'caf'.b + "\xC3\xA9".b + _(body_bytes).wont_include 'name="caf?"'.b + stubs.verify_stubbed_calls + end + + # ── Per-part MIME sniffing (Gap J) ── + + it 'sets image/png Content-Type for .png upload' do + captured_body = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/upload') do |env| + captured_body = env.body + [200, {}, '{}'] + end + end + require 'stringio' + io = StringIO.new("\x89PNG\r\n".b) + io.define_singleton_method(:path) { 'pic.png' } + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('POST', 'http://localhost/upload', {}, { 'file' => io }) + end + _(captured_body.to_s).must_include 'Content-Type: image/png' + stubs.verify_stubbed_calls + end + + it 'sets application/pdf for .pdf upload' do + captured_body = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/upload') do |env| + captured_body = env.body + [200, {}, '{}'] + end + end + require 'stringio' + io = StringIO.new('PDF-bytes') + io.define_singleton_method(:path) { 'doc.pdf' } + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('POST', 'http://localhost/upload', {}, { 'file' => io }) + end + _(captured_body.to_s).must_include 'Content-Type: application/pdf' + stubs.verify_stubbed_calls + end + + it 'falls back to application/octet-stream for unknown extension' do + captured_body = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/upload') do |env| + captured_body = env.body + [200, {}, '{}'] + end + end + require 'stringio' + io = StringIO.new('bytes') + io.define_singleton_method(:path) { 'blob.xyzunknown' } + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request('POST', 'http://localhost/upload', {}, { 'file' => io }) + end + _(captured_body.to_s).must_include 'Content-Type: application/octet-stream' + stubs.verify_stubbed_calls + end + + # ── Response charset decoding (Gap H) ── + + it 'decodes ISO-8859-1 response body to UTF-8' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/latin1') do + [200, { 'content-type' => 'text/plain; charset=ISO-8859-1' }, "\xE9".b] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/latin1', {}, nil) + _(response.body.encoding).must_equal Encoding::UTF_8 + _(response.body).must_equal 'é' + end + stubs.verify_stubbed_calls + end + + it 'defaults to UTF-8 when no charset is given' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/no-charset') do + [200, { 'content-type' => 'text/plain' }, 'héllo'] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/no-charset', {}, nil) + _(response.body).must_equal 'héllo' + end + stubs.verify_stubbed_calls + end + + it 'falls back to UTF-8 for unknown charset without raising' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/bogus') do + [200, { 'content-type' => 'text/plain; charset=not-a-real-charset' }, 'hello'] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/bogus', {}, nil) + _(response.body).must_equal 'hello' + end + stubs.verify_stubbed_calls + end + + # ── Proxy authentication (#29) ── + # + # The test fixture Squid config does NOT enable basic auth, so any + # proxy-with-credentials request will succeed at the proxy level just + # like an unauthenticated request. We assert that the userinfo portion + # of the proxy URL is accepted and forwarded to Faraday's proxy config + # without raising; full end-to-end basic-auth verification is skipped + # because the fixture Squid lacks auth_param config. + it 'accepts proxy URL with basic-auth userinfo (skips if Squid lacks auth)' do + skip 'Squid fixture has no auth_param basic configuration' + end + + it 'parses proxy URL with userinfo without raising' do + transport = Zitadel::Client::TransportOptions.builder + .proxy('http://user:pass@proxy.example.com:3128') + .build + _(transport.proxy).must_equal 'http://user:pass@proxy.example.com:3128' + + # Verify Faraday accepts the proxy URL during connection build. + client = Zitadel::Client::DefaultApiClient.new(transport) + conn = client.send(:build_connection) + captured_proxy = conn.proxy + _(captured_proxy).wont_be_nil + _(captured_proxy.user).must_equal 'user' + _(captured_proxy.password).must_equal 'pass' + end + + # ── Bucket 3.2: no_redirect returns the 3xx as-is (does not follow) ── + + it 'returns the 308 verbatim when no_redirect: true' do + follow_up_hit = false + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/token') do + [308, { 'location' => 'https://attacker.example.com/steal' }, ''] + end + stub.post('/steal') do + follow_up_hit = true + [200, {}, ''] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + resp = client.send_request(:POST, 'http://localhost/token', {}, 'grant_type=client_credentials', no_redirect: true) + # The 3xx surfaces to the caller verbatim and the redirect target is + # never hit -- the token manager inspects/rejects the 3xx itself. + _(resp.status_code).must_equal 308 + _(resp.headers['location']).must_equal 'https://attacker.example.com/steal' + _(follow_up_hit).must_equal false + end + end + + it 'returns the 307 verbatim when no_redirect: true' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/token') do + [307, { 'location' => 'https://attacker.example.com/steal' }, ''] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + resp = client.send_request(:POST, 'http://localhost/token', {}, 'client_id=abc&client_secret=xyz', no_redirect: true) + _(resp.status_code).must_equal 307 + end + end + + it 'returns 2xx normally when no_redirect: true and no redirect' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/token') do + [200, { 'content-type' => 'application/json' }, '{"access_token":"ok"}'] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + resp = client.send_request(:POST, 'http://localhost/token', {}, 'grant_type=client_credentials', no_redirect: true) + _(resp.status_code).must_equal 200 + end + end + + # ── Bucket 3.3: refuse body replay on HTTPS -> HTTP downgrade ── + + it 'raises ApiError when 307 redirects HTTPS -> HTTP and there is a body' do + # 307 preserves method+body, so the original POST body would be + # replayed over cleartext on the redirect. The downgrade guard + # MUST refuse rather than leak the body. + call_count = 0 + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/upload') do + call_count += 1 + [307, { 'location' => 'http://insecure.example.com/upload' }, ''] + end + end + transport = Zitadel::Client::TransportOptions.builder.follow_redirects(true).build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + err = assert_raises(Zitadel::Client::ApiError) do + client.send_request(:POST, 'https://localhost/upload', {}, 'secret=payload') + end + _(err.message).must_match(/TLS downgrade/) + end + _(call_count).must_equal 1 + end + + it 'allows HTTPS -> HTTP redirect when method demotes to GET with no body' do + # 302 of a POST demotes to GET and drops the body, so there is no + # body to replay across the downgrade — the guard MUST NOT refuse. + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.post('/r') do + [302, { 'location' => 'http://localhost/landing' }, ''] + end + stub.get('/landing') do + [200, { 'content-type' => 'text/plain' }, 'ok'] + end + end + transport = Zitadel::Client::TransportOptions.builder.follow_redirects(true).build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + resp = client.send_request(:POST, 'https://localhost/r', {}, 'k=v') + _(resp.status_code).must_equal 200 + end + end + + # ── Bucket 3: redirect-exhaustion raises loudly ── + + it 'raises ApiError when the redirect budget is exhausted' do + # The server keeps returning 302s forever. After max_redirects hops + # the client MUST raise an ApiError rather than silently returning the + # last 3xx response as if it were the final answer. + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/loop') do + [302, { 'location' => 'http://localhost/loop' }, ''] + end + end + transport = Zitadel::Client::TransportOptions.builder + .follow_redirects(true) + .max_redirects(2) + .build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + err = assert_raises(Zitadel::Client::ApiError) do + client.send_request(:GET, 'http://localhost/loop', {}, nil) + end + _(err.message).must_match(/redirect/i) + end + end + + # ── Bucket 3: non-http(s) redirect scheme raises loudly ── + + it 'raises ApiError when Location points at a non-http(s) scheme' do + # A Location header pointing at file:/javascript:/data: is an SSRF / + # local-file exfiltration vector. The client MUST refuse loudly with + # an ApiError instead of silently returning the 3xx response. + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/evil') do + [302, { 'location' => 'file:///etc/passwd' }, ''] + end + end + transport = Zitadel::Client::TransportOptions.builder.follow_redirects(true).build + client = Zitadel::Client::DefaultApiClient.new(transport) + client.stub(:build_connection, stub_connection(stubs)) do + err = assert_raises(Zitadel::Client::ApiError) do + client.send_request(:GET, 'http://localhost/evil', {}, nil) + end + _(err.message).must_match(/non-http/i) + end + end + + # ── Bucket 3: use-after-close raises loudly ── + + it 'raises ApiError when send_request is called after close' do + # After #close releases the connection pool the client is dead; a + # subsequent send_request MUST raise an ApiError rather than lazily + # rebuilding a connection (which would make close a silent no-op). + client = Zitadel::Client::DefaultApiClient.new + client.close + err = assert_raises(Zitadel::Client::ApiError) do + client.send_request(:GET, 'http://localhost/echo', {}, nil) + end + _(err.message).must_match(/closed/i) + end + + it 'close is idempotent' do + client = Zitadel::Client::DefaultApiClient.new + client.close + client.close # must not raise + end + + # ── Bucket 3.1: API-key header names included in cross-origin strip set ── + + it 'EXTRA_SENSITIVE_HEADER_NAMES is defined and lowercase' do + # Codegen populates this from `securitySchemes` entries with + # type=apiKey, in=header. Whether the spec under test contains any + # such schemes or not, the constant MUST exist and every entry + # MUST be lowercased so the cross-origin filter compares + # case-insensitively. + names = Zitadel::Client::DefaultApiClient::EXTRA_SENSITIVE_HEADER_NAMES + _(names).must_be_kind_of Array + names.each do |n| + _(n).must_equal n.downcase + end + end + + it 'always strips Authorization/Cookie/Proxy-Authorization on cross-origin redirect (Bucket 3.1)' do + # The static credential trio (authorization, cookie, + # proxy-authorization) is ALWAYS stripped on a cross-origin hop, + # regardless of whether the spec declared any apiKey-in-header + # schemes. A non-sensitive header (X-Trace) must survive the hop so + # we know the strip is targeted, not a blanket wipe. + captured_followup_headers = nil + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/start') do + [302, { 'location' => 'http://otherhost.example.com/landing' }, ''] + end + stub.get('http://otherhost.example.com/landing') do |env| + captured_followup_headers = env.request_headers + [200, { 'content-type' => 'text/plain' }, 'ok'] + end + end + transport = Zitadel::Client::TransportOptions.builder.follow_redirects(true).build + client = Zitadel::Client::DefaultApiClient.new(transport) + headers = { + 'Authorization' => 'Bearer secret', + 'Cookie' => 'session=abc', + 'Proxy-Authorization' => 'Basic Zm9v', + 'X-Trace' => 'keep' + } + client.stub(:build_connection, stub_connection(stubs)) do + client.send_request(:GET, 'http://localhost/start', headers, nil) + end + _(captured_followup_headers).wont_be_nil + lc = captured_followup_headers.transform_keys(&:downcase) + _(lc.key?('authorization')).must_equal false + _(lc.key?('cookie')).must_equal false + _(lc.key?('proxy-authorization')).must_equal false + # Non-sensitive headers must survive the cross-origin hop. + _(lc.key?('x-trace')).must_equal true + end + + # ── Bucket T4: explicit CA cert that cannot be read fails fast ── + # An explicitly configured CA certificate path that cannot be read or parsed + # must fail fast at construction with a typed ApiError rather than silently + # falling back to the system trust store (security theater). + it 'raises ApiError at construction for a non-existent ca_cert_path' do + transport = Zitadel::Client::TransportOptions.builder.ca_cert_path('/nonexistent/ca.pem').build + assert_raises(Zitadel::Client::ApiError) do + Zitadel::Client::DefaultApiClient.new(transport) + end + end + + # ── decompression-error-not-wrapped ── + # A response that advertises Content-Encoding: gzip but carries a malformed + # (non-gzip) body must surface as the SDK's typed ApiError, not a raw + # Zlib::GzipFile::Error leaking from inside the client. Before the fix the + # decompress ran AFTER the rescue block, so the Zlib error escaped. + it 'wraps a malformed Content-Encoding body as ApiError' do + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/gz') do + [200, { 'content-type' => 'application/json', 'content-encoding' => 'gzip' }, 'not-actually-gzip'] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + err = assert_raises(Zitadel::Client::ApiError) do + client.send_request('GET', 'http://localhost/gz', {}, nil) + end + refute_kind_of Zlib::Error, err + end + stubs.verify_stubbed_calls + end + + # Positive path: a correctly gzip-encoded body still decompresses normally. + it 'decompresses a valid gzip-encoded body' do + io = StringIO.new + gz = Zlib::GzipWriter.new(io) + gz.write('{"ok":true}') + gz.close + compressed = io.string + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/gz') do + [200, { 'content-type' => 'application/json', 'content-encoding' => 'gzip' }, compressed] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/gz', {}, nil) + _(JSON.parse(response.body)['ok']).must_equal true + end + stubs.verify_stubbed_calls + end + + # Positive path: a brotli-encoded body decompresses through the `br` branch + # of decompress_body. Deterministic (no external host): the body is brotli- + # compressed in-process via the same gem the client uses to inflate it. + # Skipped when the optional brotli gem is absent (the alpine CI image sets + # BUNDLE_WITHOUT=optional), since there is then nothing to compress with. + it 'decompresses a valid brotli-encoded body' do + skip 'brotli gem not installed (optional group)' unless defined?(Brotli) + + compressed = Brotli.deflate('{"ok":true}') + stubs = Faraday::Adapter::Test::Stubs.new do |stub| + stub.get('/br') do + [200, { 'content-type' => 'application/json', 'content-encoding' => 'br' }, compressed] + end + end + client = Zitadel::Client::DefaultApiClient.new + client.stub(:build_connection, stub_connection(stubs)) do + response = client.send_request('GET', 'http://localhost/br', {}, nil) + _(JSON.parse(response.body)['ok']).must_equal true + end + stubs.verify_stubbed_calls + end +end diff --git a/test/header_selector_test.rb b/test/header_selector_test.rb new file mode 100644 index 00000000..d1fd0006 --- /dev/null +++ b/test/header_selector_test.rb @@ -0,0 +1,186 @@ +# frozen_string_literal: true +# rubocop:disable all + +require 'test_helper' +require 'zitadel/client/header_selector' + +describe Zitadel::Client::HeaderSelector do + parallelize_me! + + before do + @header_selector = Zitadel::Client::HeaderSelector.new + end + + describe '#json_mime?' do + it 'returns true for application/json' do + _(@header_selector.json_mime?('application/json')).must_equal(true) + end + + it 'returns true for application/json with charset' do + _(@header_selector.json_mime?('application/json; charset=UTF-8')).must_equal(true) + end + + it 'returns true for uppercase APPLICATION/JSON (case insensitive)' do + _(@header_selector.json_mime?('APPLICATION/JSON')).must_equal(true) + end + + it 'returns true for vendor JSON types' do + _(@header_selector.json_mime?('application/vnd.api+json')).must_equal(true) + _(@header_selector.json_mime?('application/vnd.company+json')).must_equal(true) + _(@header_selector.json_mime?('application/hal+json')).must_equal(true) + end + + it 'returns false for text/html' do + _(@header_selector.json_mime?('text/html')).must_equal(false) + end + + it 'returns false for application/xml' do + _(@header_selector.json_mime?('application/xml')).must_equal(false) + end + + it 'returns false for application/octet-stream' do + _(@header_selector.json_mime?('application/octet-stream')).must_equal(false) + end + + it 'returns false for nil' do + _(@header_selector.json_mime?(nil)).must_equal(false) + end + + it 'returns false for empty string' do + _(@header_selector.json_mime?('')).must_equal(false) + end + end + + describe '#select_headers' do + it 'sets Accept header when accepts provided' do + headers = @header_selector.select_headers( + ['application/json'], + 'application/json', + false + ) + _(headers['Accept']).must_equal('application/json') + end + + it 'does not set Accept header when accepts empty' do + headers = @header_selector.select_headers( + [], + 'application/json', + false + ) + _(headers['Accept']).must_be_nil + end + + it 'sets Content-Type header when not multipart' do + headers = @header_selector.select_headers( + ['application/json'], + 'application/json', + false + ) + _(headers['Content-Type']).must_equal('application/json') + end + + it 'does not set Content-Type header when multipart' do + headers = @header_selector.select_headers( + ['application/json'], + 'application/json', + true + ) + _(headers['Content-Type']).must_be_nil + end + + it 'defaults Content-Type to application/json when empty' do + headers = @header_selector.select_headers( + ['application/json'], + '', + false + ) + _(headers['Content-Type']).must_equal('application/json') + end + + it 'defaults Content-Type to application/json when nil' do + headers = @header_selector.select_headers( + ['application/json'], + nil, + false + ) + _(headers['Content-Type']).must_equal('application/json') + end + + it 'returns single accept as-is' do + headers = @header_selector.select_headers( + ['application/json'], + 'application/json', + false + ) + _(headers['Accept']).must_equal('application/json') + end + + it 'returns single non-JSON accept as-is' do + headers = @header_selector.select_headers( + ['text/html'], + 'application/json', + false + ) + _(headers['Accept']).must_equal('text/html') + end + + it 'joins media types in declaration order' do + headers = @header_selector.select_headers( + %w[image/jpeg image/png application/json], + 'application/json', + false + ) + _(headers['Accept']).must_equal('image/jpeg, image/png, application/json') + end + + it 'does not reorder or prioritize JSON types' do + headers = @header_selector.select_headers( + %w[text/html application/vnd.api+json application/json], + 'application/json', + false + ) + _(headers['Accept']).must_equal('text/html, application/vnd.api+json, application/json') + end + + it 'filters out empty entries' do + headers = @header_selector.select_headers( + ['', 'application/json', nil], + 'application/json', + false + ) + _(headers['Accept']).must_equal('application/json') + end + end + + describe '#select_accept_header (private)' do + it 'returns nil for nil input' do + _(@header_selector.send(:select_accept_header, nil)).must_be_nil + end + + it 'returns empty string when all entries are filtered out' do + _(@header_selector.send(:select_accept_header, ['', nil])).must_equal('') + end + + it 'returns empty string for empty array' do + _(@header_selector.send(:select_accept_header, [])).must_equal('') + end + + it 'returns single accept as-is' do + _(@header_selector.send(:select_accept_header, ['application/json'])).must_equal('application/json') + end + + it 'returns single non-JSON accept as-is' do + _(@header_selector.send(:select_accept_header, ['text/html'])).must_equal('text/html') + end + + it 'joins media types in declaration order with ", "' do + result = @header_selector.send(:select_accept_header, %w[image/jpeg image/png application/json]) + _(result).must_equal('image/jpeg, image/png, application/json') + end + + it 'does not reorder or apply quality weights' do + result = @header_selector.send(:select_accept_header, %w[text/html text/plain]) + _(result).must_equal('text/html, text/plain') + end + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index b7f10643..8f2d60f0 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -6,19 +6,24 @@ require 'simplecov-cobertura' require_relative '../lib/zitadel_client' +# The SDK uses lazy Zeitwerk autoloading. The generator-owned unit tests +# exercise classes (e.g. ValueSerializer) that reference sibling constants +# (e.g. ObjectSerializer) which only resolve once Zeitwerk has loaded them. +# Eager-load every registered loader so all constants are available without +# relying on autoload trigger ordering during the tests. +Zeitwerk::Registry.loaders.each(&:eager_load) + Warning.ignore(:method_redefined, __dir__) Dotenv.load('.env') # Override the HTMLFormatter so that it writes its report inside build/coverage/html module SimpleCov module Formatter - # rubocop:disable Style/Documentation module HTMLFormatterPatch def output_path File.join(SimpleCov.coverage_path, 'html') end end - # rubocop:enable Style/Documentation class HTMLFormatter prepend HTMLFormatterPatch @@ -48,49 +53,41 @@ class HTMLFormatter # 🔧 Monkeypatch to override :lineno with :line module Minitest module Reporters - # rubocop:disable Metrics/AbcSize,Style/Documentation,Metrics/MethodLength class JUnitReporter private def parse_xml_for(xml, suite, tests) - suite_result = analyze_suite(tests) file_path = get_relative_path(tests.first) + attributes = testsuite_attributes(suite, tests, file_path) + + # noinspection RubyResolve + xml.testsuite(attributes) do + tests.each { |test| emit_testcase(xml, suite, file_path, test) } + end + end - testsuite_attributes = { - name: suite, - filepath: file_path, - skipped: suite_result[:skip_count], - failures: suite_result[:fail_count], - errors: suite_result[:error_count], - tests: suite_result[:test_count], - assertions: suite_result[:assertion_count], - time: suite_result[:time], - timestamp: suite_result[:timestamp] || Time.now.iso8601, - hostname: Socket.gethostname + def testsuite_attributes(suite, tests, file_path) + result = analyze_suite(tests) + timestamp = @timestamp_report ? result[:timestamp] : (result[:timestamp] || Time.now.iso8601) + { + name: suite, filepath: file_path, + skipped: result[:skip_count], failures: result[:fail_count], + errors: result[:error_count], tests: result[:test_count], + assertions: result[:assertion_count], time: result[:time], + timestamp: timestamp, hostname: Socket.gethostname } - testsuite_attributes[:timestamp] = suite_result[:timestamp] if @timestamp_report + end - # noinspection RubyResolve - xml.testsuite(testsuite_attributes) do - tests.each do |test| - line = get_source_location(test).last - xml.testcase( - name: test.name, - line: line, - classname: suite, - assertions: test.assertions, - time: test.time, - file: file_path - ) do - xml << xml_message_for(test) unless test.passed? - xml << xml_attachment_for(test) if test.respond_to?('metadata') && test.metadata[:failure_screenshot_path] - end - end + def emit_testcase(xml, suite, file_path, test) + xml.testcase( + name: test.name, line: get_source_location(test).last, classname: suite, + assertions: test.assertions, time: test.time, file: file_path + ) do + xml << xml_message_for(test) unless test.passed? + xml << xml_attachment_for(test) if test.respond_to?('metadata') && test.metadata[:failure_screenshot_path] end end end - - # rubocop:enable Metrics/AbcSize,Style/Documentation,Metrics/MethodLength end end @@ -103,3 +100,13 @@ def parse_xml_for(xml, suite, tests) rescue LoadError warn 'minitest-reporters not available — install with `bundle add minitest-reporters`' end + +# The generator-owned spec-independent unit tests (value_serializer, +# header_selector, configuration, transport_options, trace_context_util, +# default_api_client_unit) use the minitest/spec DSL (describe/it/_()) and +# `parallelize_me!`, and rely on test_helper to load the runner. Load the spec +# DSL and autorun here so those tests run with no Docker dependency. (The +# bespoke auth tests require minitest/autorun themselves, so this is harmless +# for them.) +require 'minitest/autorun' +require 'minitest/spec' diff --git a/test/trace_context_util_test.rb b/test/trace_context_util_test.rb new file mode 100644 index 00000000..75064575 --- /dev/null +++ b/test/trace_context_util_test.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true +# rubocop:disable all + +require 'test_helper' +require 'zitadel/client/trace_context_util' + +describe Zitadel::Client::TraceContextUtil do + parallelize_me! + + describe '.inject_trace_context' do + it 'is a no-op without tracer' do + headers = {} + Zitadel::Client::TraceContextUtil.inject_trace_context(headers) + _(headers).must_be_empty + end + + it 'empty headers do not cause exception' do + headers = {} + Zitadel::Client::TraceContextUtil.inject_trace_context(headers) + _(headers.size).must_equal(0) + end + + it 'does not inject traceparent without OTel' do + headers = {} + Zitadel::Client::TraceContextUtil.inject_trace_context(headers) + _(headers).wont_include('traceparent') + end + + it 'does not inject tracestate without OTel' do + headers = {} + Zitadel::Client::TraceContextUtil.inject_trace_context(headers) + _(headers).wont_include('tracestate') + end + + it 'preserves Authorization header' do + headers = { 'Authorization' => 'Bearer token123' } + Zitadel::Client::TraceContextUtil.inject_trace_context(headers) + _(headers['Authorization']).must_equal('Bearer token123') + end + + it 'preserves Content-Type header' do + headers = { 'Content-Type' => 'application/json' } + Zitadel::Client::TraceContextUtil.inject_trace_context(headers) + _(headers['Content-Type']).must_equal('application/json') + end + + it 'preserves X-Request-ID header' do + headers = { 'X-Request-ID' => 'req-12345' } + Zitadel::Client::TraceContextUtil.inject_trace_context(headers) + _(headers['X-Request-ID']).must_equal('req-12345') + end + + it 'preserves all existing headers' do + headers = { + 'Authorization' => 'Bearer token', + 'Content-Type' => 'application/json', + 'X-Request-ID' => 'abc-123' + } + Zitadel::Client::TraceContextUtil.inject_trace_context(headers) + _(headers.size).must_equal(3) + _(headers['Authorization']).must_equal('Bearer token') + _(headers['Content-Type']).must_equal('application/json') + _(headers['X-Request-ID']).must_equal('abc-123') + end + + it 'injects traceparent when a span is active' do + # .NET-specific scenario: Ruby has no ambient tracer like .NET Activity.Current; + # active-span injection requires a fully configured OpenTelemetry SDK. + skip('no ambient tracer; active-span injection requires a configured OpenTelemetry SDK') + end + + it 'includes tracestate when present on the active span' do + # .NET-specific scenario: setting tracestate on an active span requires a + # fully configured OpenTelemetry SDK, which is out of scope for this unit test. + skip('no ambient tracer; tracestate-present requires a configured OpenTelemetry SDK') + end + + it 'omits tracestate when empty on the active span' do + # .NET-specific scenario: exercising an empty tracestate on an active span + # requires a fully configured OpenTelemetry SDK, which is out of scope here. + skip('no ambient tracer; empty-tracestate requires a configured OpenTelemetry SDK') + end + + it 'formats trace flags correctly on the active span' do + # .NET-specific scenario: verifying the recorded trace-flags byte requires a + # fully configured OpenTelemetry SDK with an active span. + skip('no ambient tracer; trace-flags formatting requires a configured OpenTelemetry SDK') + end + end +end diff --git a/test/transport_options_test.rb b/test/transport_options_test.rb new file mode 100644 index 00000000..f81ba699 --- /dev/null +++ b/test/transport_options_test.rb @@ -0,0 +1,203 @@ +# frozen_string_literal: true +# rubocop:disable all + +require 'minitest/autorun' +require 'zitadel-client' + +describe Zitadel::Client::TransportOptions do + parallelize_me! + + it 'verify_ssl defaults to true' do + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.verify_ssl).must_equal true + end + + it 'ca_cert_path defaults to nil' do + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.ca_cert_path).must_be_nil + end + + it 'proxy defaults to nil' do + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.proxy).must_be_nil + end + + it 'timeout defaults to 10000ms' do + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.timeout).must_equal 10_000 + end + + it 'follow_redirects defaults to true' do + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.follow_redirects).must_equal true + end + + it 'max_redirects defaults to nil' do + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.max_redirects).must_be_nil + end + + it 'user_agent defaults to non-empty string' do + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.user_agent).wont_be_nil + _(opts.user_agent).wont_be_empty + end + + it 'default_headers defaults to empty map' do + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.default_headers).must_be_empty + end + + it 'inject_request_id defaults to false' do + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.inject_request_id).must_equal false + end + + it 'builder sets all fields' do + opts = Zitadel::Client::TransportOptions.builder + .verify_ssl(false) + .ca_cert_path('/path/to/ca.pem') + .proxy('http://proxy:8080') + .timeout(5000) + .follow_redirects(false) + .max_redirects(3) + .user_agent('TestAgent/1.0') + .default_header('X-Custom', 'value') + .inject_request_id(true) + .build + + _(opts.verify_ssl).must_equal false + _(opts.ca_cert_path).must_equal '/path/to/ca.pem' + _(opts.proxy).must_equal 'http://proxy:8080' + _(opts.timeout).must_equal 5000 + _(opts.follow_redirects).must_equal false + _(opts.max_redirects).must_equal 3 + _(opts.user_agent).must_equal 'TestAgent/1.0' + _(opts.default_headers).must_equal({ 'X-Custom' => 'value' }) + _(opts.inject_request_id).must_equal true + end + + it 'follow_redirects defaults to true with null max_redirects' do + opts = Zitadel::Client::TransportOptions.builder + .follow_redirects(true) + .build + + _(opts.follow_redirects).must_equal true + _(opts.max_redirects).must_be_nil + end + + it 'invalid proxy URL throws exception' do + assert_raises(ArgumentError) do + Zitadel::Client::TransportOptions.builder.proxy('not-a-url').build + end + end + + it 'null proxy URL is accepted' do + opts = Zitadel::Client::TransportOptions.builder.proxy(nil).build + _(opts.proxy).must_be_nil + end + + it 'builder methods return the same builder instance' do + builder = Zitadel::Client::TransportOptions.builder + + _(builder.verify_ssl(true)).must_be_same_as builder + _(builder.ca_cert_path(nil)).must_be_same_as builder + _(builder.proxy(nil)).must_be_same_as builder + _(builder.timeout(nil)).must_be_same_as builder + _(builder.follow_redirects(true)).must_be_same_as builder + _(builder.max_redirects(nil)).must_be_same_as builder + _(builder.user_agent(nil)).must_be_same_as builder + _(builder.default_header('X-Key', 'val')).must_be_same_as builder + _(builder.default_headers({})).must_be_same_as builder + _(builder.inject_request_id(false)).must_be_same_as builder + end + + it 'accumulates headers from default_header calls' do + opts = Zitadel::Client::TransportOptions.builder + .default_header('X-First', 'one') + .default_header('X-Second', 'two') + .build + + _(opts.default_headers.size).must_equal 2 + _(opts.default_headers['X-First']).must_equal 'one' + _(opts.default_headers['X-Second']).must_equal 'two' + end + + it 'merges headers from default_headers call' do + opts = Zitadel::Client::TransportOptions.builder + .default_header('X-First', 'one') + .default_headers({ 'X-Second' => 'two', 'X-Third' => 'three' }) + .build + + _(opts.default_headers.size).must_equal 3 + _(opts.default_headers['X-First']).must_equal 'one' + _(opts.default_headers['X-Second']).must_equal 'two' + _(opts.default_headers['X-Third']).must_equal 'three' + end + + it 'modifying source map does not affect built options' do + headers = { 'X-Original' => 'original' } + + opts = Zitadel::Client::TransportOptions.builder + .default_headers(headers) + .build + + headers['X-Added'] = 'added' + + _(opts.default_headers.size).must_equal 1 + _(opts.default_headers['X-Original']).must_equal 'original' + _(opts.default_headers.key?('X-Added')).must_equal false + _(opts.default_headers).must_be :frozen? + end + + it 'builder produces independent instances' do + builder = Zitadel::Client::TransportOptions.builder.verify_ssl(false) + first = builder.build + second = builder.build + + _(first.verify_ssl).must_equal second.verify_ssl + _(first).wont_be_same_as second + end + + # TimeoutConfigTests + + it 'timeout defaults to 10000ms' do + # Default TransportOptions applies a 10-second timeout. + opts = Zitadel::Client::TransportOptions.builder.build + _(opts.timeout).must_equal 10_000 + end + + it 'timeout can be explicitly set to nil for no timeout' do + opts = Zitadel::Client::TransportOptions.builder.timeout(nil).build + _(opts.timeout).must_be_nil + end + + it 'setting timeout to 5000 is accessible' do + opts = Zitadel::Client::TransportOptions.builder.timeout(5000).build + _(opts.timeout).must_equal 5000 + end + + it 'timeout field is named exactly timeout' do + # Verify via the reader that the field is named :timeout (not :open_timeout or :connection_timeout). + opts = Zitadel::Client::TransportOptions.builder.timeout(1000).build + _(opts.timeout).wont_be_nil + _(opts.timeout).must_equal 1000 + end + + # ProxyConfigTests + + it 'setting proxy URL is preserved on read-back' do + opts = Zitadel::Client::TransportOptions.builder + .proxy('http://proxy.example.com:8080') + .build + _(opts.proxy).must_equal 'http://proxy.example.com:8080' + end + + it 'setting proxy is supported on all platforms' do + # Proxy configuration must not raise on any platform. + opts = Zitadel::Client::TransportOptions.builder + .proxy('http://proxy.example.com:8080') + .build + _(opts.proxy).must_equal 'http://proxy.example.com:8080' + end +end diff --git a/test/value_serializer_test.rb b/test/value_serializer_test.rb new file mode 100644 index 00000000..14118c43 --- /dev/null +++ b/test/value_serializer_test.rb @@ -0,0 +1,484 @@ +# frozen_string_literal: true +# rubocop:disable all + +require 'test_helper' + +describe Zitadel::Client::ValueSerializer do + parallelize_me! + + describe 'path location' do + it 'null returns empty string' do + _(Zitadel::Client::ValueSerializer.serialize(nil, :path, 'string')).must_equal('') + end + + it 'string returns URL-encoded value' do + _(Zitadel::Client::ValueSerializer.serialize('hello', :path, 'string')).must_equal('hello') + end + + it 'string with spaces is URL-encoded' do + _(Zitadel::Client::ValueSerializer.serialize('hello world', :path, 'string')).must_equal('hello%20world') + end + + it 'string with slash is URL-encoded' do + _(Zitadel::Client::ValueSerializer.serialize('a/b', :path, 'string')).must_equal('a%2Fb') + end + + it 'integer returns string' do + _(Zitadel::Client::ValueSerializer.serialize(42, :path, 'integer')).must_equal('42') + end + + it 'boolean true returns true' do + _(Zitadel::Client::ValueSerializer.serialize(true, :path, 'boolean')).must_equal('true') + end + + it 'boolean false returns false' do + _(Zitadel::Client::ValueSerializer.serialize(false, :path, 'boolean')).must_equal('false') + end + end + + describe 'query location' do + it 'null returns nil' do + _(Zitadel::Client::ValueSerializer.serialize(nil, :query, 'string')).must_be_nil + end + + it 'string returns as-is' do + _(Zitadel::Client::ValueSerializer.serialize('hello', :query, 'string')).must_equal('hello') + end + + it 'integer returns string' do + _(Zitadel::Client::ValueSerializer.serialize(42, :query, 'integer')).must_equal('42') + end + + it 'boolean true returns true' do + _(Zitadel::Client::ValueSerializer.serialize(true, :query, 'boolean')).must_equal('true') + end + + it 'boolean false returns false' do + _(Zitadel::Client::ValueSerializer.serialize(false, :query, 'boolean')).must_equal('false') + end + + it 'array joins with comma by default' do + _(Zitadel::Client::ValueSerializer.serialize(%w[a b c], :query, 'array')).must_equal('a,b,c') + end + + it 'array joins with comma for csv' do + result = Zitadel::Client::ValueSerializer.serialize(%w[a b c], :query, 'array', collection_format: :csv) + _(result).must_equal('a,b,c') + end + + it 'array joins with space for ssv' do + result = Zitadel::Client::ValueSerializer.serialize(%w[a b c], :query, 'array', collection_format: :ssv) + _(result).must_equal('a b c') + end + + it 'array joins with tab for tsv' do + result = Zitadel::Client::ValueSerializer.serialize(%w[a b c], :query, 'array', collection_format: :tsv) + _(result).must_equal("a\tb\tc") + end + + it 'array joins with pipe for pipes' do + result = Zitadel::Client::ValueSerializer.serialize(%w[a b c], :query, 'array', collection_format: :pipes) + _(result).must_equal('a|b|c') + end + + it 'array returns list for multi' do + result = Zitadel::Client::ValueSerializer.serialize(%w[a b c], :query, 'array', collection_format: :multi) + _(result).must_equal(%w[a b c]) + end + + it 'empty array returns empty string for csv' do + _(Zitadel::Client::ValueSerializer.serialize([], :query, 'array')).must_equal('') + end + + it 'empty array returns empty list for multi' do + _(Zitadel::Client::ValueSerializer.serialize([], :query, 'array', collection_format: :multi)).must_equal([]) + end + + it 'single-element array returns single value' do + _(Zitadel::Client::ValueSerializer.serialize(['a'], :query, 'array')).must_equal('a') + end + + it 'array of integers stringifies elements' do + _(Zitadel::Client::ValueSerializer.serialize([1, 2, 3], :query, 'array')).must_equal('1,2,3') + end + + it 'array of booleans stringifies elements' do + _(Zitadel::Client::ValueSerializer.serialize([true, false], :query, 'array')).must_equal('true,false') + end + end + + describe 'header location' do + it 'null returns empty string' do + _(Zitadel::Client::ValueSerializer.serialize(nil, :header, 'string')).must_equal('') + end + + it 'string returns as-is' do + _(Zitadel::Client::ValueSerializer.serialize('hello', :header, 'string')).must_equal('hello') + end + + it 'integer returns string' do + _(Zitadel::Client::ValueSerializer.serialize(42, :header, 'integer')).must_equal('42') + end + + it 'boolean true returns true' do + _(Zitadel::Client::ValueSerializer.serialize(true, :header, 'boolean')).must_equal('true') + end + + it 'array joins with comma' do + _(Zitadel::Client::ValueSerializer.serialize(%w[a b c], :header, 'array')).must_equal('a,b,c') + end + + it 'empty array joins to empty string' do + _(Zitadel::Client::ValueSerializer.serialize([], :header, 'array')).must_equal('') + end + + it 'array of integers stringifies and joins' do + _(Zitadel::Client::ValueSerializer.serialize([1, 2, 3], :header, 'array')).must_equal('1,2,3') + end + end + + describe 'cookie location' do + it 'string returns as-is' do + _(Zitadel::Client::ValueSerializer.serialize('hello', :cookie, 'string')).must_equal('hello') + end + + it 'null returns empty string' do + _(Zitadel::Client::ValueSerializer.serialize(nil, :cookie, 'string')).must_equal('') + end + end + + describe 'form location' do + it 'null returns empty string' do + _(Zitadel::Client::ValueSerializer.serialize(nil, :form, 'string')).must_equal('') + end + + it 'string returns as-is' do + _(Zitadel::Client::ValueSerializer.serialize('hello', :form, 'string')).must_equal('hello') + end + + it 'integer returns string' do + _(Zitadel::Client::ValueSerializer.serialize(42, :form, 'integer')).must_equal('42') + end + + it 'boolean true returns true' do + _(Zitadel::Client::ValueSerializer.serialize(true, :form, 'boolean')).must_equal('true') + end + + it 'boolean false returns false' do + _(Zitadel::Client::ValueSerializer.serialize(false, :form, 'boolean')).must_equal('false') + end + end + + describe 'serialize_styled' do + describe 'matrix style' do + it 'scalar returns semicolon-prefixed name=value' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', 'blue', :path, 'string', nil, 'matrix', true) + _(result).must_equal(';color=blue') + end + + it 'array with explode false joins with comma' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', %w[blue black], :path, 'array', nil, 'matrix', false + ) + _(result).must_equal(';color=blue,black') + end + + it 'array with explode true repeats name' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', %w[blue black], :path, 'array', nil, 'matrix', true + ) + _(result).must_equal(';color=blue;color=black') + end + + it 'null returns empty string' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', nil, :path, 'string', nil, 'matrix', true) + _(result).must_equal('') + end + end + + describe 'label style' do + it 'scalar returns dot-prefixed value' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', 'blue', :path, 'string', nil, 'label', true) + _(result).must_equal('.blue') + end + + it 'array with explode false joins with comma after dot' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', %w[blue black], :path, 'array', nil, 'label', false + ) + _(result).must_equal('.blue,black') + end + + it 'array with explode true joins with dot separator' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', %w[blue black], :path, 'array', nil, 'label', true + ) + _(result).must_equal('.blue.black') + end + + it 'null returns empty string' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', nil, :path, 'string', nil, 'label', true) + _(result).must_equal('') + end + end + + describe 'spaceDelimited style' do + it 'array joins with space' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', %w[blue black], :query, 'array', nil, 'spaceDelimited', false + ) + _(result).must_equal('blue black') + end + + it 'scalar returns stringified value' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', 'blue', :query, 'string', nil, 'spaceDelimited', false + ) + _(result).must_equal('blue') + end + end + + describe 'pipeDelimited style' do + it 'array joins with pipe' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', %w[blue black], :query, 'array', nil, 'pipeDelimited', false + ) + _(result).must_equal('blue|black') + end + + it 'scalar returns stringified value' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', 'blue', :query, 'string', nil, 'pipeDelimited', false + ) + _(result).must_equal('blue') + end + end + + describe 'form style with explode' do + it 'array with explode false joins with comma' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', %w[blue black], :query, 'array', nil, 'form', false + ) + _(result).must_equal('blue,black') + end + + it 'array with explode true returns list' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', %w[blue black], :query, 'array', nil, 'form', true + ) + _(result).must_equal(%w[blue black]) + end + + it 'scalar with explode true returns string not list' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', 'blue', :query, 'string', nil, 'form', true + ) + _(result).must_equal('blue') + end + + it 'single-element array with explode true returns list' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'color', ['blue'], :query, 'array', nil, 'form', true + ) + _(result).must_equal(['blue']) + end + + it 'null returns nil for query location' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', nil, :query, 'string', nil, 'form', true) + _(result).must_be_nil + end + end + + describe 'simple style backward compatibility' do + it 'scalar returns stringified value' do + result = Zitadel::Client::ValueSerializer.serialize_styled('id', '5', :path, 'string', nil, 'simple', false) + _(result).must_equal('5') + end + + it 'array joins with comma' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'id', %w[3 4 5], :path, 'array', nil, 'simple', false + ) + _(result).must_equal('3,4,5') + end + + it 'null returns empty string' do + result = Zitadel::Client::ValueSerializer.serialize_styled('id', nil, :path, 'string', nil, 'simple', true) + _(result).must_equal('') + end + + it 'scalar URL-encodes for path' do + result = Zitadel::Client::ValueSerializer.serialize_styled( + 'id', 'hello world', :path, 'string', nil, 'simple', false + ) + _(result).must_equal('hello%20world') + end + end + + describe 'null style falls back to location default' do + it 'path with null style behaves like simple' do + result = Zitadel::Client::ValueSerializer.serialize_styled('id', '5', :path, 'string', nil, nil, false) + _(result).must_equal('5') + end + + it 'empty style falls back to location default' do + result = Zitadel::Client::ValueSerializer.serialize_styled('id', '5', :path, 'string', nil, '', false) + _(result).must_equal('5') + end + end + end + + describe 'serialize_deep_object' do + it 'basic map returns bracketed keys' do + result = Zitadel::Client::ValueSerializer.serialize_deep_object('filter', { 'color' => 'blue', 'size' => 'large' }) + _(result['filter[color]']).must_equal('blue') + _(result['filter[size]']).must_equal('large') + end + + it 'null returns empty hash' do + result = Zitadel::Client::ValueSerializer.serialize_deep_object('filter', nil) + _(result).must_equal({}) + end + end + + # Cross-language parity tests for path-segment percent-encoding. + # Every SDK must produce identical encoded strings for these inputs. + describe 'path encoding parity' do + it 'ASCII-safe pass-through' do + _(Zitadel::Client::ValueSerializer.serialize('abc123', :path, 'string')).must_equal('abc123') + end + + it 'space encoded as %20' do + _(Zitadel::Client::ValueSerializer.serialize('a b', :path, 'string')).must_equal('a%20b') + end + + it 'slash encoded' do + _(Zitadel::Client::ValueSerializer.serialize('a/b', :path, 'string')).must_equal('a%2Fb') + end + + it 'question mark encoded' do + _(Zitadel::Client::ValueSerializer.serialize('a?b', :path, 'string')).must_equal('a%3Fb') + end + + it 'hash encoded' do + _(Zitadel::Client::ValueSerializer.serialize('a#b', :path, 'string')).must_equal('a%23b') + end + + it 'comma preserved (sub-delimiter)' do + _(Zitadel::Client::ValueSerializer.serialize('a,b', :path, 'string')).must_equal('a,b') + end + + it 'colon preserved (sub-delimiter)' do + _(Zitadel::Client::ValueSerializer.serialize('a:b', :path, 'string')).must_equal('a:b') + end + + it 'plus preserved (sub-delimiter)' do + _(Zitadel::Client::ValueSerializer.serialize('a+b', :path, 'string')).must_equal('a+b') + end + + it 'tilde preserved (RFC 3986 unreserved)' do + # '~' is an RFC 3986 unreserved character and must never be + # percent-encoded. URI.encode_www_form_component emits %7E; the + # canonical encoding (Java, Kotlin, Node, C#, etc.) keeps a literal '~'. + _(Zitadel::Client::ValueSerializer.serialize('a~b', :path, 'string')).must_equal('a~b') + _(Zitadel::Client::ValueSerializer.serialize('~', :path, 'string')).must_equal('~') + end + + it 'unicode encoded as UTF-8 percent' do + _(Zitadel::Client::ValueSerializer.serialize('日本', :path, 'string')).must_equal('%E6%97%A5%E6%9C%AC') + end + + it 'empty string preserved' do + _(Zitadel::Client::ValueSerializer.serialize('', :path, 'string')).must_equal('') + end + + it 'null returns empty string in path location' do + _(Zitadel::Client::ValueSerializer.serialize(nil, :path, 'string')).must_equal('') + end + + it 'simple style encodes value' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', 'a b', :path, 'string', nil, 'simple', false) + _(result).must_equal('a%20b') + end + + it 'simple style array encodes each item' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', ['a b', 'c?d'], :path, 'array', nil, 'simple', false) + _(result).must_equal('a%20b,c%3Fd') + end + + it 'path_array_item_with_reserved_char_is_percent_encoded' do + # Gap W1 regression: every per-item path value in a styled array + # must be percent-encoded BEFORE being joined with the structural + # separator. Otherwise '/', '?', '#', space leak into the URL. + items = %w[a/b c] + _(Zitadel::Client::ValueSerializer.serialize_styled('name', items, :path, 'array', nil, 'simple', false)) + .must_equal('a%2Fb,c') + _(Zitadel::Client::ValueSerializer.serialize_styled('name', items, :path, 'array', nil, 'label', true)) + .must_equal('.a%2Fb.c') + _(Zitadel::Client::ValueSerializer.serialize_styled('name', items, :path, 'array', nil, 'matrix', false)) + .must_equal(';name=a%2Fb,c') + end + + it 'matrix style encodes value' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', 'a b', :path, 'string', nil, 'matrix', false) + _(result).must_equal(';color=a%20b') + end + + it 'label style encodes value' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', 'a b', :path, 'string', nil, 'label', false) + _(result).must_equal('.a%20b') + end + + it 'query location is not path-encoded' do + result = Zitadel::Client::ValueSerializer.serialize_styled('color', 'a b', :query, 'string', nil, 'form', false) + _(result).must_equal('a b') + end + + it 'empty string path param raises ArgumentError' do + # Gap W — empty-string path values silently produce malformed + # URLs like `/pet//details`; reject at serialization time so + # callers see the real error rather than a downstream 404. + _(-> { + Zitadel::Client::ValueSerializer.serialize_styled('id', '', :path, 'string', nil, 'simple', false) + }).must_raise ArgumentError + end + + it 'path value is encoded exactly once (no double-encoding)' do + # path-double-encoding: serialize_styled already percent-encodes the path + # segment, so the api template must NOT wrap it again. A space must become + # %20 (never %2520) and a slash %2F (never %252F). + space = Zitadel::Client::ValueSerializer.serialize_styled('id', 'a b', :path, 'string', nil, 'simple', false) + _(space).must_equal('a%20b') + _(space).wont_include('%2520') + slash = Zitadel::Client::ValueSerializer.serialize_styled('id', 'a/b', :path, 'string', nil, 'simple', false) + _(slash).must_equal('a%2Fb') + _(slash).wont_include('%252F') + end + end + + # N3/W3 parity: `format: date` path parameters must emit a date-only + # string (YYYY-MM-DD), not a full ISO datetime. Ruby models + # `format: date` as `Date`, whose `to_s` already produces YYYY-MM-DD. + describe 'format:date path parameter emits YYYY-MM-DD' do + require 'date' + + it 'Date in path returns YYYY-MM-DD' do + date = Date.new(2024, 1, 15) + _(Zitadel::Client::ValueSerializer.serialize(date, :path, 'string')).must_equal('2024-01-15') + end + + it 'Date via serialize_styled simple returns YYYY-MM-DD' do + date = Date.new(2024, 1, 15) + result = Zitadel::Client::ValueSerializer.serialize_styled('since', date, :path, 'string', nil, 'simple', false) + _(result).must_equal('2024-01-15') + end + + it 'Date at a day/year boundary still emits date-only (no time/offset leak)' do + # UTC/midnight edge: a date on the year boundary must serialize as a bare + # YYYY-MM-DD with no time/offset suffix, matching the stringifyDate UTC + # behaviour of Go/Node/Swift/Dart. + date = Date.new(2024, 12, 31) + _(Zitadel::Client::ValueSerializer.serialize(date, :path, 'string')).must_equal('2024-12-31') + end + end +end diff --git a/test/zitadel/client/api_client_test.rb b/test/zitadel/client/api_client_test.rb deleted file mode 100644 index e0c90c0c..00000000 --- a/test/zitadel/client/api_client_test.rb +++ /dev/null @@ -1,101 +0,0 @@ -# frozen_string_literal: true - -# API Client Test -# -# This test verifies that the ApiClient correctly builds the endpoint path using the base URL provided by -# the authenticator and includes the Personal Access Token in the Authorization header. -# -# A WireMock server is started using TestContainers and configured via a JSON mapping to simulate the -# response for '/your/endpoint'. The test then invokes the API using an ApiClient that utilizes a -# PersonalAccessTokenAuthenticator and asserts that the API response matches the expected output. - -# noinspection RubyResolve -require 'test_helper' -require 'minitest/autorun' -require 'minitest/hooks/test' -require 'testcontainers' -require 'net/http' -require 'json' -require 'logger' - -module Zitadel - module Client - class ApiClientTest < Minitest::Test - include Minitest::Hooks - - def before_all - super - @mock_server = Testcontainers::DockerContainer - .new('wiremock/wiremock:3.12.1') - .with_exposed_port(8080) - .start - - @mock_server.wait_for_http(container_port: 8080, path: '/', status: 403) - # noinspection HttpUrlsUsage - @oauth_host = "http://#{@mock_server.host}:#{@mock_server.mapped_port(8080)}" - end - - def after_all - @mock_server&.stop - @mock_server&.remove - super - end - - ## - # Test the ApiClient#call_api method to ensure that the correct headers and content type - # are applied, and that a GET request to '/your/endpoint' returns the expected response. - # - # @return [void] - # rubocop:disable Minitest/MultipleAssertions,Metrics/MethodLength - def test_assert_headers_and_content_type - mapping_uri = URI("#{@oauth_host}/__admin/mappings") - http = Net::HTTP.new(mapping_uri.host || raise('Host is missing'), mapping_uri.port) - mapping_request = Net::HTTP::Post.new(mapping_uri, { 'Content-Type' => 'application/json' }) - mapping_request.body = JSON.generate( - { - request: { - method: 'GET', - url: '/your/endpoint', - headers: { - 'Authorization' => { - equalTo: 'Bearer mm' - }, - # rubocop:disable Layout/LineLength - 'User-Agent' => { - matches: '^zitadel-client/\\d+\\.\\d+\\.\\d+([.-][a-zA-Z0-9]+(\\.\\d+)?)? \\(lang=ruby; lang_version=[^;]+; os=[^;]+; arch=[^;]+\\)$' - } - # rubocop:enable Layout/LineLength - } - }, - response: { - status: 200, - body: '{"key": "value"}', - headers: { - 'Content-Type' => 'application/json' - } - } - } - ) - mapping_response = http.request(mapping_request) - - assert_includes [200, 201], mapping_response.code.to_i, - "Mapping creation failed with status #{mapping_response.code}" - - config = Configuration.new(Auth::PersonalAccessTokenAuthenticator.new(@oauth_host, 'mm')) - api_client = ApiClient.new(config) - data, status, headers = api_client.call_api('GET', '/your/endpoint', return_type: 'Object') - - assert_equal 200, status, "Expected status 200, but got #{status}" - assert_instance_of(Hash, data, 'Expected response data to be a Hash') - assert_equal 'application/json', headers['Content-Type'], - "Expected Content-Type header to be 'application/json'" - expected = { 'key' => 'value' } - response_data = data.transform_keys(&:to_s) - - assert_equal expected, response_data, "Expected response body #{expected}, but got #{data}" - end - - # rubocop:enable Minitest/MultipleAssertions,Metrics/MethodLength - end - end -end diff --git a/test/zitadel/client/api_error_test.rb b/test/zitadel/client/api_error_test.rb deleted file mode 100644 index e230dd7e..00000000 --- a/test/zitadel/client/api_error_test.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'minitest/autorun' - -module Zitadel - module Client - class ApiErrorTest < Minitest::Test - # rubocop:disable Minitest/MultipleAssertions - def test_api_error_attributes - headers = { 'H' => ['v'] } - err = ApiError.new(418, headers, 'body') - - assert_kind_of ZitadelError, err - assert_equal 'Error 418', err.message - assert_equal 418, err.code - assert_equal headers, err.response_headers - assert_equal 'body', err.response_body - end - - # rubocop:enable Minitest/MultipleAssertions - end - end -end diff --git a/test/zitadel/client/auth/client_credentials_authenticator_test.rb b/test/zitadel/client/auth/client_credentials_authenticator_test.rb index 7ac3bc3e..f7fec721 100644 --- a/test/zitadel/client/auth/client_credentials_authenticator_test.rb +++ b/test/zitadel/client/auth/client_credentials_authenticator_test.rb @@ -33,6 +33,7 @@ def setup .builder(oauth_host, 'dummy-client', 'dummy-secret') .scopes('openid', 'foo') .build + inject_api_client(@authenticator) end ## @@ -59,7 +60,7 @@ def test_access_token_is_not_empty def test_auth_headers_contains_bearer_token token = @authenticator.send(:refresh_token) - expected = { 'Authorization' => "Bearer #{token.token}" } + expected = { 'Authorization' => "Bearer #{token}" } assert_equal expected, @authenticator.send(:auth_headers) end @@ -74,8 +75,7 @@ def test_auth_headers_contains_bearer_token def test_refresh_token_returns_valid_token token = @authenticator.send(:refresh_token) - refute_nil token.token - refute_predicate token, :expired? + refute_nil token end ## @@ -87,7 +87,7 @@ def test_refresh_token_returns_valid_token def test_auth_token_matches_refreshed_token token = @authenticator.send(:refresh_token) - assert_equal token.token, @authenticator.send(:auth_token) + assert_equal token, @authenticator.send(:auth_token) end ## @@ -109,11 +109,27 @@ def test_authenticator_honors_supplied_host # This confirms that the authenticator does not cache or reuse tokens # and generates fresh credentials on demand. def test_refresh_token_produces_unique_tokens - token1 = @authenticator.send(:refresh_token).token - token2 = @authenticator.send(:refresh_token).token + token1 = @authenticator.send(:refresh_token) + token2 = @authenticator.send(:refresh_token) refute_equal token1, token2 end + + ## + # @return [void] + # + # Verifies that the client secret is masked in both #inspect and #to_s + # while the client id stays visible. + def test_redacts_secret + secret = 'super-secret-credential-value' + auth = ClientCredentialsAuthenticator.new(OpenId.allocate, 'visible-client-id', secret, %w[openid].to_set) + auth.instance_variable_set(:@access_token, secret) + + rendered = auth.inspect + auth.to_s + refute_includes rendered, secret + assert_includes rendered, '***' + assert_includes auth.inspect, 'visible-client-id' + end end end end diff --git a/test/zitadel/client/auth/oauth_authenticator_test.rb b/test/zitadel/client/auth/oauth_authenticator_test.rb index f5b0c6b1..3be3019b 100644 --- a/test/zitadel/client/auth/oauth_authenticator_test.rb +++ b/test/zitadel/client/auth/oauth_authenticator_test.rb @@ -33,12 +33,40 @@ def before_all end def after_all - @mock_server&.stop + @mock_server.stop super end # Helper for subclasses to access the OAuth host. attr_reader :oauth_host + + # Injects a real SDK transport into the authenticator, mirroring what + # Zitadel::Client::Client does for HttpAwareAuthenticator instances. + # + # The bespoke OAuth authenticators require the shared ApiClient before + # they can perform token exchange against the mock OAuth2 server. + # + # @param authenticator [HttpAwareAuthenticator] + # @return [HttpAwareAuthenticator] the same authenticator, for chaining + def inject_api_client(authenticator) + authenticator.api_client = + ::Zitadel::Client::DefaultApiClient.new(::Zitadel::Client::TransportOptions.builder.build) + authenticator + end + + ## + # Verifies that the cached access token is masked in both #inspect and #to_s. + # + # @return [void] + def test_redacts_secret + secret = 'super-secret-credential-value' + auth = OAuthAuthenticator.new(OpenId.allocate, 'visible-client-id', 'openid') + auth.instance_variable_set(:@access_token, secret) + + rendered = auth.inspect + auth.to_s + refute_includes rendered, secret + assert_includes rendered, '***' + end end end end diff --git a/test/zitadel/client/auth/personal_access_token_authenticator_test.rb b/test/zitadel/client/auth/personal_access_token_authenticator_test.rb index 2b801072..5ce9a63d 100644 --- a/test/zitadel/client/auth/personal_access_token_authenticator_test.rb +++ b/test/zitadel/client/auth/personal_access_token_authenticator_test.rb @@ -36,6 +36,20 @@ def test_returns_expected_headers_and_host assert_equal({ 'Authorization' => 'Bearer my-secret-token' }, auth.send(:auth_headers)) assert_equal('https://api.example.com', auth.send(:host)) end + + ## + # Verifies that the personal access token is masked in both #inspect and #to_s. + # + # @return [void] + def test_redacts_secret + secret = 'super-secret-credential-value' + auth = Auth::PersonalAccessTokenAuthenticator.new('https://api.example.com', secret) + + [auth.inspect, auth.to_s].each do |rendered| + refute_includes rendered, secret + assert_includes rendered, '***' + end + end end end end diff --git a/test/zitadel/client/auth/web_token_authenticator_test.rb b/test/zitadel/client/auth/web_token_authenticator_test.rb index 5ba03121..073f355c 100644 --- a/test/zitadel/client/auth/web_token_authenticator_test.rb +++ b/test/zitadel/client/auth/web_token_authenticator_test.rb @@ -35,6 +35,7 @@ def setup .builder(oauth_host, 'dummy-client', key) .token_lifetime_seconds(3600) .build + inject_api_client(@authenticator) end ## @@ -61,8 +62,7 @@ def test_access_token_is_not_empty def test_refresh_token_returns_valid_token token = @authenticator.send(:refresh_token) - refute_nil token.token - refute_predicate token, :expired? + refute_nil token end ## @@ -75,7 +75,7 @@ def test_refresh_token_returns_valid_token def test_auth_headers_contains_bearer_token token = @authenticator.send(:refresh_token) - expected = { 'Authorization' => "Bearer #{token.token}" } + expected = { 'Authorization' => "Bearer #{token}" } assert_equal expected, @authenticator.send(:auth_headers) end @@ -88,8 +88,8 @@ def test_auth_headers_contains_bearer_token # This confirms that the authenticator does not cache or reuse tokens # and generates fresh credentials on demand. def test_refresh_token_produces_unique_tokens - token1 = @authenticator.send(:refresh_token).token - token2 = @authenticator.send(:refresh_token).token + token1 = @authenticator.send(:refresh_token) + token2 = @authenticator.send(:refresh_token) refute_equal token1, token2 end @@ -104,6 +104,25 @@ def test_refresh_token_produces_unique_tokens def test_authenticator_honors_supplied_host assert_equal oauth_host, @authenticator.send(:host) end + + ## + # @return [void] + # + # Verifies that the signing key and cached access token are masked in + # both #inspect and #to_s. + def test_redacts_secret + key = OpenSSL::PKey::RSA.new(2048) + assertion = WebTokenAuthenticator::JwtAssertion.new( + issuer: 'z', subject: 'z', audience: 'a', private_key: key, lifetime: 1, algorithm: 'RS256', key_id: nil + ) + auth = WebTokenAuthenticator.new(OpenId.allocate, 'zitadel', %w[openid].to_set, assertion) + auth.instance_variable_set(:@access_token, 'super-secret-credential-value') + + rendered = auth.inspect + auth.to_s + refute_includes rendered, 'super-secret-credential-value' + refute_includes rendered, key.to_pem + assert_includes rendered, '***' + end end end end diff --git a/test/zitadel/client/configuration_test.rb b/test/zitadel/client/configuration_test.rb deleted file mode 100644 index cb09731a..00000000 --- a/test/zitadel/client/configuration_test.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -# noinspection RubyResolve -require 'test_helper' -require 'minitest/autorun' - -module Zitadel - module Client - class ConfigurationTest < Minitest::Test - ## - # Test user agent getter and setter - # - # @return [void] - def test_user_agent_getter_and_setter - config = Configuration.new - - assert_match( - %r{\Azitadel-client/\d+\.\d+\.\d+([.-][a-zA-Z0-9]+(\.\d+)?)? \(lang=ruby; lang_version=[^;]+; os=[^;]+; arch=[^;]+\)\z}, - config.user_agent - ) - config.user_agent = 'CustomUserAgent/1.0' - - assert_equal 'CustomUserAgent/1.0', config.user_agent - end - end - end -end diff --git a/test/zitadel/client/transport_options_test.rb b/test/zitadel/client/transport_options_test.rb deleted file mode 100644 index 7c0a11a7..00000000 --- a/test/zitadel/client/transport_options_test.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' -require 'minitest/autorun' - -module Zitadel - module Client - class TransportOptionsTest < Minitest::Test - FIXTURES_DIR = File.join(__dir__, '..', '..', 'fixtures') - - def test_defaults_returns_empty - assert_empty(TransportOptions.defaults.to_connection_opts) - end - - def test_insecure_sets_ssl_verify - opts = TransportOptions.new(insecure: true) - result = opts.to_connection_opts - - assert_equal({ verify: false }, result[:ssl]) - end - - def test_ca_cert_path_sets_cert_store - ca_path = File.join(FIXTURES_DIR, 'ca.pem') - opts = TransportOptions.new(ca_cert_path: ca_path) - result = opts.to_connection_opts - - assert_instance_of OpenSSL::X509::Store, result[:ssl][:cert_store] - assert result[:ssl][:verify] - end - - def test_proxy_url_sets_proxy - opts = TransportOptions.new(proxy_url: 'http://proxy:3128') - result = opts.to_connection_opts - - assert_equal 'http://proxy:3128', result[:proxy] - end - - def test_default_headers_sets_headers - opts = TransportOptions.new(default_headers: { 'X-Custom' => 'value' }) - result = opts.to_connection_opts - - assert_equal({ 'X-Custom' => 'value' }, result[:headers]) - end - - def test_insecure_takes_precedence_over_ca_cert - opts = TransportOptions.new(insecure: true, ca_cert_path: '/nonexistent/ca.pem') - result = opts.to_connection_opts - - assert_equal({ verify: false }, result[:ssl]) - end - - def test_frozen - opts = TransportOptions.defaults - - assert_predicate opts, :frozen? - end - - def test_defaults_factory - opts = TransportOptions.defaults - - assert_empty(opts.default_headers) - assert_nil opts.ca_cert_path - refute opts.insecure - end - - def test_defaults_factory_proxy_url - opts = TransportOptions.defaults - - assert_nil opts.proxy_url - end - end - end -end diff --git a/test/zitadel/client/zitadel_test.rb b/test/zitadel/client/zitadel_test.rb index 91ccc50b..1b5870fb 100644 --- a/test/zitadel/client/zitadel_test.rb +++ b/test/zitadel/client/zitadel_test.rb @@ -7,138 +7,148 @@ require 'docker' require 'securerandom' -FIXTURES_DIR = File.join(__dir__, '..', '..', 'fixtures') +FIXTURES_DIR = File.join(__dir__ || '.', '..', '..', 'fixtures') + +WIREMOCK_COMMAND = [ + '--https-port', '8443', + '--https-keystore', '/home/wiremock/keystore.p12', + '--keystore-password', 'password', + '--keystore-type', 'PKCS12', + '--global-response-templating' +].freeze module Zitadel module Client - class ZitadelTest < Minitest::Test # rubocop:disable Metrics/ClassLength + class ZitadelTest < Minitest::Test include Minitest::Hooks - # rubocop:disable Metrics/MethodLength def before_all super @ca_cert_path = File.join(FIXTURES_DIR, 'ca.pem') - keystore_path = File.join(FIXTURES_DIR, 'keystore.p12') - squid_conf = File.join(FIXTURES_DIR, 'squid.conf') + @network = Docker::Network.create("zitadel-test-#{SecureRandom.hex(4)}") - @network_name = "zitadel-test-#{SecureRandom.hex(4)}" - @network = Docker::Network.create(@network_name) - - mappings_dir = File.join(FIXTURES_DIR, 'mappings') - - @wiremock = Testcontainers::DockerContainer.new('wiremock/wiremock:3.12.1') - .with_filesystem_binds("#{keystore_path}:/home/wiremock/keystore.p12:ro") - .with_filesystem_binds("#{mappings_dir}:/home/wiremock/mappings:ro") - .with_command( - '--https-port', '8443', - '--https-keystore', '/home/wiremock/keystore.p12', - '--keystore-password', 'password', - '--keystore-type', 'PKCS12', - '--global-response-templating' - ) - .with_exposed_ports(8080, 8443) - .start - @wiremock.wait_for_http(container_port: 8080, path: '/__admin/mappings', status: 200) - - wiremock_id = @wiremock._id - @network.connect(wiremock_id, {}, 'EndpointConfig' => { 'Aliases' => ['wiremock'] }) - - @proxy = Testcontainers::DockerContainer.new('ubuntu/squid:6.10-24.10_beta') - .with_filesystem_binds("#{squid_conf}:/etc/squid/squid.conf:ro") - .with_exposed_ports(3128) - .start - @proxy.wait_for_tcp_port(3128) + @wiremock = start_wiremock + @network.connect(@wiremock._id, {}, 'EndpointConfig' => { 'Aliases' => ['wiremock'] }) + @proxy = start_proxy @network.connect(@proxy._id) + capture_endpoints + end + + def capture_endpoints @host = @wiremock.host @http_port = @wiremock.mapped_port(8080) @https_port = @wiremock.mapped_port(8443) @proxy_port = @proxy.mapped_port(3128) end - # rubocop:enable Metrics/MethodLength + + def start_wiremock + keystore_bind = "#{File.join(FIXTURES_DIR, 'keystore.p12')}:/home/wiremock/keystore.p12:ro" + mappings_bind = "#{File.join(FIXTURES_DIR, 'mappings')}:/home/wiremock/mappings:ro" + + container = Testcontainers::DockerContainer.new('wiremock/wiremock:3.12.1') + .with_filesystem_binds(keystore_bind) + .with_filesystem_binds(mappings_bind) + .with_command(*WIREMOCK_COMMAND) + .with_exposed_ports(8080, 8443) + .start + container.wait_for_http(container_port: 8080, path: '/__admin/mappings', status: 200) + container + end + + def start_proxy + squid_conf = File.join(FIXTURES_DIR, 'squid.conf') + container = Testcontainers::DockerContainer.new('ubuntu/squid:6.10-24.10_beta') + .with_filesystem_binds("#{squid_conf}:/etc/squid/squid.conf:ro") + .with_exposed_ports(3128) + .start + container.wait_for_tcp_port(3128) + container + end def after_all @proxy&.stop @proxy&.remove @wiremock&.stop @wiremock&.remove - @network&.remove + @network.remove super end def test_zitadel_exposes_all_service_apis - expected = Api.constants - .map { |const| Api.const_get(const) } - .select { |klass| klass.is_a?(Class) && klass.name.end_with?('ServiceApi') } - .to_set - + expected = Api.constants.map { |const| Api.const_get(const) } zitadel = Zitadel.new(Auth::NoAuthAuthenticator.new) + actual = Zitadel.instance_methods(false).map { |meth| zitadel.public_send(meth).class } - actual = Zitadel.instance_methods(false) - .map { |meth| zitadel.public_send(meth).class } - .select { |klass| klass.name.end_with?('ServiceApi') } - .to_set + assert_equal service_api_classes(expected), service_api_classes(actual) + end - assert_equal expected, actual + # The +*ServiceApi+ classes from a list of constants, as a set. + def service_api_classes(klasses) + klasses.select { |klass| klass.is_a?(Class) && klass.name.end_with?('ServiceApi') }.to_set end - def test_custom_ca_cert - zitadel = ::Zitadel::Client::Zitadel.with_client_credentials( - "https://#{@host}:#{@https_port}", - 'dummy-client', 'dummy-secret', - transport_options: TransportOptions.new(ca_cert_path: @ca_cert_path) - ) + # Builds a client-credentials SDK client against the given URL with the + # supplied transport options, then returns the general settings response. + def general_settings(url, transport_options) + authenticator = Auth::ClientCredentialsAuthenticator + .builder(url, 'dummy-client', 'dummy-secret', transport_options: transport_options) + .build + zitadel = ::Zitadel::Client::Zitadel.with_authenticator(authenticator, transport_options) + zitadel.settings_service.get_general_settings({}) + end - response = zitadel.settings.get_general_settings({}) + def test_custom_ca_cert + opts = TransportOptions.builder.ca_cert_path(@ca_cert_path).build - assert_equal 'https', response.default_language + assert_equal 'https', general_settings("https://#{@host}:#{@https_port}", opts).default_language end def test_insecure_mode - zitadel = ::Zitadel::Client::Zitadel.with_client_credentials( - "https://#{@host}:#{@https_port}", - 'dummy-client', 'dummy-secret', - transport_options: TransportOptions.new(insecure: true) - ) - - response = zitadel.settings.get_general_settings({}) + opts = TransportOptions.builder.verify_ssl(false).build - assert_equal 'https', response.default_language + assert_equal 'https', general_settings("https://#{@host}:#{@https_port}", opts).default_language end def test_default_headers - opts = TransportOptions.new(default_headers: { 'X-Custom-Header' => 'test-value' }) - zitadel = ::Zitadel::Client::Zitadel.with_client_credentials( - "http://#{@host}:#{@http_port}", - 'dummy-client', 'dummy-secret', - transport_options: opts - ) - - response = zitadel.settings.get_general_settings({}) + opts = TransportOptions.builder.default_headers({ 'X-Custom-Header' => 'test-value' }).build + response = general_settings("http://#{@host}:#{@http_port}", opts) assert_equal 'http', response.default_language assert_equal 'test-value', response.default_org_id end def test_proxy_url - zitadel = ::Zitadel::Client::Zitadel.with_access_token( - 'http://wiremock:8080', - 'test-token', - transport_options: TransportOptions.new(proxy_url: "http://#{@host}:#{@proxy_port}") - ) + transport_options = TransportOptions.builder.proxy("http://#{@host}:#{@proxy_port}").build + authenticator = Auth::PersonalAccessTokenAuthenticator.new('http://wiremock:8080', 'test-token') + zitadel = ::Zitadel::Client::Zitadel.with_authenticator(authenticator, transport_options) - response = zitadel.settings.get_general_settings({}) + # Squid resolves the `wiremock` network alias via Docker's embedded DNS, + # which can briefly be unavailable right after both containers join the + # network; retry the first proxied call past that warm-up window. + response = with_proxy_retry { zitadel.settings_service.get_general_settings({}) } assert_equal 'http', response.default_language end + # Retries a block while the proxy reports a transient connectivity error + # ("Connection reset by peer", "end of file reached"), up to a few times. + def with_proxy_retry(attempts: 5) + (1...attempts).each do + return yield + rescue ::Zitadel::Client::ApiError + sleep 1 + end + yield + end + def test_no_ca_cert_fails assert_raises(StandardError) do - ::Zitadel::Client::Zitadel.with_client_credentials( - "https://#{@host}:#{@https_port}", - 'dummy-client', 'dummy-secret' - ) + authenticator = Auth::ClientCredentialsAuthenticator + .builder("https://#{@host}:#{@https_port}", 'dummy-client', 'dummy-secret') + .build + ::Zitadel::Client::Zitadel.with_authenticator(authenticator) end end end diff --git a/zitadel-client.gemspec b/zitadel-client.gemspec index 11dd6197..bfbd8d4c 100644 --- a/zitadel-client.gemspec +++ b/zitadel-client.gemspec @@ -1,39 +1,47 @@ # frozen_string_literal: true +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you +# in integrating with your Zitadel environment. This SDK enables you to handle +# resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + require_relative 'lib/zitadel/client/version' -# noinspection RubyArgCount -Gem::Specification.new do |gemspec| - gemspec.name = 'zitadel-client' - gemspec.version = Zitadel::Client::VERSION - gemspec.platform = Gem::Platform::RUBY - gemspec.authors = ['Zitadel'] - gemspec.email = ['hi@zitadel.com'] - gemspec.homepage = 'https://zitadel.com/' - gemspec.summary = 'Official Zitadel SDK for Ruby' - gemspec.description = - "Official Zitadel SDK for Ruby. Authenticate and access Zitadel's authentication and management APIs in Ruby." - gemspec.license = 'Apache-2.0' - gemspec.required_ruby_version = '>= 3.0' - gemspec.metadata = { 'rubygems_mfa_required' => 'true' } +Gem::Specification.new do |s| + s.name = 'zitadel-client' + s.version = Zitadel::Client::VERSION + s.platform = Gem::Platform::RUBY + s.authors = ['OpenAPI-Generator'] + s.summary = 'Zitadel SDK Ruby Gem' + s.description = 'The Zitadel SDK is a convenience wrapper around the Zitadel ' \ + 'APIs to assist you in integrating with your Zitadel ' \ + 'environment. This SDK enables you to handle resources, ' \ + 'settings, and configurations within the Zitadel platform.' + s.license = 'MIT' + s.required_ruby_version = '>= 3.4' + s.metadata['rubygems_mfa_required'] = 'true' - gemspec.add_dependency 'cgi', '>= 0.1' - gemspec.add_dependency 'date', '>= 3.0' - gemspec.add_dependency 'logger', '>= 1.4' - gemspec.add_dependency 'net-http', '>= 0.1' - gemspec.add_dependency 'oauth2', '~> 2.0' - gemspec.add_dependency 'tempfile', '>= 0.1' - gemspec.add_dependency 'time', '>= 0.1' - gemspec.add_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - gemspec.add_dependency 'uri', '>= 0.10' - gemspec.add_dependency 'warning', '~> 1.5.0' - gemspec.add_dependency 'zeitwerk', '~> 2.5' + s.add_dependency 'dry-struct', '~> 1.6' + s.add_dependency 'dry-types', '~> 1.7' + s.add_dependency 'faraday', '~> 2.0' + s.add_dependency 'faraday-follow_redirects', '~> 0.3' + # 4.8: format: duration — ISO-8601 duration parsing/formatting (no + # stdlib equivalent; lighter than ActiveSupport::Duration). + s.add_dependency 'iso8601', '~> 0.13' + # 4.8: format: time — time-of-day (HH:MM:SS) values; Ruby has no + # native time-of-day type so we standardise on Tod::TimeOfDay. + s.add_dependency 'tod', '~> 3.1' + # JWT signing for the private-key (JWT bearer) authenticator. + s.add_dependency 'jwt', '~> 3.0' + # Hand-written entrypoint: Zeitwerk autoloading + redefinition-warning + # suppression for the constant-tree wiring. + s.add_dependency 'warning', '~> 1.5' + s.add_dependency 'zeitwerk', '~> 2.5' - gemspec.files = Dir.chdir(File.expand_path(__dir__)) do - `find lib sig README.md LICENSE -type f -print0 2>/dev/null`.split("\x0").reject do |f| - f.match(/\.gem\z/) - end - end - gemspec.executables = [] - gemspec.require_paths = ['lib'] + s.files = Dir['lib/**/*', 'sig/**/*', 'README.md', 'Gemfile', 'zitadel-client.gemspec'] + s.require_paths = ['lib'] end